Skip to content
Permalink
Newer
Older
100755 109 lines (89 sloc) 3.66 KB
1
#! /bin/sh
2
set -xe
3
4
PKG=inkscape
5
VERSION=0.92.1
6
BUILD=0
7
PREFIX=/pkg/$PKG-$VERSION-$BUILD
8
9
mkdir -p $PREFIX
10
cat >$PREFIX/profile <<-EOF
11
PATH=$PREFIX/bin:\$PATH
12
EOF
13
14
source $PREFIX/profile
15
16
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
17
18
# what is the problem here?
19
# https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
20
#
21
# our installed Glib & friends are build with an old cxx( which didn't use the CXX11 ABI)
22
# our installed imagemagick is build with a new cxx (which defaulted to CXX11 ABI)
23
#
24
# we want to use both libraries. So neither _GLIBCXX_USE_CXX11_ABI=1 (the default now) nor
25
# _GLIBCXX_USE_CXX11_ABI=0 by it self is enough.
26
#
27
# with _GLIBCXX_USE_CXX11_ABI=1 (default)
28
# ./lib/libinkscape_base.so: undefined reference to `Magick::Blob::base64(std::string)'
29
# ...
30
# with _GLIBCXX_USE_CXX11_ABI=0 (default)
31
# main.cpp:(.text+0x2a01): undefined reference to `Glib::build_filename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
32
# ...
33
#
34
# As a quick fix we include ImageMagick with _GLIBCXX_USE_CXX11_ABI=0 here, so this ImageMagick
35
# library is compatible to the installed Glib and friends.
36
#
37
# We can't use the newest ImageMagick:
38
#
39
# /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*)’:
40
# /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’
41
#
42
43
# ImageMagick
44
45
VER=6.9.7-9
46
47
mkdir -p $PREFIX/build
48
cd $PREFIX/build
49
test -e ImageMagick-$VER.tar.xz || wget https://www.imagemagick.org/download/releases/ImageMagick-$VER.tar.xz
50
test -d ImageMagick-$VER || tar xf ImageMagick-$VER.tar.xz
51
cd ImageMagick-$VER
52
./configure --prefix=$PREFIX CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0
53
make -j $(nproc)
54
make install
55
56
# inkscape
57
58
mkdir -p $PREFIX/build
59
cd $PREFIX/build
60
61
test -e inkscape-0.92.1.tar_XlpI7qT.bz2 || wget https://inkscape.org/gallery/item/10682/inkscape-0.92.1.tar_XlpI7qT.bz2
62
test -d inkscape-0.92.1 || tar xf inkscape-0.92.1.tar_XlpI7qT.bz2
63
cd inkscape-$VERSION
64
65
# another problem: the CMakeLists of inkscape includes
66
# if(APPLE)
67
# SET(CMAKE_MACOSX_RPATH TRUE)
68
# SET(CMAKE_INSTALL_RPATH "@loader_path/../lib/inkscape")
69
# else()
70
# SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/inkscape")
71
# endif()
72
# Thereby overwriting any RPATH we might set e.g.
73
# cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 -DCMAKE_INSTALL_RPATH=$PREFIX/lib .
74
# to find ImageMagick library.
75
76
patch -p1 <<'EOF'
77
From: Unpriviledged Software Builder <build@theinternet.molgen.mpg.de>
78
Date: Fri, 24 Feb 2017 13:02:24 +0100
79
Subject: [PATCH] Honor CMAKE_INSTALL_RPATH
80
81
This enables us to configure CMAKE_INSTALL_RPATH e.g. use
82
83
cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DCMAKE_INSTALL_RPATH=$PREFIX/lib .
84
---
85
CMakeLists.txt | 2 +-
86
1 file changed, 1 insertion(+), 1 deletion(-)
87
88
diff --git a/CMakeLists.txt b/CMakeLists.txt
89
index e5d8919..e253961 100644
90
--- a/CMakeLists.txt
91
+++ b/CMakeLists.txt
92
@@ -27,7 +27,7 @@ if(APPLE)
93
SET(CMAKE_MACOSX_RPATH TRUE)
94
SET(CMAKE_INSTALL_RPATH "@loader_path/../lib/inkscape")
95
else()
96
- SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/inkscape")
97
+ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:$ORIGIN/../lib/inkscape")
98
endif()
99
100
cmake_policy(SET CMP0003 NEW) # don't be prolific with library paths
101
--
102
2.4.1
103
104
EOF
105
106
cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 -DCMAKE_INSTALL_RPATH=$PREFIX/lib .
107
make -j $(nproc)
108
make install
109