forked from elizagamedev/mkxp-oneshot
-
Notifications
You must be signed in to change notification settings - Fork 0
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 elizagamedev#22 from rkevin-arch/better-builds
Better builds
- Loading branch information
Showing
13 changed files
with
122 additions
and
91 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
This file was deleted.
Oops, something went wrong.
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
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
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash -eu | ||
|
||
# this blacklist is used by linuxdeploy | ||
EXCLUDELIST=https://raw.githubusercontent.com/AppImage/pkg2appimage/master/excludelist | ||
SO_BLACKLIST="$(curl -sL $EXCLUDELIST | grep -o '^[^ #]*')" | ||
SO_PROCESSED="" | ||
|
||
function fail() { | ||
echo "$1" | ||
echo "Please beat the crap out of rkevin until he fixes this issue." | ||
exit 1 | ||
} | ||
|
||
function copy_dependencies() { | ||
if [[ $SO_BLACKLIST =~ $1 ]]; then | ||
return | ||
fi | ||
if [[ $SO_PROCESSED =~ $1 ]]; then | ||
return | ||
fi | ||
[[ ! $1 =~ ^[a-zA-Z0-9+\.-]*$ ]] && fail "The library $1 has weird characters!" | ||
|
||
SO_PROCESSED="$SO_PROCESSED $1" | ||
cp "$2" "$DESTDIR/$1" | ||
patchelf --set-rpath '$ORIGIN' "$DESTDIR/$1" | ||
ldd "$2" | while read -ra line; do | ||
if [[ ${line[0]} == 'linux-vdso.so.1' ]] || [[ ${line[0]} =~ 'ld-linux-x86-64.so.2' ]]; then | ||
continue | ||
fi | ||
[[ ${line[1]} != '=>' ]] && echo ${line[*]} && fail "ldd's output isn't what this script expected!" | ||
[[ ! ${line[3]} =~ ^\(0x[0-9a-f]*\)$ ]] && echo ${line[*]} && fail "ldd's output isn't what this script expected!" | ||
copy_dependencies "${line[0]}" "${line[2]}" | ||
done | ||
} | ||
|
||
if [ $# -lt 2 ]; then | ||
echo "Usage: $0 BUILD_PATH DIST_PATH [DATA_PATH]" | ||
fi | ||
|
||
shopt -s dotglob | ||
|
||
if [ $# -eq 3 ] && [ -d $3 ]; then | ||
echo "Copying game files..." | ||
cp -ar $3/* $2 | ||
fi | ||
|
||
echo "Relocating dependencies..." | ||
DESTDIR="$2/lib" | ||
mkdir -p $DESTDIR | ||
copy_dependencies oneshot "$1/bin/oneshot" | ||
|
||
echo "Copying standard library..." | ||
cp -ar "$1/bin/lib/ruby" "$2/lib/" | ||
cp -ar "$1/bin/lib/cacert.pem" "$2/lib/" | ||
ln -sf "lib/oneshot" "$2/oneshot" | ||
|
||
echo "Done!" |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <windows.h> | ||
#include <wchar.h> | ||
|
||
const wchar_t *ARGV0 = "lib\\oneshot.exe"; | ||
|
||
int WINAPI WinMain(HINSTANCE hInstance, | ||
HINSTANCE hPrevInstance, | ||
LPSTR lpCmdLine, | ||
int nCmdShow) { | ||
(void)hInstance; | ||
(void)hPrevInstance; | ||
(void)lpCmdLine; | ||
(void)nCmdShow; | ||
|
||
int argc; | ||
LPWSTR *argv = CommandLineToArgvW(GetCommandLineW(), &argc); | ||
|
||
HMODULE hModule = GetModuleHandle(NULL); | ||
if (hModule != NULL) { | ||
wchar_t *oneshotDir[MAX_PATH]; | ||
GetModuleFileNameW(hModule, oneshotDir, sizeof(oneshotDir)); | ||
_wchdir(oneshotDir); | ||
} | ||
|
||
if (argc != 0) { | ||
argv[0] = ARGV0; | ||
} | ||
|
||
_wexecv(L"lib\\oneshot.exe", argv); | ||
MessageBoxW(NULL, | ||
L"Cannot start ModShot for some reason.\nPlease check your ModShot installation.", | ||
L"ModShot Shim", | ||
MB_ICONERROR); | ||
return 1; | ||
} |