Minimize binary size and external dependencies in OS X LaunchSLClient.app creation script.

0.6.0-stable
Jeff Ames 2008-05-02 03:30:44 +00:00
parent 412ca26565
commit f94099b485
3 changed files with 46 additions and 19 deletions

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>LaunchSLClient</string>
<key>CFBundleExecutable</key>
<string>LaunchSLClient</string>
<key>CFBundleIconFile</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,13 @@
#!/bin/sh
PWD=`pwd`
# Fetch the path relative to the launch point where this shell script exists.
APP_PATH=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+3] != "") { if (patharr[idx] != "/") {printf("%s/", patharr[idx]); idx++ }} }'`
# Fetch the app name (its our own name)
APP_NAME=`echo $0 | awk '{split($0,patharr,"/"); idx=1; while(patharr[idx+1] != "") {idx++} printf("%s", patharr[idx]); }'`
cd "$APP_PATH/Contents/Resources"
./$APP_NAME

View File

@ -6,13 +6,22 @@
# This should be run from the bin directory. # This should be run from the bin directory.
APP_NAME="LaunchSLClient" APP_NAME="LaunchSLClient"
SOURCE_PATH="../OpenSim/Tools/${APP_NAME}"
# Note that proper form is to copy Frameworks to ASSEMBLIES="mscorlib.dll \
# *.app/Contents/Frameworks, but because @executable_path resolves to System.Windows.Forms.dll \
# [...]/Resources/bin, and the libraries reference System.Drawing.dll \
# @executable_path/../Frameworks, we put frameworks in System.Configuration.dll \
# Contents/Resources instead. System.Xml.dll \
FRAMEWORKS_PATH="${APP_NAME}.app/Contents/Resources/Frameworks" System.Security.dll \
Mono.Security.dll \
System.Data.dll \
Mono.Data.Tds.dll \
System.Transactions.dll \
System.EnterpriseServices.dll \
Mono.Mozilla.dll \
Mono.Posix.dll \
Accessibility.dll"
if [ ! -e ${APP_NAME}.exe ]; then if [ ! -e ${APP_NAME}.exe ]; then
echo "Error: Could not find ${APP_NAME}.exe." >& 2 echo "Error: Could not find ${APP_NAME}.exe." >& 2
@ -20,19 +29,12 @@ if [ ! -e ${APP_NAME}.exe ]; then
exit 1 exit 1
fi fi
CMDFLAGS="-m console -n ${APP_NAME} -a ${APP_NAME}.exe" mkbundle2 -z -o ${APP_NAME} ${APP_NAME}.exe ${ASSEMBLIES} || exit 1
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 if [ -d ${APP_NAME}.app ]; then rm -rf ${APP_NAME}.app; fi
macpack ${REFERENCES} ${CMDFLAGS} cp -r ${SOURCE_PATH}/${APP_NAME}.app.skel ${APP_NAME}.app
mkdir -p ${FRAMEWORKS_PATH} # mkbundle doesn't seem to recognize the -L option, so we can't include Nini.dll in the bundling
cp Nini.dll ${APP_NAME}.app/Contents/Resources
cp ${APP_NAME} ${APP_NAME}.ini ${APP_NAME}.app/Contents/Resources