Skip to content

Instantly share code, notes, and snippets.

@atuyosi
Last active September 18, 2019 09:25
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atuyosi/ab5499a176b0b456bca98c44e2775cbb to your computer and use it in GitHub Desktop.
Save atuyosi/ab5499a176b0b456bca98c44e2775cbb to your computer and use it in GitHub Desktop.
Procedure for create App bundle and dmg for Inkscape 0.92 on Sierra/Mountain Lion

Buiding macOS Native (Gtk2/Quartz) version package.

  • Inkscape 0.92
  • Gtk 2
  • App bundle
  • Inkscape.dmg

Pre Requirements

  • Xcode
  • Intell Mac
  • Command Line Tools
  • MacPorts

Need Xcode's license agreement.

Patches

https://www.dropbox.com/sh/a0gjwf0u0ymrkl5/AACTDMZ68Gv_Ew6p2D1bVDkna?dl=0

Set up

Unpack sourc archive and go to source directory.

$ tar zxf inkscape-0.92.0.tar.bz2
$ cd inkscape-0.92.0

Copy Info.plist.in and modify it. This file use later (packaging step).

$ cp Info.plist.in Info.plist
$ vi Info.plist

Replace @VERSION@ to 0.92 (3 times). -> @VERSION@ to 0.92

Apply patch to CMakeLists.txt. The patch file is available from above dropbox's link.

$ patch -p0 < patches/CMakeLists.txt.patch

Patch for packaging

Apply the patch. The patch file is available from above dropbox's link.

$ cd packaging/macosx/
$ patch -p0 < patches/fix_lp476678.patch
$ cp patches/osx-app.sh osx-dmg.sh

Install packages for dependency

Install utility packages.

$ sudo port install libiconv wget cmake

Confirm requirement packages.

$ port deps inkscape

Install packages with +quartz -x11 variant.

$ sudo port install pkgconfig autoconf automake libtool intltool perl5.24 +quartz -x11
$ sudo port install cairo pango +quartz -x11
$ sudo port  install  gdk-pixbuf2 -x11 +quartz

If you got some error about dependency, try this.

$ sudo port clean XXX

XXX is failed package name.

$ sudo port install desktop-file-utils  popt  boehmgc  gsl  gtkmm  dbus-glib  lcms2  poppler  boost  ImageMagick  libcdr-0.1  libexif  libvisio-0.1  libwpg-0.3  aspell  gtkspell2  potrace  py27-lxml  py27-numpy +quartz -x11
/*

Another method (shortcut way):

$ sudo port install inkscape +xquartz
$ sudo port uninstall inkscape

*/

[Option] If you want GNOME VFS support, install gnome-vfsmm package. It is NOT mandatory.

sudo port install gnome-vfsmm

Prepare working directory

Create buid directory and go to that directory.

$ mkdir build && cd build
$ bash ../download-gtest.sh

Configuration via CMake

for Sierra:

CXXFLAGS="-std=c++11" CPPFLAGS="-I/opt/local/include" LDFLAGS="-L /opt/local/lib " cmake -D WITH_OPENMP=OFF -D ENABLE_OSX_APP_LOCATIONS=ON -D ICONV_INCLUDE_DIR=/opt/local/include -D ICONV_LIBRARIES=/opt/local/lib/libiconv.dylib   -DCMAKE_INSTALL_PREFIX=/opt/local ../

for moutain lion :

CXXFLAGS="-std=c++98 -stdlib=libstdc++" CPPFLAGS="-I/opt/local/include" LDFLAGS="-L /opt/local/lib " cmake -D WITH_OPENMP=OFF -D ENABLE_OSX_APP_LOCATIONS=ON -D ICONV_INCLUDE_DIR=/opt/local/include -D ICONV_LIBRARIES=/opt/local/lib/libiconv.dylib   -DCMAKE_INSTALL_PREFIX=/opt/local ..

-stdlib=libstdc++ option may not be mandatory.

