Skip to content
Permalink
Browse files

Fix Mac .app build scripts

  • Loading branch information...
Amanieu committed Mar 1, 2015
1 parent fb830ea commit d4afdc055dd292dc842149bade9b99bb23faaf7f
Showing with 15 additions and 17 deletions.
  1. +7 −8 build-macosx-app-single.sh
  2. +7 −8 build-macosx-app.sh → build-macosx-app-universal.sh
  3. +1 −1 macosx/unvanquished.sh
@@ -8,8 +8,8 @@ set -u
# Dynamic libraries for inclusion in app bundle
DEPS_VERSION=3
SDL2_VERSION=2.0.3
GLEW_VERSION=1.10.0
OPENAL_VERSION=1.15.1
GLEW_VERSION=1.12.0
OPENAL_VERSION=1.16.0

# Usage
if [ "${#}" -ne "2" ]; then
@@ -39,22 +39,21 @@ install -m 644 "${SOURCE_PATH}/macosx/Unvanquished.icns" "${DEST_PATH}/Contents/
install -d "${DEST_PATH}/Contents/MacOS"
install -m 755 "${SOURCE_PATH}/macosx/unvanquished.sh" "${DEST_PATH}/Contents/MacOS"

# Make universal binaries
# Make (non-)universal binaries
make_universal() {
install -m "${2}" "${BUILD_PATH}/${1}" "${DEST_PATH}/Contents/MacOS/${1}"
}
make_universal daemon 755
make_universal daemonded 755
make_universal daemon-tty 755
make_universal sel_ldr 755
make_universal game-nacl-native-exe 755
make_universal cgame-qvm-native.so 644
make_universal nacl_loader 755
install -m 644 "${BUILD_PATH}/irt_core-${PKG_ARCH}.nexe" "${DEST_PATH}/Contents/MacOS/irt_core-${PKG_ARCH}.nexe"

# Create a universal version of GLEW and OpenAL and add it to the bundle
install -m 644 "${DEPS_PATH}/lib/libGLEW.${GLEW_VERSION}.dylib" "${DEST_PATH}/Contents/MacOS/libGLEW.${GLEW_VERSION}.dylib"
install -m 644 "${DEPS_PATH}/lib/libopenal.${OPENAL_VERSION}.dylib" "${DEST_PATH}/Contents/MacOS/libopenal.${OPENAL_VERSION}.dylib"

# SDL is already compiled as a universal binary, copy as is
# SDL is already compiled as a universal binary, just remove the headers
cp -a "${DEPS_PATH}/SDL2.framework" "${DEST_PATH}/Contents/MacOS/"

rm -f "${DEST_PATH}/Contents/MacOS/SDL2.framework/Headers"
rm -rf "${DEST_PATH}/Contents/MacOS/SDL2.framework/Versions/A/Headers"
@@ -8,8 +8,8 @@ set -u
# Dynamic libraries for inclusion in app bundle
DEPS_VERSION=3
SDL2_VERSION=2.0.3
GLEW_VERSION=1.10.0
OPENAL_VERSION=1.15.1
GLEW_VERSION=1.12.0
OPENAL_VERSION=1.16.0

# Usage
if [ "${#}" -ne "2" ]; then
@@ -42,9 +42,7 @@ make_universal() {
make_universal daemon 755
make_universal daemonded 755
make_universal daemon-tty 755
make_universal sel_ldr 755
make_universal game-nacl-native-exe 755
make_universal cgame-qvm-native.so 644
make_universal nacl_loader 755
install -m 644 "${BUILD32_PATH}/irt_core-x86.nexe" "${DEST_PATH}/Contents/MacOS/irt_core-x86.nexe"
install -m 644 "${BUILD64_PATH}/irt_core-x86_64.nexe" "${DEST_PATH}/Contents/MacOS/irt_core-x86_64.nexe"

@@ -54,6 +52,7 @@ chmod 644 "${DEST_PATH}/Contents/MacOS/libGLEW.${GLEW_VERSION}.dylib"
lipo -create -o "${DEST_PATH}/Contents/MacOS/libopenal.${OPENAL_VERSION}.dylib" "${DEPS32_PATH}/lib/libopenal.${OPENAL_VERSION}.dylib" "${DEPS64_PATH}/lib/libopenal.${OPENAL_VERSION}.dylib"
chmod 644 "${DEST_PATH}/Contents/MacOS/libopenal.${OPENAL_VERSION}.dylib"

# SDL is already compiled as a universal binary, copy as is
cp -a "${DEPS64_PATH}/SDL2.framework" "${DEST_PATH}/Contents/MacOS/"

# SDL is already compiled as a universal binary, just remove the headers
cp -a "${DEPS_PATH}/SDL2.framework" "${DEST_PATH}/Contents/MacOS/"
rm -f "${DEST_PATH}/Contents/MacOS/SDL2.framework/Headers"
rm -rf "${DEST_PATH}/Contents/MacOS/SDL2.framework/Versions/A/Headers"
@@ -2,4 +2,4 @@
APP_BUNDLE="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
PARENT_DIR="$(cd "${APP_BUNDLE}/.." && pwd)"
cd "${APP_BUNDLE}/Contents/MacOS"
exec "${APP_BUNDLE}/Contents/MacOS/daemon" +set fs_basepath "${PARENT_DIR}" +set fs_libpath "${APP_BUNDLE}/Contents/MacOS" "$@"
exec "${APP_BUNDLE}/Contents/MacOS/daemon" -pakpath "${PARENT_DIR}/pkg" "$@"

0 comments on commit d4afdc0

Please sign in to comment.
You can’t perform that action at this time.