Make Radiant honor GDK_GL_LIBGL_PATH. This way Radiant and GtkGLExt can use the same instance of libGL.dylib. Failure to do this results in unpredictable and wrong behavior from GL.

This commit is contained in:
jdolan 2013-06-27 16:02:47 -04:00
parent 482dc447ab
commit 78edf4e227
3 changed files with 46 additions and 45 deletions

View file

@ -11,8 +11,14 @@ set -x
resources="${RADIANT_HOME}/Contents/Resources" resources="${RADIANT_HOME}/Contents/Resources"
export GDK_GL_LIBGL_PATH="${resources}/lib/libGL.1.dylib"
export GDK_GL_LIBGLU_PATH="${resources}/lib/libGLU.1.dylib"
export GDK_PATH="${resources}"
export GDK_PIXBUF_MODULE_FILE="${resources}/etc/gtk-2.0/gdk-pixbuf.loaders" export GDK_PIXBUF_MODULE_FILE="${resources}/etc/gtk-2.0/gdk-pixbuf.loaders"
export GOBJECT_PATH="${resources}"
export GTK_DATA_PREFIX="${resources}" export GTK_DATA_PREFIX="${resources}"
export GTK_EXE_PREFIX="${resources}" export GTK_EXE_PREFIX="${resources}"
export GTK_PATH="${resources}" export GTK_PATH="${resources}"
@ -21,6 +27,6 @@ export PANGO_SYSCONFDIR="${resources}/etc"
export PANGO_LIBDIR="${resources}/lib" export PANGO_LIBDIR="${resources}/lib"
cd "${resources}/install" cd "${resources}/install"
./radiant.bin ./radiant.bin &
set +x set +x

View file