On Mountain Lion (OSX 10.8) , MacPorts use -stdlib=libstdc++ (compiler default). So, to use MacPorts Libraries, we set same setting for -stdlib option (if specfied this option).

if compiling on Marverics ( OSX 10.9 ) or later, set this parameter for libc++.

Build binary

Let's compile.

if you get to try development version, probably need to do make inkscape_version before.

$ make -j2

// if you have many core cpu (such like 4-core, and more), you can use -j4 or -j8 option.

Install (temporary)

Temporary, install it to /opt/local/

$ sudo make install

Packaging

Move to working directory.

$ cd ../packaging/macos

Installing required packages for osx-app.sh.

$ sudo port install gtk-engines2 gtk2-murrine +quartz -x11
$ sudo port install gtk3 gnome-themes-standard +quartz

It may be able to download gnome theme file from git repos insstead of install gnome-themes-standard package.

There are some question that why above packages are needed for packaging netherless they not required when compiling it.

$ sudo port install icon-naming-utils
$ ./osx-app.sh  -s -py /usr/lib/python2.7/ -l "/opt/local"  -b /opt/local/bin/inkscape  -p ../../Info.plist

Inkscape.appare created in current folder. Finally, let's executeosx-dmg.sh`.

$ ./osx-dmg.sh -p Inkscape.app

There are created Inkscape.dmg in current folder.

Cleanup

Delete temporarily installed binaries.

$ cd -
$ sudo make uninstall

Finished.

@oskay
Copy link

oskay commented Jan 11, 2017

Thank you for working on this! Is there a place that issues and/or other discussions about this work is being discussed? I would like to be able to help out by noting issues and (where I can) suggesting solutions.

I downloaded the Sierra build that you posted via dropbox. It works (thank you again) but the extensions do not appear to work correctly. For any extension that I tried, it gives the "The fantastic lxml wrapper for libxml2 is required..." error.

A similar error was seen in previous Inkscape generations ( https://bugs.launchpad.net/inkscape/+bug/819209 ). Perhaps some other user can confirm whether or not this is the case on computers other than mine.

@julianrendell
Copy link

My understanding is that the lxml error is due to that python package not being included in your (system) python. I have python installed via brew, and used pip install lxml (from memory- you'll have to search for the name of that package.)

I'm guessing that for windows, Inkscape embeds python and all it's dependencies. For linux, the packages probably depend on the distribution version.

For OS X, it'd probably make sense to embed python, like windows?

@julianrendell
Copy link

julianrendell commented Feb 1, 2017

One more potential issue- the Mac builds are missing https://sk1project.net/modules.php?name=Products&product=uniconvertor, which also needs the sk1libs (reading the notes on https://sk1project.net/modules.php?name=Products&product=uniconvertor&op=download).

It'd be great to figure out including these as well; Corel draw is used a lot in the sign making and laser engraving fields.

Update: discovered there's a newer version(?) if uniconvertor here: https://github.com/sk1project/sk1-wx

@pgilfernandez
Copy link

Hi @atuyosi,

If you were able to build a dmg for Inkscape 0.92... please, why don't you also share it with us? most of us don't know how to use Terminal, CMake, etc and we would highly appreciate if someone shares the final dmg with the binary.

Thank you!

@atuyosi
Copy link
Author

atuyosi commented Feb 8, 2017

Sorry for my late reply.

I'll try to create new package for 0.9.2.1preX release at this weekend.

@oskay ,
As you pointed out, this package seems to need the "lxml" package (MacPorts's py27-lxml package ) .
Other developers are also working on this work, so I think that it is preferable to discuss with developer ML (You have already joined this?).

c.f.

@julianrendell ,

I did confirm previous version's build info. The Previous package contained UniConvertor & sk1libs.
But there are no binary package of UniConvertor & sk1libs for macOS. It may take a while.

ref. Inkscape 0.91-1 (OS X) Build info | Inkscape

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment