aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/LaunchSLClient/make-OSX-app.sh
blob: 9b9177e625588cc30a1435058505c02354772f9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

# This script will build LaunchSLClient.app from the .exe, .dll's, and
# other necessary files.
#
# This should be run from the bin directory.

APP_NAME="LaunchSLClient"

# Note that proper form is to copy Frameworks to
# *.app/Contents/Frameworks, but because @executable_path resolves to
# [...]/Resources/bin, and the libraries reference
# @executable_path/../Frameworks, we put frameworks in
# Contents/Resources instead.
FRAMEWORKS_PATH="${APP_NAME}.app/Contents/Resources/Frameworks"

if [ ! -e ${APP_NAME}.exe ]; then
    echo "Error: Could not find ${APP_NAME}.exe." >& 2
    echo "Have you built it, and are you currently in the bin directory?" >& 2
    exit 1
fi

CMDFLAGS="-m console -n ${APP_NAME} -a ${APP_NAME}.exe"

REFERENCES="-r /Library/Frameworks/Mono.framework/Versions/Current/lib/ \
    -r Nini.dll \
    -r ${APP_NAME}.ini"

if [ -f ${APP_NAME}.icns ]; then
    CMDFLAGS="${CMDFLAGS} -i ${APP_NAME}.icns"
else
    echo "Warning: no icon file found.  Will use default application icon." >&2
fi

if [ -d ${APP_NAME}.app ]; then rm -rf ${APP_NAME}.app; fi
macpack ${REFERENCES} ${CMDFLAGS}

mkdir -p ${FRAMEWORKS_PATH}