@ -12,60 +12,57 @@ VERSION = 1.6.4
DMG = $(TARGET)/GtkRadiant-$(VERSION).dmg DMG = $(TARGET)/GtkRadiant-$(VERSION).dmg
VOLUME_NAME = "GtkRadiant $(VERSION)" VOLUME_NAME = "GtkRadiant $(VERSION)"
all: install gtk-runtime bundle all: install bundle
pre-install: -pre-install:
install -d $(TARGET) install -d $(TARGET)
cp -r GtkRadiant.app $(TARGET) cp -r GtkRadiant.app $(TARGET)
find $(TARGET) -name .turd -delete find $(TARGET) -name .turd -delete
install: pre-install -gtk-runtime-gdk-pixbuf-2.0:
cp -r $(INSTALL) $(RESOURCES) cp -r /opt/local/lib/gdk-pixbuf-2.0 $(LIBDIR)
rm -rf `find $(INSTDIR)/installs -type d -name .svn` find $(LIBDIR)/gdk-pixbuf-2.0 -type f ! -name "*.so" -delete
gtk-runtime:
gdk-pixbuf-query-loaders | sed $(PREFIX_SED_EXPR) > \ gdk-pixbuf-query-loaders | sed $(PREFIX_SED_EXPR) > \
$(CONFDIR)/gtk-2.0/gdk-pixbuf.loaders $(CONFDIR)/gtk-2.0/gdk-pixbuf.loaders
gtk-query-immodules-2.0 | sed $(PREFIX_SED_EXPR) > \ -gtk-runtime-pango:
$(CONFDIR)/gtk-2.0/gtk.immodules cp -r /opt/local/lib/pango $(LIBDIR)
find $(LIBDIR)/pango -type f ! -name "*.so" -delete
pango-querymodules | sed $(PREFIX_SED_EXPR) > \ pango-querymodules | sed $(PREFIX_SED_EXPR) > \
$(CONFDIR)/pango/pango.modules $(CONFDIR)/pango/pango.modules
cp -r /opt/local/lib/gdk-pixbuf-2.0 $(LIBDIR) -gtk-runtime: -gtk-runtime-gdk-pixbuf-2.0 -gtk-runtime-pango
cp -r /opt/local/lib/gtk-2.0 $(LIBDIR) cp -r /opt/local/lib/gtk-2.0 $(LIBDIR)
cp -r /opt/local/lib/pango $(LIBDIR)
find $(LIBDIR)/gdk-pixbuf-2.0 -type f ! -name "*.so" -delete
find $(LIBDIR)/gtk-2.0 -type f ! -name "*.so" -delete find $(LIBDIR)/gtk-2.0 -type f ! -name "*.so" -delete
find $(LIBDIR)/pango -type f ! -name "*.so" -delete
rm -rf $(LIBDIR)/gtk-2.0/{includes,modules} rm -rf $(LIBDIR)/gtk-2.0/{includes,modules}
rm -rf $(LIBDIR)/gtk-2.0/*/printbackends rm -rf $(LIBDIR)/gtk-2.0/*/printbackends
dylibbundler -b \
`find $(LIBDIR)/gdk-pixbuf-2.0 -type f | xargs -I {} echo -x {}` \
`find $(LIBDIR)/gtk-2.0 -type f | xargs -I {} echo -x {}` \
`find $(LIBDIR)/pango -type f | xargs -I {} echo -x {}` \
-d $(LIBDIR) -of -p @executable_path/../lib
cp -r /opt/local/share/themes/Default $(RESOURCES)/share cp -r /opt/local/share/themes/Default $(RESOURCES)/share
gtk-query-immodules-2.0 | sed $(PREFIX_SED_EXPR) > \
$(CONFDIR)/gtk-2.0/gtk.immodules
install: -pre-install -gtk-runtime
cp -r $(INSTALL) $(RESOURCES)
rm -rf `find $(INSTDIR)/installs -type d -name .svn`
bundle: bundle:
# The Radiant plugins (modules) are a little funky
# Some of them are actually linked against the build directory
ln -s ../build ./build
dylibbundler -b \ dylibbundler -b \
-x $(INSTDIR)/radiant.bin \ -x $(INSTDIR)/radiant.bin \
-x $(INSTDIR)/q3map2 \ -x $(INSTDIR)/q3map2 \
-x $(INSTDIR)/q3map2_urt \ -x $(INSTDIR)/q3map2_urt \
-x $(INSTDIR)/q3data \ -x $(INSTDIR)/q3data \
-d $(LIBDIR) -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 $(INSTDIR)/modules -name "*.so" | xargs -I {} echo -x {}` \ `find $(INSTDIR)/modules -name "*.so" | xargs -I {} echo -x {}` \
`find $(LIBDIR) -name "*.so" | xargs -I {} echo -x {}` \
-d $(LIBDIR) -of -p @executable_path/../lib -d $(LIBDIR) -of -p @executable_path/../lib
rm -f build rm -f build

View file

@ -463,19 +463,17 @@ int main( int argc, char* argv[] ) {
*/ */
putenv( "LC_NUMERIC=C" ); putenv( "LC_NUMERIC=C" );
#ifdef _WIN32 // Use the same environment variable for resolving libGL as libgtkglext does.
libgl = getenv("GDK_GL_LIBGL_PATH");
if ( libgl == NULL ) {
#if defined ( _WIN32 )
libgl = "opengl32.dll"; libgl = "opengl32.dll";
#endif #elif defined ( __linux__ )
#if defined ( __linux__ )
libgl = "libGL.so.1"; libgl = "libGL.so.1";
#endif #elif defined ( __APPLE__ )
#ifdef __APPLE__
// libgl = "/usr/X11R6/lib/libGL.dylib";
// libgl = "/usr/X11/lib/libGL.dylib";
libgl = "/opt/local/lib/libGL.dylib"; libgl = "/opt/local/lib/libGL.dylib";
#endif #endif
}
#if defined ( __linux__ ) || defined ( __APPLE__ ) #if defined ( __linux__ ) || defined ( __APPLE__ )
// Give away unnecessary root privileges. // Give away unnecessary root privileges.