2013-06-27 13:32:30 +00:00
|
|
|
# Makefile for GtkRadiant.app, requires http://macdylibbundler.sourceforge.net/
|
2013-06-03 02:12:42 +00:00
|
|
|
|
2013-06-29 18:42:34 +00:00
|
|
|
BUILD = ../build
|
2013-06-03 02:12:42 +00:00
|
|
|
INSTALL = ../install
|
|
|
|
TARGET = target
|
2013-06-27 04:36:58 +00:00
|
|
|
RESOURCES = $(TARGET)/GtkRadiant.app/Contents/Resources
|
2013-09-11 22:39:43 +00:00
|
|
|
BINDIR = $(RESOURCES)/install
|
2013-06-27 04:36:58 +00:00
|
|
|
CONFDIR = $(RESOURCES)/etc
|
|
|
|
DATADIR = $(RESOURCES)/share
|
|
|
|
LIBDIR = $(RESOURCES)/lib
|
2013-06-03 02:12:42 +00:00
|
|
|
VERSION = 1.6.4
|
|
|
|
DMG = $(TARGET)/GtkRadiant-$(VERSION).dmg
|
|
|
|
VOLUME_NAME = "GtkRadiant $(VERSION)"
|
|
|
|
|
2013-09-12 00:44:05 +00:00
|
|
|
# We must rewrite some Gtk configuration files, which vary from environment to
|
|
|
|
# environment depending on where you've installed MacPorts. Fun!
|
|
|
|
|
|
|
|
MACPORTS_PREFIX := $(shell which port | sed 's:/bin/port::')
|
|
|
|
PREFIX_SED_EXPR = "s:$(MACPORTS_PREFIX):@executable_path/..:g"
|
|
|
|
|
2013-06-27 20:02:47 +00:00
|
|
|
all: install bundle
|
2013-06-03 02:12:42 +00:00
|
|
|
|
2013-06-27 20:02:47 +00:00
|
|
|
-pre-install:
|
2013-06-03 02:12:42 +00:00
|
|
|
install -d $(TARGET)
|
|
|
|
cp -r GtkRadiant.app $(TARGET)
|
|
|
|
find $(TARGET) -name .turd -delete
|
2013-06-27 20:02:47 +00:00
|
|
|
|
|
|
|
-gtk-runtime-gdk-pixbuf-2.0:
|
2013-09-12 00:44:05 +00:00
|
|
|
cp -r $(MACPORTS_PREFIX)/lib/gdk-pixbuf-2.0 $(LIBDIR)
|
2013-06-27 20:02:47 +00:00
|
|
|
find $(LIBDIR)/gdk-pixbuf-2.0 -type f ! -name "*.so" -delete
|
|
|
|
|
2013-06-27 04:36:58 +00:00
|
|
|
gdk-pixbuf-query-loaders | sed $(PREFIX_SED_EXPR) > \
|
|
|
|
$(CONFDIR)/gtk-2.0/gdk-pixbuf.loaders
|
2013-06-27 20:02:47 +00:00
|
|
|
|
|
|
|
-gtk-runtime-pango:
|
2013-09-12 00:44:05 +00:00
|
|
|
cp -r $(MACPORTS_PREFIX)/lib/pango $(LIBDIR)
|
2013-06-27 20:02:47 +00:00
|
|
|
find $(LIBDIR)/pango -type f ! -name "*.so" -delete
|
|
|
|
|
2013-06-27 04:36:58 +00:00
|
|
|
pango-querymodules | sed $(PREFIX_SED_EXPR) > \
|
|
|
|
$(CONFDIR)/pango/pango.modules
|
|
|
|
|
2013-06-27 20:02:47 +00:00
|
|
|
-gtk-runtime: -gtk-runtime-gdk-pixbuf-2.0 -gtk-runtime-pango
|
2013-09-12 00:44:05 +00:00
|
|
|
cp -r $(MACPORTS_PREFIX)/lib/gtk-2.0 $(LIBDIR)
|
2013-06-27 13:32:30 +00:00
|
|
|
find $(LIBDIR)/gtk-2.0 -type f ! -name "*.so" -delete
|
|
|
|
|
|
|
|
rm -rf $(LIBDIR)/gtk-2.0/{includes,modules}
|
|
|
|
rm -rf $(LIBDIR)/gtk-2.0/*/printbackends
|
2013-06-03 02:12:42 +00:00
|
|
|
|
2013-09-12 00:44:05 +00:00
|
|
|
cp -r $(MACPORTS_PREFIX)/share/themes/Default $(RESOURCES)/share
|
2013-06-27 20:02:47 +00:00
|
|
|
|
|
|
|
gtk-query-immodules-2.0 | sed $(PREFIX_SED_EXPR) > \
|
|
|
|
$(CONFDIR)/gtk-2.0/gtk.immodules
|
|
|
|
|
|
|
|
install: -pre-install -gtk-runtime
|
|
|
|
cp -r $(INSTALL) $(RESOURCES)
|
2013-08-24 22:58:08 +00:00
|
|
|
rm -rf `find $(INSTDIR)/installs -type d -name .svn`
|
2013-06-03 02:12:42 +00:00
|
|
|
|
|
|
|
bundle:
|
2013-10-12 16:29:11 +00:00
|
|
|
|
2013-06-27 01:36:32 +00:00
|
|
|
# The Radiant plugins (modules) are a little funky
|
|
|
|
# Some of them are actually linked against the build directory
|
2013-06-27 20:02:47 +00:00
|
|
|
|
2013-06-29 18:42:34 +00:00
|
|
|
test -L build || ln -s $(BUILD)
|
2013-06-27 01:36:32 +00:00
|
|
|
|
|
|
|
dylibbundler -b \
|
2013-09-11 22:39:43 +00:00
|
|
|
-x $(BINDIR)/radiant.bin \
|
|
|
|
-x $(BINDIR)/q3map2 \
|
|
|
|
-x $(BINDIR)/q3map2_urt \
|
|
|
|
-x $(BINDIR)/q3data \
|
|
|
|
`find $(BINDIR)/modules -name "*.so" | xargs -I {} echo -x {}` \
|
2013-06-27 20:02:47 +00:00
|
|
|
`find $(LIBDIR) -name "*.so" | xargs -I {} echo -x {}` \
|
2013-06-27 04:36:58 +00:00
|
|
|
-d $(LIBDIR) -of -p @executable_path/../lib
|
2013-10-12 16:29:11 +00:00
|
|
|
|
2013-06-27 01:36:32 +00:00
|
|
|
rm -f build
|
|
|
|
|
2013-06-03 02:12:42 +00:00
|
|
|
image:
|
2013-06-28 13:07:02 +00:00
|
|
|
find $(TARGET) -name .DS_Store -delete
|
2013-06-03 02:12:42 +00:00
|
|
|
ln -f -s /Applications $(TARGET)/Applications
|
2013-06-28 13:07:02 +00:00
|
|
|
hdiutil create -ov $(DMG) -srcfolder $(TARGET) -volname $(VOLUME_NAME)
|
2013-06-03 02:12:42 +00:00
|
|
|
rm $(TARGET)/Applications
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(TARGET)/*
|