OSX: make the app bundle run without fink installed, by copying all required librarie...
[divverent/netradiant.git] / install-dylibs.sh
1 #!/bin/sh
2
3 set -ex
4
5 : ${OTOOL:=otool}
6 : ${CP:=cp}
7 : ${INSTALLDIR:=.}
8
9 finkgetdeps()
10 {
11         otool -L "$1" | grep /sw/lib | while read -r LIB STUFF; do
12                 [ -f "$INSTALLDIR/${LIB##*/}" ] && continue
13                 cp -vL "$LIB" "$INSTALLDIR"
14                 finkgetdeps "$INSTALLDIR/${LIB##*/}"
15         done
16 }
17
18 finkgetdeps "$INSTALLDIR/radiant.ppc"
19 echo Warning: this only works if only ONE version of gtk-2.0 and pango is installed
20 cp -vL /sw/lib/gtk-2.0/*/loaders/libpixbufloader-bmp.so "$INSTALLDIR/"
21 cp -vL /sw/lib/pango/*/modules/pango-basic-fc.so "$INSTALLDIR/"
22 cp -vL /sw/lib/pango/*/modules/pango-basic-x.so "$INSTALLDIR/"