GNOME Bugzilla – Bug 551225
Gthumb will not build against GTK/Quartz (Mac OS), requires X11
Last modified: 2008-11-13 23:04:08 UTC
GTK has a Quartz backend that allows one to build against Mac OS X's native GUI API. In this case, X11 is not used. Gthumb seems to be directly dependent on GDK/X11 and fails to build against GTK/Quartz. When I try to build gthumb against GTK/Quartz, I get: /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -DXTHREADS -DORBIT2=1 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/gtk-2.0 -I/opt/local/lib/gtk-2.0/include -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include/freetype2 -I/opt/local/include/libpng12 -I/usr/X11R6/include -I/opt/local/include/pixman-1 -I/opt/local/include/libgnome-2.0 -I/opt/local/include/orbit-2.0 -I/opt/local/include/gconf/2 -I/opt/local/include/gnome-vfs-2.0 -I/opt/local/lib/gnome-vfs-2.0/include -I/opt/local/include/libbonobo-2.0 -I/opt/local/include/bonobo-activation-2.0 -I/opt/local/include/libgnomeui-2.0 -I/opt/local/include/libart-2.0 -I/opt/local/include/gnome-keyring-1 -I/opt/local/include/libbonoboui-2.0 -I/opt/local/include/libgnomecanvas-2.0 -I/opt/local/include/libxml2 -I/opt/local/include/gail-1.0 -I/opt/local/include/gnome-vfs-module-2.0 -I/opt/local/include/libglade-2.0 -DGTHUMB_MODULEDIR=\"/opt/local/lib/gthumb/modules\" -DGTHUMB_GLADEDIR=\"/opt/local/share/gthumb/glade\" -I/opt/local/include -O2 -no-cpp-precomp -flat_namespace -undefined suppress -MT eel-canvas-rect.lo -MD -MP -MF .deps/eel-canvas-rect.Tpo -c eel-canvas-rect.c -fno-common -DPIC -o .libs/eel-canvas-rect.o eel-canvas-rect.c:32:22: error: gdk/gdkx.h: No such file or directory eel-canvas-rect.c: In function 'eel_canvas_rect_realize': eel-canvas-rect.c:376: error: 'gdk_display' undeclared (first use in this function) eel-canvas-rect.c:376: error: (Each undeclared identifier is reported only once eel-canvas-rect.c:376: error: for each function it appears in.) eel-canvas-rect.c:383: warning: assignment makes pointer from integer without a cast eel-canvas-rect.c:385: warning: assignment makes pointer from integer without a cast eel-canvas-rect.c: In function 'render_rect_alpha': eel-canvas-rect.c:504: warning: assignment makes pointer from integer without a cast make[3]: *** [eel-canvas-rect.lo] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
Performing the following steps fixed this issue for me: 1. Configure using the "--disable-render" option. 2. Remove "#include <gdk/gdkx.h>" from: src/gs-fade.c src/main.c src/catalog-png-exporter.c src/totem-scrsaver.c libgthumb/eel-canvas-rect.c libgthumb/gth-image-list.c
Well, gs-fade.c is gone from trunk, and I've removed the includes from main.c and catalog-png-exporter.c. So that should simplify things a little bit. - Mike
I just took a look at svn trunk. I still need to remove "#include <gdkx.h>" from libgthumb/gth-image-list.c, libgthumb/eel-canvas-rect.c and src/gth-application.c. I also found that src/totem-screensaver.c is directly dependent on X. Can this component to made optional?
I don't think it would be hard to make the totem-screensaver stuff optional. Patch welcome. - Mike
Created attachment 120248 [details] [review] Patch to fix building gthumb on Mac OS X GTK/Quartz This patch adds a new parameter to the configure script, --disable-totem-screensaver. This disables the X11-specific screensaver and fade code and allows gthumb to build against Mac OS X GTK/Quartz (no X11).
I think it would be better and simpler to use AC_CHECK_HEADER against gdkx.h, and automatically disable the X11-dependent parts that way. No need for a --disable-xxxx parameter then. Something like this (untested) code: HAVE_GDKX=no AC_CHECK_HEADER(gdk/gdkx.h, [HAVE_GDKX=yes] [AC_MSG_WARN(Disabling GDK/X11-dependent features.)]) Can you re-work the patch that way? Your patch didn't quite work on my system anyway. This: PKG_CHECK_MODULES(TOTEM_SCREENSAVER, libX11 had to be changed to: PKG_CHECK_MODULES(TOTEM_SCREENSAVER, x11 to work on my computer. - Mike
Created attachment 122246 [details] [review] Patch to fix building gthumb on Mac OS X GTK/Quartz, modified per comment #6 This patch applies the recommendation from comment #6. The totem screensaver code is now dependent on gdkx.h. I also added a check so that the render code would not be built if gdkx.h was missing, even if --disable-render was not used.
Hmm... the patch looks good, but it doesn't actually work for me. It doesn't find gdk/gdkx.h on my linux system. Sigh, I never fully grokked makefiles. - Mike
Created attachment 122521 [details] [review] Patch to fix building gthumb on Mac OS X GTK/Quartz, attempt 3 Does this patch work for you? I changed the configure.in tests a bit. - Mike
I have committed modified versions of the patch to both gthumb-2-10 and trunk. Please test and report back. Thanks! - Mike
I just build trunk for Mac OS X 10.4. Thanks! Configuration: Source code location: . Compiler: gcc Have gdk-x11: no Have XRender: no Have XTest: true Have libtiff: yes Have libgphoto: yes Have libopenraw: no Have exiv2 xmp support: no Have gstreamer: no