summaryrefslogtreecommitdiffstats
path: root/osx/bundleify.sh
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-11 19:57:52 +0000
committerDavid Robillard <d@drobilla.net>2011-01-11 19:57:52 +0000
commitbff08fcbd085cf7af81cc5ac4e4edcb74bb3deb4 (patch)
tree785d255f1f8e810fd14703793b84092b6bb41600 /osx/bundleify.sh
parent8ad8594ef42af57e9e566b3ea9b9e13f01c5dc53 (diff)
downloadpatchage-bff08fcbd085cf7af81cc5ac4e4edcb74bb3deb4.tar.gz
patchage-bff08fcbd085cf7af81cc5ac4e4edcb74bb3deb4.tar.bz2
patchage-bff08fcbd085cf7af81cc5ac4e4edcb74bb3deb4.zip
Build a proper .app on OSX.
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@2827 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'osx/bundleify.sh')
-rwxr-xr-xosx/bundleify.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/osx/bundleify.sh b/osx/bundleify.sh
new file mode 100755
index 0000000..caf4a26
--- /dev/null
+++ b/osx/bundleify.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+bundle=$1
+exe=$2
+
+libs="`otool -L $exe | grep '\.dylib\|\.so' | grep '/User\|/opt/local' | sed 's/(.*//'`"
+
+mkdir "$bundle/Contents/lib"
+for l in $libs; do
+ cp $l $bundle/Contents/lib
+done
+
+mkdir "$bundle/Contents/lib/engines"
+cp /opt/local/lib/gtk-2.0/2.10.0/engines/libclearlooks.so $bundle/Contents/lib/engines
+
+mkdir "$bundle/Contents/lib/modules"
+cp /opt/local/lib/pango/1.6.0/modules/*basic*.so $bundle/Contents/lib/modules
+
+reclibs="`otool -L $bundle/Contents/lib/engines/* $bundle/Contents/lib/modules/* | grep '\.dylib\|\.so' | grep '/User\|/opt/local' | sed 's/(.*//'`"
+
+for l in $libs $reclibs; do
+ lname=`echo $l | sed 's/.*\///'`
+ lid="@executable_path/lib/$lname"
+ lpath="$bundle/Contents/lib/$lname"
+ install_name_tool -id $lid $lpath
+ install_name_tool -change $l $lid $exe
+ for j in `find $bundle -name '*.so' -or -name '*.dylib'`; do
+ install_name_tool -change $l $lid $j
+ done;
+done
+
+echo "External library references:"
+otool -L $exe `find $bundle -name '*.so' -or -name '*.dylib'` | grep -v ':' | grep -v '@executable_path' | sort | uniq