Vastly simplify the .app structure. Radiant runs.

This commit is contained in:
jdolan 2013-06-27 00:36:58 -04:00
parent 178ebc262b
commit 09126695d9
12 changed files with 41 additions and 54 deletions

View file

@ -9,15 +9,18 @@ echo
set -x set -x
GTK_RUNTIME="${RADIANT_HOME}/Contents/Resources/gtk-runtime" resources="${RADIANT_HOME}/Contents/Resources"
export GDK_PIXBUF_MODULE_FILE="${GTK_RUNTIME}/etc/gtk-2.0/gdk-pixbuf.loaders" export GDK_PIXBUF_MODULE_FILE="${resources}/etc/gtk-2.0/gdk-pixbuf.loaders"
export GTK_DATA_PREFIX="${GTK_RUNTIME}" export GTK_DATA_PREFIX="${resources}"
export GTK_EXE_PREFIX="${GTK_RUNTIME}" export GTK_EXE_PREFIX="${resources}"
export GTK_PATH="${GTK_RUNTIME}" export GTK_PATH="${resources}"
export PANGO_SYSCONFDIR="${GTK_RUNTIME}/etc" export PANGO_SYSCONFDIR="${resources}/etc"
export PANGO_LIBDIR="${GTK_RUNTIME}/lib" export PANGO_LIBDIR="${resources}/lib"
"${RADIANT_HOME}/Contents/MacOS/radiant.bin" cd "${resources}/install"
./radiant.bin $@
set +x

View file

@ -2,17 +2,16 @@
INSTALL = ../install INSTALL = ../install
TARGET = target TARGET = target
GTKRADIANT = $(TARGET)/GtkRadiant.app RESOURCES = $(TARGET)/GtkRadiant.app/Contents/Resources
BINARIES = $(GTKRADIANT)/Contents/MacOS CONFDIR = $(RESOURCES)/etc
LIBRARIES = $(GTKRADIANT)/Contents/MacOS/lib DATADIR = $(RESOURCES)/share
RESOURCES = $(GTKRADIANT)/Contents/Resources LIBDIR = $(RESOURCES)/lib
INSTDIR = $(RESOURCES)/install
PREFIX_SED_EXPR = 's:/opt/local:@executable_path/..:g'
VERSION = 1.6.4 VERSION = 1.6.4
DMG = $(TARGET)/GtkRadiant-$(VERSION).dmg DMG = $(TARGET)/GtkRadiant-$(VERSION).dmg
VOLUME_NAME = "GtkRadiant $(VERSION)" VOLUME_NAME = "GtkRadiant $(VERSION)"
GTK_RUNTIME = $(RESOURCES)/gtk-runtime
GTK_PREFIX_EXPR = 's:/opt/local:@executable_path/../Resources/gtk-runtime:g'
all: install all: install
pre-install: pre-install:
@ -21,60 +20,45 @@ pre-install:
find $(TARGET) -name .turd -delete find $(TARGET) -name .turd -delete
install: pre-install install: pre-install
install $(INSTALL)/radiant.bin $(BINARIES)/radiant.bin cp -r $(INSTALL) $(RESOURCES)
install $(INSTALL)/q3map2 $(BINARIES)/q3map2 rm -rf `find $(INSTDIR)/installs -type d -name .svn`
install $(INSTALL)/q3map2_urt $(BINARIES)/q3map2_urt
install $(INSTALL)/q3data $(BINARIES)/q3data gtk-runtime:
gdk-pixbuf-query-loaders | sed $(PREFIX_SED_EXPR) > \
$(CONFDIR)/gtk-2.0/gdk-pixbuf.loaders
install $(INSTALL)/bitmaps/*.* $(RESOURCES)/bitmaps pango-querymodules | sed $(PREFIX_SED_EXPR) > \
$(CONFDIR)/pango/pango.modules
install $(INSTALL)/modules/*.so $(RESOURCES)/modules cp -r /opt/local/lib/gdk-pixbuf-2.0 $(LIBDIR)
install $(INSTALL)/modules/bitmaps/*.* $(RESOURCES)/modules/bitmaps cp -r /opt/local/lib/pango $(LIBDIR)
@for i in $(INSTALL)/installs/*; do \ find $(LIBDIR) -type f ! -name "*.so" -delete
if [ -d $$i/.svn ]; then \
svn export --force $$i $(RESOURCES)/installs/`basename $$i` ; \ dylibbundler -b \
else \ `find $(LIBDIR) -type f | xargs -I {} echo -x {}` \
cp -r $$i $(RESOURCES)/installs ; \ -d $(LIBDIR) -of -p @executable_path/../lib
fi \
done cp -r /opt/local/share/themes/Default $(RESOURCES)/share
bundle: bundle:
dylibbundler -b \ dylibbundler -b \
-x $(BINARIES)/radiant.bin \ -x $(INSTDIR)/radiant.bin \
-x $(BINARIES)/q3map2 \ -x $(INSTDIR)/q3map2 \
-x $(BINARIES)/q3map2_urt \ -x $(INSTDIR)/q3map2_urt \
-x $(BINARIES)/q3data \ -x $(INSTDIR)/q3data \
-d $(LIBRARIES) -of -p @executable_path/lib -d $(LIBDIR) -of -p @executable_path/../lib
# The Radiant plugins (modules) are a little funky # The Radiant plugins (modules) are a little funky
# Some of them are actually linked against the build directory # Some of them are actually linked against the build directory
ln -s ../build ./build ln -s ../build ./build
dylibbundler -b \ dylibbundler -b \
`find $(RESOURCES)/modules -name "*.so" | xargs -I {} echo -x {}` \ `find $(INSTDIR)/modules -name "*.so" | xargs -I {} echo -x {}` \
-d $(LIBRARIES) -of -p @executable_path/lib -d $(LIBDIR) -of -p @executable_path/../lib
rm -f build rm -f build
gtk-runtime:
gdk-pixbuf-query-loaders | sed $(GTK_PREFIX_EXPR) > \
$(GTK_RUNTIME)/etc/gtk-2.0/gdk-pixbuf.loaders
pango-querymodules | sed $(GTK_PREFIX_EXPR) > \
$(GTK_RUNTIME)/etc/pango/pango.modules
cp -r /opt/local/lib/gdk-pixbuf-2.0 $(GTK_RUNTIME)/lib
cp -r /opt/local/lib/pango $(GTK_RUNTIME)/lib
find $(GTK_RUNTIME)/lib -type f ! -name "*.so" -delete
dylibbundler -b \
`find $(GTK_RUNTIME)/lib -name "*.so" | xargs -I {} echo -x {}` \
-d $(LIBRARIES) -of -p @executable_path/lib
cp -r /opt/local/share/themes/Default $(GTK_RUNTIME)/share
image: image:
ln -f -s /Applications $(TARGET)/Applications ln -f -s /Applications $(TARGET)/Applications
hdiutil create $(DMG) -srcfolder $(TARGET) -volname $(VOLUME_NAME) hdiutil create $(DMG) -srcfolder $(TARGET) -volname $(VOLUME_NAME)