forked from clamor-s/creamlinux
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from T00fy/master
Fix for CK3/other games with similar directory structure
- Loading branch information
Showing
4 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ build/ | |
.cache | ||
.vscode | ||
lib/ | ||
output | ||
output | ||
.idea | ||
cmake-build-debug/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,28 @@ | ||
#!/bin/bash | ||
cp "$PWD/lib32Creamlinux.so" /tmp/lib32Creamlinux.so | ||
cp "$PWD/lib64Creamlinux.so" /tmp/lib64Creamlinux.so | ||
cp "$PWD/$(find . -name "libsteam_api.so" -printf "%P\n" | head -n 1)" /tmp/libsteam_api.so | ||
copy_file() { | ||
cp "$1" "$2" || { echo "Error: Failed to copy $1 to $2"; exit 1; } | ||
} | ||
|
||
LIBSTEAM_API_DIR=$(find . -name "libsteam_api.so" -printf "%h\n" | head -n 1) | ||
[ -z "$LIBSTEAM_API_DIR" ] && { echo "Error: libsteam_api.so not found."; exit 1; } | ||
if [ ! -z "$CREAM_CONFIG_PATH" ]; then | ||
if [ ! -f "$CREAM_CONFIG_PATH/cream_api.ini" ]; then | ||
echo "Error: cream_api.ini not found in CREAM_CONFIG_PATH."; exit 1; | ||
fi | ||
else | ||
if [ ! -f "$PWD/cream_api.ini" ]; then | ||
echo "Error: cream_api.ini not found in the current working directory."; exit 1; | ||
fi | ||
fi | ||
if [ -z "$CREAM_CONFIG_PATH" ] && [ "$LIBSTEAM_API_DIR" != "$PWD" ]; then | ||
export CREAM_CONFIG_PATH="$PWD/cream_api.ini" | ||
fi | ||
|
||
copy_file "$PWD/lib32Creamlinux.so" /tmp/lib32Creamlinux.so | ||
copy_file "$PWD/lib64Creamlinux.so" /tmp/lib64Creamlinux.so | ||
copy_file "$LIBSTEAM_API_DIR/libsteam_api.so" /tmp/libsteam_api.so | ||
|
||
LD_PRELOAD="$LD_PRELOAD /tmp/lib64Creamlinux.so /tmp/lib32Creamlinux.so /tmp/libsteam_api.so" "$@" | ||
EXITCODE=$? | ||
rm /tmp/lib32Creamlinux.so | ||
rm /tmp/lib64Creamlinux.so | ||
rm /tmp/libsteam_api.so | ||
rm -f /tmp/lib32Creamlinux.so /tmp/lib64Creamlinux.so /tmp/libsteam_api.so | ||
exit $EXITCODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters