2021-03-02 14:39:44 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
pushd bin/Debug
|
|
|
|
mkdir -p vcmiclient.app/Frameworks
|
|
|
|
|
2021-03-07 14:18:40 +02:00
|
|
|
productsDir=$(pwd)
|
2021-03-02 14:39:44 +02:00
|
|
|
sdl2Path=~/dev/ios/vcmi-ios-deps/SDL2-lib/lib
|
2021-03-07 14:18:40 +02:00
|
|
|
for app in vcmiclient vcmiserver; do
|
|
|
|
install_name_tool -rpath "$sdl2Path" '@executable_path/Frameworks' "$productsDir/$app.app/$app"
|
|
|
|
done
|
|
|
|
|
|
|
|
cp *.dylib AI/*.dylib "$sdl2Path/libSDL2.dylib" vcmiclient.app
|
|
|
|
cd vcmiclient.app
|
2021-03-02 14:39:44 +02:00
|
|
|
|
|
|
|
for b in vcmiclient *.dylib; do
|
|
|
|
for l in minizip vcmi; do
|
|
|
|
libName="lib${l}.dylib"
|
2021-03-07 14:18:40 +02:00
|
|
|
install_name_tool -change "$productsDir/$libName" "@rpath/$libName" "$b"
|
2021-03-02 14:39:44 +02:00
|
|
|
done
|
|
|
|
if [ "$b" != vcmiclient ]; then
|
|
|
|
install_name_tool -id "@rpath/$b" "$b"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
mv -f *.dylib Frameworks
|
|
|
|
popd
|
|
|
|
|
2021-03-07 14:18:40 +02:00
|
|
|
cp -R bin/Debug-iphoneos/* "$productsDir/vcmiclient.app"
|
|
|
|
cp -fR "$productsDir/vcmiclient.app/Frameworks" "$productsDir/vcmiserver.app"
|
|
|
|
|
|
|
|
for l in minizip vcmi; do
|
|
|
|
libName="lib${l}.dylib"
|
|
|
|
install_name_tool -change "$productsDir/$libName" "@rpath/$libName" "$productsDir/vcmiserver.app/vcmiserver"
|
|
|
|
done
|