#!/bin/bash
~/Qt/5.12.5/clang_64/bin/macdeployqt parallel-launcher.app -libpath=./lib -always-overwrite
cp ./lib/libdiscord-rpc.dylib ./parallel-launcher.app/Contents/Frameworks/
cp ./lib/libboost_filesystem.dylib ./parallel-launcher.app/Contents/Frameworks/
cp ./lib/libboost_system.dylib ./parallel-launcher.app/Contents/Frameworks/
mkdir ./parallel-launcher.app/Contents/Resources/translations
cp ./lang/*.qm ./parallel-launcher.app/Contents/Resources/translations
cp ./styles/*.dylib ./parallel-launcher.app/Contents/PlugIns/styles
mkdir ./parallel-launcher.app/Contents/Resources/fonts
cp ./macfonts/*.ttf ./parallel-launcher.app/Contents/Resources/fonts
rm ./parallel-launcher.app/Contents/PlugIns/styles/libqmacstyle.dylib
cp ./mac-extra/mkfs.fat ./parallel-launcher.app/Contents/Resources/mkfs.fat
cp ./parallel-launcher-lsjs ./parallel-launcher.app/Contents/Resources/parallel-launcher-lsjs
cp ./parallel-launcher-sdl-relay ./parallel-launcher.app/Contents/Resources/parallel-launcher-sdl-relay
install_name_tool -change /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/../Frameworks/libSDL2-2.0.0.dylib ./parallel-launcher.app/Contents/Resources/parallel-launcher-lsjs
install_name_tool -change /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib @executable_path/../Frameworks/libSDL2-2.0.0.dylib ./parallel-launcher.app/Contents/Resources/parallel-launcher-sdl-relay
