[gtk-osx-users] Bundling, Mountain Lion, and X11 freetype library



Hi folks,

Short story: when building GTK+3 applications on OSX with a fresh install of jhbuild, the system freetype (X11) library is listed as dependencies in the generated library. Unfortunately, deploying this bundle to other "post-X11" Mac systems (starting with Mountain Lion, I guess?) doesn't work without end-user installation of xquartz.

Solutions?

Longer story...

Steps: check out the current version of gtk-osx-build-setup.sh, bootstrap and build GTK+3 via the standard jhbuild instructions. Build a utility that uses MAC_INTEGRATION (i.e., GtkosxApplication) within the jhbuild shell. All's normal here. Application works fine when invoked from the command line. (And bundles fine too for the local machine.)

Looking at the executable (shown as "theapp", with paths shortened and output truncated to fit in a message window):

% otool -L theapp
theapp:
        ...gtk/lib/libgtkmacintegration.2.dylib
        ...gtk/lib/libgtk-3.0.dylib
        ...gtk/lib/libgdk-3.0.dylib
        ...gtk/lib/libatk-1.0.0.dylib
        ...gtk/lib/libgio-2.0.0.dylib
        ...gtk/lib/libpangocairo-1.0.0.dylib
        ...gtk/lib/libgdk_pixbuf-2.0.0.dylib
        ...gtk/lib/libcairo-gobject.2.dylib
        ...gtk/lib/libpango-1.0.0.dylib
        ...gtk/lib/libcairo.2.dylib
        ...gtk/lib/libgobject-2.0.0.dylib
        ...gtk/lib/libglib-2.0.0.dylib
        ...gtk/lib/libintl.8.dylib
        /usr/lib/libSystem.B.dylib

Looks good so far. Unfortunately... (again with paths shortened for fitting in this mail)

% otool -L ...gtk/lib/libgtkmacintegration.2.dylib
        ...gtk/lib/libgtkmacintegration.2.dylib
        ...frms/Carbon.framework/Versions/A/Carbon

...frms/ApplicationServices.framework/Versions/A/ApplicationServices
        ...gtk/lib/libgtk-3.0.dylib
        ...gtk/lib/libgdk-3.0.dylib
        ...gtk/lib/libatk-1.0.0.dylib
        ...gtk/lib/libpangocairo-1.0.0.dylib
        ...gtk/lib/libgdk_pixbuf-2.0.0.dylib
        ...gtk/lib/libgio-2.0.0.dylib
        /usr/lib/libresolv.9.dylib
        ...gtk/lib/libcairo-gobject.2.dylib
        ...gtk/lib/libpango-1.0.0.dylib
        ...gtk/lib/libgmodule-2.0.0.dylib
        ...gtk/lib/libcairo.2.dylib
        ...gtk/lib/libpixman-1.0.dylib
        /usr/lib/libSystem.B.dylib
        ...gtk/lib/libpng15.15.dylib
        /usr/X11/lib/libfreetype.6.dylib   <==== UGH.
        /usr/lib/libz.1.dylib
        /usr/lib/libbz2.1.0.dylib
        ...gtk/lib/libgobject-2.0.0.dylib
        ...gtk/lib/libgthread-2.0.0.dylib
        ...gtk/lib/libffi.6.dylib
        ...gtk/lib/libglib-2.0.0.dylib
        ...gtk/lib/libintl.8.dylib
        /usr/lib/libiconv.2.dylib
        /usr/lib/libobjc.A.dylib
        ...frms/Cocoa.framework/Versions/A/Cocoa
        ...frms/CoreFoundation.framework/Versions/A/CoreFoundation
        ...frms/Foundation.framework/Versions/C/Foundation
        ...frms/AppKit.framework/Versions/C/AppKit

Notice the "libfreetype" inclusion. This occurs in many of the dependent libraries of theapp. (libgtk, libpangocairo, etc.) When bundling with this dependency, not only does gtk-mac-bundler raise errors, but the end-users are asked to install xquartz.

I was able to recompile libpangocairo not to use X11 by jhbuilding the freetype module beforehand (I guess it picks up the GTK-installed freetype before the system one, in that case), but obviously all modules would need to be similarly recompiled. I notice that libpangocairo depends on the freetype meta-module.

Is there a way to rebuild the GTK+3 installation, playing nicely with jhbuild, to pull in the compiled freetype instead of the system X11 one?

Thank,

Kristaps


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]