1 # Makefile for NetRadiant.app, requires http://macdylibbundler.sourceforge.net/
3 INSTALL = ../../install
5 RESOURCES = $(TARGET)/NetRadiant.app/Contents/Resources
6 BINDIR = $(RESOURCES)/install
7 CONFDIR = $(RESOURCES)/etc
8 DATADIR = $(RESOURCES)/share
9 LIBDIR = $(RESOURCES)/lib
11 DMG = $(TARGET)/NetRadiant-$(VERSION).dmg
12 VOLUME_NAME = "NetRadiant $(VERSION)"
14 # We must rewrite some Gtk configuration files, which vary from environment to
15 # environment depending on where you've installed MacPorts. Fun!
17 MACPORTS_PREFIX := $(shell which port | sed 's:/bin/port::')
18 PREFIX_SED_EXPR = "s:$(MACPORTS_PREFIX):@executable_path/..:g"
24 cp -r NetRadiant.app $(TARGET)
25 find $(TARGET) -name .turd -delete
27 -gtk-runtime-gdk-pixbuf-2.0:
28 cp -r $(MACPORTS_PREFIX)/lib/gdk-pixbuf-2.0 $(LIBDIR)
29 find $(LIBDIR)/gdk-pixbuf-2.0 -type f ! -name "*.so" -delete
31 gdk-pixbuf-query-loaders | sed $(PREFIX_SED_EXPR) > \
32 $(CONFDIR)/gtk-2.0/gdk-pixbuf.loaders
35 cp -r $(MACPORTS_PREFIX)/lib/pango $(LIBDIR)
36 find $(LIBDIR)/pango -type f ! -name "*.so" -delete
38 pango-querymodules | sed $(PREFIX_SED_EXPR) > \
39 $(CONFDIR)/pango/pango.modules
41 -gtk-runtime: -gtk-runtime-gdk-pixbuf-2.0 -gtk-runtime-pango
42 cp -r $(MACPORTS_PREFIX)/lib/gtk-2.0 $(LIBDIR)
43 find $(LIBDIR)/gtk-2.0 -type f ! -name "*.so" -delete
45 rm -rf $(LIBDIR)/gtk-2.0/{includes,modules}
46 rm -rf $(LIBDIR)/gtk-2.0/*/printbackends
48 cp -r $(MACPORTS_PREFIX)/share/themes/Default $(RESOURCES)/share
50 gtk-query-immodules-2.0 | sed $(PREFIX_SED_EXPR) > \
51 $(CONFDIR)/gtk-2.0/gtk.immodules
53 install: -pre-install -gtk-runtime
54 cp -r $(INSTALL) $(RESOURCES)
55 #rm -rf `find $(INSTDIR)/installs -type d -name .svn`
59 # The Radiant plugins (modules) are a little funky
60 # Some of them are actually linked against the build directory
62 test -L install || ln -s $(INSTALL)
65 -x $(BINDIR)/radiant \
70 `find $(BINDIR)/modules -name "*.dylib" | xargs -I {} echo -x {}` \
71 `find $(LIBDIR) -name "*.dylib" | xargs -I {} echo -x {}` \
72 -d $(LIBDIR) -of -p @executable_path/../lib
77 find $(TARGET) -name .DS_Store -delete
78 ln -f -s /Applications $(TARGET)/Applications
79 hdiutil create -ov $(DMG) -srcfolder $(TARGET) -volname $(VOLUME_NAME)
80 rm $(TARGET)/Applications