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




On Mar 7, 2014, at 3:50 AM, Kristaps Dzonsons <kristaps bsd lv> wrote:

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?

Pango (there is no "pangocairo", libpangocairo is part of Pango) has a soft dependency on 
meta-gtk-osx-freetype so that if you include it in your modules list it will get built at the right place. If 
you make whatever application you're building depend on meta-gtk-osx-freetype that will take care of it.

Libgtkmacintegration has no freetype dependency:
otool -L /Users/john/Development/Gnucash-Build/Gnucash-git/inst/lib/libgtkmacintegration.2.dylib | sed -e 
s:$PREFIX:...: -e s:/System/Library/Frameworks:...: -e s/\(compat.*//
.../lib/libgtkmacintegration.2.dylib:
        .../lib/libgtkmacintegration.2.dylib
        .../Carbon.framework/Versions/A/Carbon
        .../ApplicationServices.framework/Versions/A/ApplicationServices
        .../lib/libgtk-quartz-2.0.0.dylib
        .../lib/libgdk-quartz-2.0.0.dylib
        .../lib/libatk-1.0.0.dylib
        .../lib/libgio-2.0.0.dylib
        .../lib/libgmodule-2.0.0.dylib
        .../lib/libz.1.dylib
        /usr/lib/libresolv.9.dylib
        .../lib/libpangocairo-1.0.0.dylib
        .../lib/libgdk_pixbuf-2.0.0.dylib
        .../lib/libpango-1.0.0.dylib
        .../lib/libcairo.2.dylib
        .../lib/libgobject-2.0.0.dylib
        .../lib/libgthread-2.0.0.dylib
        .../lib/libffi.6.dylib
        .../lib/libglib-2.0.0.dylib
        .../lib/libintl.8.dylib
        /usr/lib/libiconv.2.dylib
        /usr/lib/libSystem.B.dylib
        /usr/lib/libobjc.A.dylib
        .../CoreGraphics.framework/Versions/A/CoreGraphics
        .../CoreServices.framework/Versions/A/CoreServices
        .../CoreFoundation.framework/Versions/A/CoreFoundation

So something else in your build is pulling it in, but figuring out exactly what might be a PITA and isn't 
really necessary.

Regards,
John Ralls




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