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"
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 GOBJECT_PATH="${resources}"
export GTK_DATA_PREFIX="${resources}"
export GTK_EXE_PREFIX="${resources}"
export GTK_PATH="${resources}"
@ -21,6 +27,6 @@ export PANGO_SYSCONFDIR="${resources}/etc"
export PANGO_LIBDIR="${resources}/lib"
cd "${resources}/install"
./radiant.bin
./radiant.bin &
set +x

View file

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

View file

@ -463,19 +463,17 @@ int main( int argc, char* argv[] ) {
*/
putenv( "LC_NUMERIC=C" );
#ifdef _WIN32
libgl = "opengl32.dll";
#endif
#if defined ( __linux__ )
libgl = "libGL.so.1";
#endif
#ifdef __APPLE__
// libgl = "/usr/X11R6/lib/libGL.dylib";
// libgl = "/usr/X11/lib/libGL.dylib";
libgl = "/opt/local/lib/libGL.dylib";
#endif
// 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";
#elif defined ( __linux__ )
libgl = "libGL.so.1";
#elif defined ( __APPLE__ )
libgl = "/opt/local/lib/libGL.dylib";
#endif
}
#if defined ( __linux__ ) || defined ( __APPLE__ )
// Give away unnecessary root privileges.