support more locations for pixbufloader-bmp
[xonotic/netradiant.git] / install-dylibs.sh
old mode 100644 (file)
new mode 100755 (executable)
index cdb7dc7..9f4e3e2
@@ -7,6 +7,8 @@ set -ex
 : ${INSTALLDIR:=.}
 : ${EXE:=ppc}
 : ${MACLIBDIR:=/sw/lib}
+: ${CAT:=cat}
+
 
 finkgetdeps()
 {
@@ -18,23 +20,58 @@ finkgetdeps()
        done
 }
 
+
 finkgetdeps "$INSTALLDIR/radiant.$EXE"
 echo Warning: this only works if only ONE version of gtk-2.0 and pango is installed
 
-for LIB in "$MACLIBDIR"/gtk-2.0/*/loaders/libpixbufloader-bmp.so; do
+LAST=
+for LIB in "$MACLIBDIR"/gtk-2.0/*/loaders/libpixbufloader-bmp.so "$MACLIBDIR"/gdk-pixbuf-2.0/*/loaders/libpixbufloader-bmp.so; do
+       [ -f "$LIB" ] || continue
        LAST=$LIB
 done
 cp -L "$LAST" "$INSTALLDIR"
 finkgetdeps "$LAST"
 
+LAST=
 for LIB in "$MACLIBDIR"/pango/*/modules/pango-basic-fc.so; do
+       [ -f "$LIB" ] || continue
        LAST=$LIB
 done
 cp -L "$LAST" "$INSTALLDIR"
 finkgetdeps "$LAST"
 
+LAST=
 for LIB in "$MACLIBDIR"/pango/*/modules/pango-basic-x.so; do
+       [ -f "$LIB" ] || continue
        LAST=$LIB
 done
 cp -L "$LAST" "$INSTALLDIR"
 finkgetdeps "$LAST"
+
+cp -L "$MACLIBDIR"/../etc/fonts/fonts.conf "$INSTALLDIR"
+cp -L "$MACLIBDIR"/../etc/fonts/fonts.dtd "$INSTALLDIR"
+cp -L "$MACLIBDIR"/../etc/gtk-2.0/gdk-pixbuf.loaders "$INSTALLDIR"
+cp -L "$MACLIBDIR"/../etc/pango/pangorc "$INSTALLDIR"
+
+$CAT > "$INSTALLDIR/../netradiant.sh" <<EOF
+#!/bin/sh
+
+MY_DIRECTORY="\${0%/*}" # cut off the script name
+MY_DIRECTORY="\${MY_DIRECTORY%/*}" # cut off MacOS
+MY_DIRECTORY="\${MY_DIRECTORY%/*}" # cut off Contents
+
+export DYLD_LIBRARY_PATH="\$MY_DIRECTORY/Contents/MacOS/install"
+export PANGO_RC_FILE="\$MY_DIRECTORY/Contents/MacOS/install/pangorc"
+export GDK_PIXBUF_MODULE_FILE="\$MY_DIRECTORY/Contents/MacOS/install/gdk-pixbuf.loaders"
+export FONTCONFIG_FILE="\$MY_DIRECTORY/Contents/MacOS/install/fonts.conf"
+
+cd "\$MY_DIRECTORY/Contents/MacOS/install"
+if [ -x /usr/bin/open-x11 ]; then
+       env LC_ALL="en_US.UTF-8" /usr/bin/open-x11 ./radiant.$EXE "$@" &
+else
+       env LC_ALL="en_US.UTF-8" ./radiant.$EXE "$@" &
+fi
+EOF
+
+chmod 755 "$INSTALLDIR/../netradiant.sh"
+