Refreshed build system for Mac OS X

Bug #1096996 reported by Valerio Aimale on 2013-01-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

The building & packaging system for Mac OS Xis ancient and does not work out of the box. Here's a refreshing so it can work on Mountain Lion and Mac OS X

Valerio Aimale (valerioa) wrote :

Two phases:

Phase 1: Install Macports with a long directory name

curl -o MacPorts-2.1.2.tar.bz2
tar xvjf MacPorts-2.1.2.tar.bz2
cd MacPorts-2.1.2
./configure --prefix-=/opt/local/macports-with-a-very-looooooooooooooooooooooooooong-name/
make install
cd ..

export PATH=/opt/local/macports-with-a-very-looooooooooooooooooooooooooong-name/sbin/:/opt/local/macports-with-a-very-looooooooooooooooooooooooooong-name/bin:$

port selfupdate

sudo port install gettext
sudo port install python27
sudo port install boost
sudo port -s install cairo -x11 +no_x11 +quartz
sudo port install pango +no_x11 +quartz
sudo port install gtk2 +no_x11 +quartz
sudo port install poppler +no_x11 +quartz
sudo port install libxslt boehmgc gtkmm lcms intltool popt
sudo port install aspell aspell-dict-en
sudo port install cairomm pangomm gtkmm
sudo port install libvisio
sudo port install libpng
sudo port install gsl
sudo port install imagemagick
sudo port install gtk-engines2
sudo port install libwpg
sudo port install libwpd
sudo port install gtk2-murrine

sudo port select --set python python27

curl -o numpy-1.7.0rc1.tar.gz ''
tar xvzf numpy-1.7.0rc1.tar.gz
cd numpy-1.7.0rc1
python install
cd ..

curl -o lxml-3.0.2.tgz
tar xvzf lxml-3.0.2.tgz
cd lxml-3.0.2
python install
cd ..

Valerio Aimale (valerioa) wrote :

Phase 2: build and package Inkscape

bzr branch lp:inkscape/0.48.x ./0.48.x-osx-newbuild
cd ./0.48.x-osx-newbuild
patch -p1 <0.48.x-osx-build.patch
chmod a+x packaging/macosx/MacOS/Inkscape

export PATH=/opt/local/macports-with-a-very-looooooooooooooooooooooooooong-name/sbin/:/opt/local/macports-with-a-very-looooooooooooooooooooooooooong-name/bin:$PATH

cd packaging/macosx
rm -fR Resources
tar xvjf

LIBPREFIX=/opt/local/macports-with-a-very-looooooooooooooooooooooooooong-name/ ./ a c b i p -py /opt/local/macports-with-a-very-looooooooooooooooooooooooooong-name/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/

LIBPREFIX=/opt/local/macports-with-a-very-looooooooooooooooooooooooooong-name/ ./ d

Valerio Aimale (valerioa) wrote :

This is not yet completely correct for python. A new patch that fixes python soon.

Valerio Aimale (valerioa) wrote :
su_v (suv-lp) on 2013-01-09
tags: added: gtk-osx osx packaging
su_v (suv-lp) wrote :

1) fixlib()
The version from the patch seems to address several issues of the current version, see also bug #532765:
- issue 1+2 are fixed
- issue 3: AFAICT unchanged. Rewriting the dylib paths is still taking extremely long.
- issue 4: AFAICT still present. AFAIU 'otool -D' is supposed to display the install name of a shared library, which doesn't match the original name for many of the libs included in the app bundle.

2) Python modules for extensions:
I would recommend to use the system python version both from within Inkscape (prepend '/usr/bin' to $PATH as before), as well as when compiling lxml (with static dependencies), so that it does not link to newer versions of dependent libaries installed via MacPorts (liblxml, libxslt). Numpy could then be dropped from the bundle (it ships with Apple's system python version).

I don't know about portability (whether lxml built for Python 2.7 on Lion can import and run with the system Python 2.7 on Mountain Lion). If this fails, one might consider to either offer separate packages for each supported OS X version, or resort to solutions similar to older packages (detect python & os version in the launcher script and adjust $PYTHONPATH to the included module versions accordingly (assuming we have prebuilt lxml modules (with static dependencies) available to be included during the bundling process).

3) Support for either backend of GTK+
Currently building a package with (older) X11-based dependencies to test whether it would work with the new launcher script (which replaces the compiled outdated ScriptExec binary) [1]. Bug #1046068 IMHO is likely a blocker to release Quartz-based stable 0.48.4 packages for now, and - even without any support for dock and launch services (a rather inconvenient regression compared to the current 0.48.2 package wrt to usability) - a newer 64bit package supporting Lion and Mountain Lion might be worthwhile nevertheless, even if depending on X11.

[1] First X11-based test packages (0.48.x r9943 + patches) on Lion 10.7.4 (Xcode 4.3.2) does launch ok (also triggers auto-launch of XQuartz if not already running), and seems to work as expected - except that the dock icon never stops bouncing until the application is quit again…

su_v (suv-lp) wrote :

3) Support for either backend of GTK+ (cont.)
A Quartz-based package of Inkscape 0.48.x r9943 + patches built ok on Lion 10.7.4 (Xcode 4.3.2) last night (using an existing MacPorts tree installed into a looooooong custom prefix, as required for 'rewritelibpaths()' in , and works as expected in initial tests - see also comment 2 in bug #1097539.

su_v (suv-lp) wrote :

On 09/01/2013 19:21, ~suv wrote:
> 3) Support for either backend of GTK+ (cont.)
> A Quartz-based package of Inkscape 0.48.x r9943 + patches built ok
> (…) and works as expected in initial tests

"as expected" -> (known) issues (limitations) with GTK+/Quartz had already been mentioned in
<> (item 3)

su_v (suv-lp) on 2017-01-12
tags: added: gtk-quartz
removed: gtk-osx
Qantas94Heavy (qantas94heavy) wrote :

Work on improving the build for Mac OS X is now being tracked on GitLab:

Please continue any relevant discussions there. Thank you!

Changed in inkscape:
status: New → Invalid
tags: added: bug-migration
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers