Apple packaging somewhat working. The resulting binary runs but crashes. Need some getenv help to load resources and whatnot.

This commit is contained in:
jdolan 2013-06-26 21:36:32 -04:00
parent c72536f4b3
commit 2d6a36ac81
13 changed files with 80 additions and 8 deletions

View file

@ -29,7 +29,7 @@
</inputType> </inputType>
</tool> </tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.macosx.exe.debug.1572348978" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.macosx.exe.debug"> <tool id="cdt.managedbuild.tool.gnu.assembler.macosx.exe.debug.1572348978" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.macosx.exe.debug">
<option id="gnu.both.asm.option.include.paths.1149695882" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath"/> <option id="gnu.both.asm.option.include.paths.1149695882" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths"/>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1405583986" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1405583986" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool> </tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.macosx.base.273649264" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.macosx.base"/> <tool id="cdt.managedbuild.tool.gnu.archiver.macosx.base.273649264" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.macosx.base"/>
@ -504,7 +504,7 @@
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.release.135156334" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.release"> <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.release.135156334" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.release">
<option id="gnu.cpp.compiler.macosx.exe.release.option.optimization.level.818801563" name="Optimization Level" superClass="gnu.cpp.compiler.macosx.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> <option id="gnu.cpp.compiler.macosx.exe.release.option.optimization.level.818801563" name="Optimization Level" superClass="gnu.cpp.compiler.macosx.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.macosx.exe.release.option.debugging.level.1473482005" name="Debug Level" superClass="gnu.cpp.compiler.macosx.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/> <option id="gnu.cpp.compiler.macosx.exe.release.option.debugging.level.1473482005" name="Debug Level" superClass="gnu.cpp.compiler.macosx.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.include.paths.1755333885" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath"> <option id="gnu.cpp.compiler.option.include.paths.1755333885" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/local/include"/> <listOptionValue builtIn="false" value="/opt/local/include"/>
<listOptionValue builtIn="false" value="/opt/local/include/gtk-2.0"/> <listOptionValue builtIn="false" value="/opt/local/include/gtk-2.0"/>
</option> </option>

View file

@ -5,6 +5,11 @@
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers> <triggers>clean,full,incremental,</triggers>
@ -79,5 +84,6 @@
<nature>org.eclipse.cdt.core.ccnature</nature> <nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.python.pydev.pythonNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

7
.pydevproject Normal file
View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?>
<pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
</pydev_project>

View file

@ -7,7 +7,7 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>GtkRadiant</string> <string>GtkRadiant</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>radiant.bin</string> <string>radiant</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>radiant.icns</string> <string>radiant.icns</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>

View file

@ -0,0 +1,23 @@
#!/bin/bash
RADIANT_HOME=$(dirname "$0")
RADIANT_HOME=${RADIANT_HOME/GtkRadiant.app*/GtkRadiant.app}
echo
echo "Starting GtkRadiant in ${RADIANT_HOME}"
echo
set -x
GTK_RUNTIME="${RADIANT_HOME}/Contents/Resources/gtk-runtime"
export GDK_PIXBUF_MODULE_FILE="${GTK_RUNTIME}/etc/gtk-2.0/gdk-pixbuf.loaders"
export GTK_DATA_PREFIX="${GTK_RUNTIME}"
export GTK_EXE_PREFIX="${GTK_RUNTIME}"
export GTK_PATH="${GTK_RUNTIME}"
export PANGO_SYSCONFDIR="${GTK_RUNTIME}/etc"
export PANGO_LIBDIR="${GTK_RUNTIME}/lib"
"${RADIANT_HOME}/Contents/MacOS/radiant.bin"

View file

@ -0,0 +1 @@
[Pango]

View file

@ -3,13 +3,16 @@
INSTALL = ../install INSTALL = ../install
TARGET = target TARGET = target
GTKRADIANT = $(TARGET)/GtkRadiant.app GTKRADIANT = $(TARGET)/GtkRadiant.app
LIBRARIES = $(GTKRADIANT)/Contents/lib
BINARIES = $(GTKRADIANT)/Contents/MacOS BINARIES = $(GTKRADIANT)/Contents/MacOS
LIBRARIES = $(GTKRADIANT)/Contents/MacOS/lib
RESOURCES = $(GTKRADIANT)/Contents/Resources RESOURCES = $(GTKRADIANT)/Contents/Resources
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:
@ -22,9 +25,10 @@ install: pre-install
install $(INSTALL)/q3map2 $(BINARIES)/q3map2 install $(INSTALL)/q3map2 $(BINARIES)/q3map2
install $(INSTALL)/q3map2_urt $(BINARIES)/q3map2_urt install $(INSTALL)/q3map2_urt $(BINARIES)/q3map2_urt
install $(INSTALL)/q3data $(BINARIES)/q3data install $(INSTALL)/q3data $(BINARIES)/q3data
install $(INSTALL)/modules/*.so $(BINARIES)/modules
install $(INSTALL)/bitmaps/*.* $(RESOURCES)/bitmaps install $(INSTALL)/bitmaps/*.* $(RESOURCES)/bitmaps
install $(INSTALL)/modules/*.so $(RESOURCES)/modules
install $(INSTALL)/modules/bitmaps/*.* $(RESOURCES)/modules/bitmaps install $(INSTALL)/modules/bitmaps/*.* $(RESOURCES)/modules/bitmaps
@for i in $(INSTALL)/installs/*; do \ @for i in $(INSTALL)/installs/*; do \
@ -37,8 +41,39 @@ install: pre-install
bundle: bundle:
dylibbundler -b \ dylibbundler -b \
`find $(BINARIES) -type f | xargs -I {} echo -x {}` \ -x $(BINARIES)/radiant.bin \
-d $(LIBRARIES) -of -p @executable_path/../lib -x $(BINARIES)/q3map2 \
-x $(BINARIES)/q3map2_urt \
-x $(BINARIES)/q3data \
-d $(LIBRARIES) -of -p @executable_path/lib
# The Radiant plugins (modules) are a little funky
# Some of them are actually linked against the build directory
ln -s ../build ./build
dylibbundler -b \
`find $(RESOURCES)/modules -name "*.so" | xargs -I {} echo -x {}` \
-d $(LIBRARIES) -of -p @executable_path/lib
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