Difference between revisions of "Inkscape Devlibs"

From Inkscape Wiki
Jump to navigation Jump to search
Line 5: Line 5:
 
The C part of devlibs can be directly copied from official development bundles. Do not copy unneeded stuff like .lib, .def, static libraries, examples or documentation.
 
The C part of devlibs can be directly copied from official development bundles. Do not copy unneeded stuff like .lib, .def, static libraries, examples or documentation.
  
== Rebuilding the C++ part of devlibs ==
+
== Rebuilding the gtkmm stack ==
  
 
This is a description of the process I used to build the C++ libraries present in the devlibs. --[[User:Tweenk|Tweenk]] 00:50, 1 February 2010 (UTC)
 
This is a description of the process I used to build the C++ libraries present in the devlibs. --[[User:Tweenk|Tweenk]] 00:50, 1 February 2010 (UTC)
Line 33: Line 33:
 
* Prune C:\devlibs-update from unneeded stuff. In particular, you don't need static libraries, libtool files (.la), documentation and example programs. Note however that you DO need import libraries. They end with .dll.a - don't confuse them with static libraries that end with .a.
 
* Prune C:\devlibs-update from unneeded stuff. In particular, you don't need static libraries, libtool files (.la), documentation and example programs. Note however that you DO need import libraries. They end with .dll.a - don't confuse them with static libraries that end with .a.
 
* Copy the contents of C:\devlibs-update to C:\devlibs and enjoy.
 
* Copy the contents of C:\devlibs-update to C:\devlibs and enjoy.
 +
 +
== Rebuilding other C++ libraries ==
 +
 +
