Created
May 20, 2021 19:31
-
-
Save flibitijibibo/e6c7d61db94b48829083cd6e21cfdca7 to your computer and use it in GitHub Desktop.
Build script for FNA3D/FAudio
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
#!/bin/bash | |
run_builds() { | |
cd ~/libraries/$1 | |
cd flibitBuild | |
make -j8 | |
cd ../flibitBuildWin32 | |
make -j8 | |
cd ../flibitBuildWin64 | |
make -j8 | |
} | |
run_mac_builds() { | |
cd ~/libraries/$1 | |
ORIGPATH=$PATH | |
PATH=$ORIGPATH:/home/flibitijibibo/osxcross/target/bin ; export PATH | |
cd flibitBuildMac | |
scl enable devtoolset-10 "x86_64-apple-darwin18-cmake .." | |
scl enable devtoolset-10 "make -j8" | |
PATH=$ORIGPATH:/home/flibitijibibo/osxcross-11/target/bin ; export PATH | |
cd ../flibitBuildMacARM | |
scl enable devtoolset-10 "aarch64-apple-darwin21-cmake .." | |
scl enable devtoolset-10 "make -j8" | |
PATH=$ORIGPATH ; export PATH | |
} | |
pack_builds() { | |
ORIGPATH=$PATH | |
PATH=$ORIGPATH:/home/flibitijibibo/osxcross-11/target/bin ; export PATH | |
cd ~/libraries/$1/dist | |
mkdir -p lib64 | |
mkdir -p x86 | |
mkdir -p x64 | |
mkdir -p osx | |
mkdir -p osx-staging | |
cp ../flibitBuild/lib$1.so.0 lib64/ | |
cp ../flibitBuildWin32/$1.dll x86/ | |
cp ../flibitBuildWin64/$1.dll x64/ | |
cp ../flibitBuildMac/lib$1.0.dylib osx-staging/lib$1.0.dylib_x86_64 | |
cp ../flibitBuildMacARM/lib$1.0.dylib osx-staging/lib$1.0.dylib_arm64 | |
i686-w64-mingw32-strip -S x86/$1.dll | |
x86_64-w64-mingw32-strip -S x64/$1.dll | |
x86_64-apple-darwin21-strip -S osx-staging/lib$1.0.dylib_x86_64 | |
aarch64-apple-darwin21-strip -S osx-staging/lib$1.0.dylib_arm64 | |
x86_64-apple-darwin21-install_name_tool -id @rpath/lib$1.0.dylib osx-staging/lib$1.0.dylib_x86_64 | |
x86_64-apple-darwin21-install_name_tool -change /usr/local/lib/libSDL2-2.0.0.dylib @rpath/libSDL2-2.0.0.dylib osx-staging/lib$1.0.dylib_x86_64 | |
aarch64-apple-darwin21-install_name_tool -id @rpath/lib$1.0.dylib osx-staging/lib$1.0.dylib_arm64 | |
aarch64-apple-darwin21-install_name_tool -change /usr/local/lib/libSDL2-2.0.0.dylib @rpath/libSDL2-2.0.0.dylib osx-staging/lib$1.0.dylib_arm64 | |
xcrun lipo -create osx-staging/lib$1.0.dylib_x86_64 osx-staging/lib$1.0.dylib_arm64 -output osx/lib$1.0.dylib | |
chrpath -d lib64/lib$1.so.0 | |
strip --only-keep-debug lib64/lib$1.so.0 -o debug_symbols/lib$1.so.0.debug | |
strip -S lib64/lib$1.so.0 | |
objcopy --add-gnu-debuglink=debug_symbols/lib$1.so.0.debug lib64/lib$1.so.0 | |
tar cvfj ${1,,}.tar.bz2 */* | |
PATH=$ORIGPATH ; export PATH | |
} | |
set -ex | |
run_builds FAudio | |
run_builds FNA3D | |
run_mac_builds FAudio | |
run_mac_builds FNA3D | |
pack_builds FAudio | |
pack_builds FNA3D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment