From 2ad7115236a3a985da189e1142a14e10f1a11d45 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Mon, 8 Jul 2019 12:37:11 +0200 Subject: [PATCH 1/4] inkscape-0.92.4: Update and rebuild for libpoppler update 1. Use latest version from [branch 0.92.x][1] This branch includes a [commit fixing a build error with Poppler 0.76][2], cf [issue 220][3]. 2. Use latest ImageMagick 6.9.10-53 [1]: https://gitlab.com/inkscape/inkscape/commits/0.92.x [2]: https://gitlab.com/inkscape/inkscape/commit/dc25406853353320078eca22cf817fb052c97082 [3]: https://gitlab.com/inkscape/inkscape/issues/220 --- inkscape-0.92.4-1.build.sh | 110 +++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100755 inkscape-0.92.4-1.build.sh diff --git a/inkscape-0.92.4-1.build.sh b/inkscape-0.92.4-1.build.sh new file mode 100755 index 0000000..6879867 --- /dev/null +++ b/inkscape-0.92.4-1.build.sh @@ -0,0 +1,110 @@ +#! /bin/sh +set -xe + +PKG=inkscape +VERSION=0.92.4 +GITHASH=424477f665adb9996045d92026ceecb2eeb22dbe +BUILD=1 +PREFIX=/pkg/$PKG-$VERSION-$BUILD + +mkdir -p $PREFIX +cat >$PREFIX/profile <<-EOF + PATH=$PREFIX/bin:\$PATH +EOF + +source $PREFIX/profile + +export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig + +# what is the problem here? +# https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html +# +# our installed Glib & friends are build with an old cxx( which didn't use the CXX11 ABI) +# our installed imagemagick is build with a new cxx (which defaulted to CXX11 ABI) +# +# we want to use both libraries. So neither _GLIBCXX_USE_CXX11_ABI=1 (the default now) nor +# _GLIBCXX_USE_CXX11_ABI=0 by it self is enough. +# +# with _GLIBCXX_USE_CXX11_ABI=1 (default) +# ./lib/libinkscape_base.so: undefined reference to `Magick::Blob::base64(std::string)' +# ... +# with _GLIBCXX_USE_CXX11_ABI=0 (default) +# main.cpp:(.text+0x2a01): undefined reference to `Glib::build_filename(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)' +# ... +# +# As a quick fix we include ImageMagick with _GLIBCXX_USE_CXX11_ABI=0 here, so this ImageMagick +# library is compatible to the installed Glib and friends. +# +# We can't use the newest ImageMagick: +# +# /pkg/inkscape-0.92.1-0/build/inkscape-0.92.1/src/extension/internal/bitmap/channel.cpp: In member function ‘virtual void Inkscape::Extension::Internal::Bitmap::Channel::applyEffect(Magick::Image*)’: +# /pkg/inkscape-0.92.1-0/build/inkscape-0.92.1/src/extension/internal/bitmap/channel.cpp:31:58: error: ‘MatteChannel’ is not a member of ‘Magick’ +# + +# ImageMagick + +VER=6.9.10-53 + +mkdir -p $PREFIX/build +cd $PREFIX/build +test -e ImageMagick-$VER.tar.xz || wget https://www.imagemagick.org/download/releases/ImageMagick-$VER.tar.xz +test -d ImageMagick-$VER || tar xf ImageMagick-$VER.tar.xz +cd ImageMagick-$VER +./configure --prefix=$PREFIX CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 +make -j $(nproc) +make install + +# inkscape + +mkdir -p $PREFIX/build +cd $PREFIX/build + +test -e inkscape-$GITHASH.tar.bz2 || wget -O inkscape-$GITHASH.tar.bz2 https://gitlab.com/inkscape/inkscape/-/archive/$GITHASH/inkscape-$GITHASH.tar.bz2 +test -d inkscape-$GITHASH || tar xf inkscape-$GITHASH.tar.bz2 +cd inkscape-$GITHASH + +# another problem: the CMakeLists of inkscape includes +# if(APPLE) +# SET(CMAKE_MACOSX_RPATH TRUE) +# SET(CMAKE_INSTALL_RPATH "@loader_path/../lib/inkscape") +# else() +# SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/inkscape") +# endif() +# Thereby overwriting any RPATH we might set e.g. +# cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 -DCMAKE_INSTALL_RPATH=$PREFIX/lib . +# to find ImageMagick library. + +patch -p1 <<'EOF' +From: Unpriviledged Software Builder +Date: Fri, 24 Feb 2017 13:02:24 +0100 +Subject: [PATCH] Honor CMAKE_INSTALL_RPATH + +This enables us to configure CMAKE_INSTALL_RPATH e.g. use + + cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DCMAKE_INSTALL_RPATH=$PREFIX/lib . +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e5d8919..e253961 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,7 +27,7 @@ if(APPLE) + SET(CMAKE_MACOSX_RPATH TRUE) + SET(CMAKE_INSTALL_RPATH "@loader_path/../lib/inkscape") + else() +- SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/inkscape") ++ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:$ORIGIN/../lib/inkscape") + endif() + + cmake_policy(SET CMP0003 NEW) # don't be prolific with library paths +-- +2.4.1 + +EOF + +cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 -DCMAKE_INSTALL_RPATH=$PREFIX/lib . +make -j $(nproc) +make install + From 2f85ed2f8862f8620d747bb83d2cadfba216d29d Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Mon, 8 Jul 2019 12:37:56 +0200 Subject: [PATCH 2/4] inkscape-0.92.4-1: Integrate `$PREFIX/.compatlibs` --- inkscape-0.92.4-1.build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/inkscape-0.92.4-1.build.sh b/inkscape-0.92.4-1.build.sh index 6879867..cd1a192 100755 --- a/inkscape-0.92.4-1.build.sh +++ b/inkscape-0.92.4-1.build.sh @@ -10,6 +10,7 @@ PREFIX=/pkg/$PKG-$VERSION-$BUILD mkdir -p $PREFIX cat >$PREFIX/profile <<-EOF PATH=$PREFIX/bin:\$PATH + if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi EOF source $PREFIX/profile From a2cf452cb680e083c48b25e0c0145cec3732d5d3 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Mon, 8 Jul 2019 13:56:44 +0200 Subject: [PATCH 3/4] inkscape: Remove blank line at end of file --- inkscape-0.92.4-1.build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/inkscape-0.92.4-1.build.sh b/inkscape-0.92.4-1.build.sh index cd1a192..768da7a 100755 --- a/inkscape-0.92.4-1.build.sh +++ b/inkscape-0.92.4-1.build.sh @@ -108,4 +108,3 @@ EOF cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 -DCMAKE_INSTALL_RPATH=$PREFIX/lib . make -j $(nproc) make install - From 008e62f84006f062bc572353b96731ceed171b6f Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Mon, 29 Jul 2019 19:50:35 +0200 Subject: [PATCH 4/4] inkscape-0.92.4-1: Remove C++ 11 ABI hack MarIuX is finally [up to date with its dependencies][1], so building ImageMagick separately is not needed anymore. [1]: https://github.molgen.mpg.de/mariux64/bee-files/pull/1184 --- inkscape-0.92.4-1.build.sh | 42 +------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/inkscape-0.92.4-1.build.sh b/inkscape-0.92.4-1.build.sh index 768da7a..9bc8961 100755 --- a/inkscape-0.92.4-1.build.sh +++ b/inkscape-0.92.4-1.build.sh @@ -16,48 +16,8 @@ EOF source $PREFIX/profile export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig - -# what is the problem here? -# https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html -# -# our installed Glib & friends are build with an old cxx( which didn't use the CXX11 ABI) -# our installed imagemagick is build with a new cxx (which defaulted to CXX11 ABI) -# -# we want to use both libraries. So neither _GLIBCXX_USE_CXX11_ABI=1 (the default now) nor -# _GLIBCXX_USE_CXX11_ABI=0 by it self is enough. -# -# with _GLIBCXX_USE_CXX11_ABI=1 (default) -# ./lib/libinkscape_base.so: undefined reference to `Magick::Blob::base64(std::string)' -# ... -# with _GLIBCXX_USE_CXX11_ABI=0 (default) -# main.cpp:(.text+0x2a01): undefined reference to `Glib::build_filename(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)' -# ... -# -# As a quick fix we include ImageMagick with _GLIBCXX_USE_CXX11_ABI=0 here, so this ImageMagick -# library is compatible to the installed Glib and friends. -# -# We can't use the newest ImageMagick: -# -# /pkg/inkscape-0.92.1-0/build/inkscape-0.92.1/src/extension/internal/bitmap/channel.cpp: In member function ‘virtual void Inkscape::Extension::Internal::Bitmap::Channel::applyEffect(Magick::Image*)’: -# /pkg/inkscape-0.92.1-0/build/inkscape-0.92.1/src/extension/internal/bitmap/channel.cpp:31:58: error: ‘MatteChannel’ is not a member of ‘Magick’ -# - -# ImageMagick - -VER=6.9.10-53 - mkdir -p $PREFIX/build -cd $PREFIX/build -test -e ImageMagick-$VER.tar.xz || wget https://www.imagemagick.org/download/releases/ImageMagick-$VER.tar.xz -test -d ImageMagick-$VER || tar xf ImageMagick-$VER.tar.xz -cd ImageMagick-$VER -./configure --prefix=$PREFIX CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 -make -j $(nproc) -make install -# inkscape - -mkdir -p $PREFIX/build cd $PREFIX/build test -e inkscape-$GITHASH.tar.bz2 || wget -O inkscape-$GITHASH.tar.bz2 https://gitlab.com/inkscape/inkscape/-/archive/$GITHASH/inkscape-$GITHASH.tar.bz2 @@ -105,6 +65,6 @@ index e5d8919..e253961 100644 EOF -cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 -DCMAKE_INSTALL_RPATH=$PREFIX/lib . +cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DCMAKE_INSTALL_RPATH=$PREFIX/lib . make -j $(nproc) make install