Skip to content

inkscape: embed python support #122

Merged
merged 2 commits into from
Jul 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions inkscape-1.0-1.build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#! /bin/sh

set -xe

PKG=inkscape
VERSION=1.0
BUILD=1
DATEREV=2020-05-01_4035a4fb49 # The hex part is now called 'revision'

PREFIX=/pkg/$PKG-$VERSION-$BUILD
if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi

# this is only needed for the python build
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR )
mkdir -p $BUILD_TMPDIR/home
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home

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

export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
mkdir -p $PREFIX/build

cd $PREFIX/build

NPROC=$(( $(nproc) * 4 / 5 + 1 ))

# there are troubles with lxml and python-3 from the system, so just throw an embedded python at the problem.
PYTHONVERSION=3.8.3
test -e Python-$PYTHONVERSION.tar.xz || wget --no-verbose https://www.python.org/ftp/python/$PYTHONVERSION/Python-$PYTHONVERSION.tar.xz
test -d Python-$PYTHONVERSION || tar -xf Python-$PYTHONVERSION.tar.xz
cd Python-$PYTHONVERSION

LDFLAGS="-Wl,-rpath=$PREFIX/lib" \
./configure \
--prefix=$PREFIX \
--enable-shared

make -j $NPROC
make install
pip3 install --upgrade pip
pip3 install barcode
pip3 install lxml
pip3 install numpy
pip3 install scour
pip3 install serial
pip3 install pytest
cd ..

# bundle the ms-visio/coreldraw readers, unfortunately they rely on some wordperfect
# related tools (cough, cough). So we need some small packages.

# https://sourceforge.net/projects/libwpd/files/librevenge/librevenge-0.0.4/librevenge-0.0.4.tar.xz
test -d librevenge-0.0.4 || tar -xf /src/mariux/md5repo/2677cf97716c699146f999575ac0147d/librevenge-0.0.4.tar.xz
cd librevenge-0.0.4
./configure --prefix=$PREFIX --disable-tests --without-docs --disable-werror --disable-silent-rules
make -j$NPROC
make install
cd ..

# https://sourceforge.net/projects/libwpd/files/libwpd/libwpd-0.10.3/libwpd-0.10.3.tar.xz
test -d libwpd-0.10.3 || tar -xf /src/mariux/md5repo/d5e44712c4674d499afb8e89d830fcad/libwpd-0.10.3.tar.xz
cd libwpd-0.10.3
./configure --prefix=$PREFIX --disable-tests --without-docs --disable-werror --disable-silent-rules
make -j$NPROC
make install
cd ..

# https://sourceforge.net/projects/libwpg/files/libwpg/libwpg-0.3.3/libwpg-0.3.3.tar.xz
test -d libwpg-0.3.3 || tar -xf /src/mariux/md5repo/c3727b1196506fc77f6f916866884411/libwpg-0.3.3.tar.xz
cd libwpg-0.3.3
./configure --prefix=$PREFIX --disable-tests --without-docs --disable-werror --disable-silent-rules
make -j$NPROC
make install
cd ..

test -e libvisio-0.1.7.tar.xz || wget --no-verbose https://dev-www.libreoffice.org/src/libvisio/libvisio-0.1.7.tar.xz
test -d libvisio-0.1.7 || tar -xf libvisio-0.1.7.tar.xz
cd libvisio-0.1.7
./configure --prefix=$PREFIX --disable-tests --without-docs --disable-werror --disable-silent-rules
make -j$NPROC
make install
cd ..

test -d libcdr || git clone https://anongit.freedesktop.org/git/libreoffice/libcdr.git
cd libcdr
git checkout libcdr-0.1.6 --force
git clean -dffx
./autogen.sh
./configure --prefix=$PREFIX --disable-tests --without-docs --disable-werror --disable-silent-rules
make -j$NPROC
make install
cd ..

test -e inkscape-1.0.tar.xz || wget --no-verbose https://media.inkscape.org/dl/resources/file/inkscape-1.0.tar.xz
test -d inkscape-1.0_$DATEREV || tar -xf inkscape-1.0.tar.xz
cd inkscape-1.0_$DATEREV

# note, by placing 'libinkscape_base.so' in $prefix/lib, and not
# in $prefix/lib/inkscape the rpath logic from CMakeLists.txt works again.
# (but still looks ugly in ldd: libwpg-0.3.so.3 => /pkg/inkscape-1.0-0/bin/./../lib/libwpg-0.3.so.3)
mkdir -p build
cd build
cmake \
-DINKSCAPE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_VERBOSE_MAKEFILE=ON \
..
make -j$NPROC
make install


exit