Inkscape currently uses two non-gtkmm C++ libraries: Poppler and Magick++ (part of ImageMagick). There are currently problems with Poppler later than 0.12.1, see [https://bugs.launchpad.net/inkscape/+bug/487038 bug 487038] for status.
 +
 +
===Poppler===
 +
 +
Follow the procedure for the gtkmm stack outlines above, with the following modifications:
 +
 +
* Ensure that you have libtiff, libpng and libjpeg development files matching the versions supplied by GTK. They can be downloaded from the GTK+ Windows binaries page, but should also be included in Devlibs.
 +
* Poppler complains that it wants libopenjpeg for JPEG2000 support. I have not been successful in building it correctly with MinGW, however.
 +
* libjpeg headers are broken - they define types that have conflicting definitions in basetsd.h and rpcndr.h (part of Windows API). To fix this, do two things. Both those modifications should be in Devlibs, but I'm documenting them here just in case.
 +
** Modify jmorecfg.h at line 162 - remove the final underscore. Apparently the include guards differ between the MS-supplied Win32 headers and the MinGW-supplied ones.
 +
#ifndef _BASETSD_H
 +
** Comment out line 52 of c:\tdm-gcc\include\rpcndr.h
 +
** /*typedef unsigned char boolean;*/
 +
* You need to add Perl you PATH (for glib-mkenums).
 +
$ PATH="$PATH:/c/devlibs/perl/bin"
 +
* Poppler doesn't use pkg-config. You need to explicitly pass it some flags, including those for freetype2.
 +
$ FT2_CFLAGS=`pkg-config --cflags freetype2`
 +
$ FT2_LIBS=`pkg-config --libs freetype2`
 +
$ CXXFLAGS="-O2" CFLAGS="-O2"
 +
  CPPFLAGS="-I/c/devlibs-update/include -I/c/devlibs/include $FT2_CFLAGS"
 +
  LDFLAGS="-L/c/devibs-update/lib -L/c/devlibs/lib $FT2_LIBS
 +
  ./configure --prefix=/c/devlibs-update
 +
 +
===ImageMagick===
 +
 +
ImageMagick needs the usual Freetype2 treatment. Additionally, the version of libtool it uses i retarded in some way, because it can't find the compiler's libgomp. You need to specify the compiler's library dir explicitly.
 +
$ FT2_CFLAGS=`pkg-config --cflags freetype2`
 +
$ FT2_LIBS=`pkg-config --libs freetype2`
 +
$ CXXFLAGS="-O2" CFLAGS="-O2"
 +
  CPPFLAGS="-I/c/devlibs-update/include -I/c/devlibs/include $FT2_CFLAGS"
 +
  LDFLAGS="-L/c/devibs-update/lib -L/c/devlibs/lib $FT2_LIBS
 +
  -L/mingw/lib/gcc/mingw32/4.4.1"
 +
  ./configure --prefix=/c/devlibs-update --disable-static --without-perl

Revision as of 13:09, 1 February 2010

Inkscape Devlibs are a bundle of libraries and tools used to compile Inkscape. It is hosted in a Launchpad repository.

Updating the C part of devlibs

The C part of devlibs can be directly copied from official development bundles. Do not copy unneeded stuff like .lib, .def, static libraries, examples or documentation.

Rebuilding the gtkmm stack

This is a description of the process I used to build the C++ libraries present in the devlibs. --Tweenk 00:50, 1 February 2010 (UTC)

  • Install the TDM-GCC build of MinGW into c:\tdm-gcc (or any other folder)
  • Install MSYS. Choose c:\tdm-gcc as your MinGW installation directory.
  • Install Doxygen. gtkmm wants it, otherwise it won't build.
  • Download current devlibs into C:\devlibs
  • Download sources for C++ libraries. Those are: libsigc++, glibmm, cairomm, pangomm, gtkmm. We use only header-only libraries from boost, so it doesn't need to be rebuilt - just copy the headers.
  • Create an empty directory C:\devlibs-update
  • Run MSYS. Set up paths the following way. The object of this is to build gtkmm using the glibmm you have just built.
$ export PKG_CONFIG_PATH=/c/devlibs-update/lib/pkgconfig:/c/devlibs/pkgconfig
$ PATH="/c/devlibs-update/bin:$PATH:/c/devlibs/bin"
$ PATH="$PATH:/c/Program Files/Doxygen/bin"
  • For each C++ library, configure, build and install it. Do it in the following order: libsigc++, glibmm, cairomm, pangomm, gtkmm. The commands should look like this:
$ CXXFLAGS="-O2" ./configure --prefix=/c/devlibs-update
$ make
$ make install
  • pangomm, cairomm and gtkmm seem to want Freetype2, but don't use pkg-config to find it. For them, do something like this. Note that those are backticks, not apostrophes.
$ FT2_CFLAGS=`pkg-config --cflags freetype2`
$ FT2_LIBS=`pkg-config --libs freetype2`
$ CXXFLAGS="-O2 $FT2_CFLAGS" LDFLAGS="$FT2_LIBS" ./configure --prefix=/c/devlibs-update
  • giomm (which is part of glibmm) has a defective main header which includes Unix-specific stuff that is not built on Windows. Comment out the following three includes in C:\devlibs-update\include\giomm-2.4\giomm.h. Otherwise gtkmm will not build.
#include <giomm/desktopappinfo.h>
#include <giomm/unixinputstream.h>
#include <giomm/unixoutputstream.h>
  • Prune C:\devlibs-update from unneeded stuff. In particular, you don't need static libraries, libtool files (.la), documentation and example programs. Note however that you DO need import libraries. They end with .dll.a - don't confuse them with static libraries that end with .a.
  • Copy the contents of C:\devlibs-update to C:\devlibs and enjoy.

Rebuilding other C++ libraries

Inkscape currently uses two non-gtkmm C++ libraries: Poppler and Magick++ (part of ImageMagick). There are currently problems with Poppler later than 0.12.1, see bug 487038 for status.

Poppler

Follow the procedure for the gtkmm stack outlines above, with the following modifications:

  • Ensure that you have libtiff, libpng and libjpeg development files matching the versions supplied by GTK. They can be downloaded from the GTK+ Windows binaries page, but should also be included in Devlibs.
  • Poppler complains that it wants libopenjpeg for JPEG2000 support. I have not been successful in building it correctly with MinGW, however.
  • libjpeg headers are broken - they define types that have conflicting definitions in basetsd.h and rpcndr.h (part of Windows API). To fix this, do two things. Both those modifications should be in Devlibs, but I'm documenting them here just in case.
    • Modify jmorecfg.h at line 162 - remove the final underscore. Apparently the include guards differ between the MS-supplied Win32 headers and the MinGW-supplied ones.
#ifndef _BASETSD_H
    • Comment out line 52 of c:\tdm-gcc\include\rpcndr.h
    • /*typedef unsigned char boolean;*/
  • You need to add Perl you PATH (for glib-mkenums).
$ PATH="$PATH:/c/devlibs/perl/bin"
  • Poppler doesn't use pkg-config. You need to explicitly pass it some flags, including those for freetype2.
$ FT2_CFLAGS=`pkg-config --cflags freetype2`
$ FT2_LIBS=`pkg-config --libs freetype2`
$ CXXFLAGS="-O2" CFLAGS="-O2"
  CPPFLAGS="-I/c/devlibs-update/include -I/c/devlibs/include $FT2_CFLAGS"
  LDFLAGS="-L/c/devibs-update/lib -L/c/devlibs/lib $FT2_LIBS
  ./configure --prefix=/c/devlibs-update

ImageMagick

ImageMagick needs the usual Freetype2 treatment. Additionally, the version of libtool it uses i retarded in some way, because it can't find the compiler's libgomp. You need to specify the compiler's library dir explicitly.

$ FT2_CFLAGS=`pkg-config --cflags freetype2`
$ FT2_LIBS=`pkg-config --libs freetype2`
$ CXXFLAGS="-O2" CFLAGS="-O2"
  CPPFLAGS="-I/c/devlibs-update/include -I/c/devlibs/include $FT2_CFLAGS"
  LDFLAGS="-L/c/devibs-update/lib -L/c/devlibs/lib $FT2_LIBS
  -L/mingw/lib/gcc/mingw32/4.4.1"
  ./configure --prefix=/c/devlibs-update --disable-static --without-perl