From f100c7c0298ddaa75af97e2326a3bbd26a14809f Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 26 Jun 2020 17:13:57 +0200 Subject: [PATCH 1/2] inkscape: embed python support Including python doesn't waste much space, but makes inkscape independent from changes in the system (libreoffice also carries an own python). --- inkscape-1.0-1.build.sh | 115 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100755 inkscape-1.0-1.build.sh diff --git a/inkscape-1.0-1.build.sh b/inkscape-1.0-1.build.sh new file mode 100755 index 0000000..e1caede --- /dev/null +++ b/inkscape-1.0-1.build.sh @@ -0,0 +1,115 @@ +#! /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 lxml +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 From f422780b398d2d552b6ef8077d14e9df0d4735b4 Mon Sep 17 00:00:00 2001 From: thomas Date: Mon, 29 Jun 2020 11:20:27 +0200 Subject: [PATCH 2/2] inkscape: python, modules galore By checking the provided extensions, it's obvious to add a few more python modules. --- inkscape-1.0-1.build.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inkscape-1.0-1.build.sh b/inkscape-1.0-1.build.sh index e1caede..9ed3742 100755 --- a/inkscape-1.0-1.build.sh +++ b/inkscape-1.0-1.build.sh @@ -46,7 +46,12 @@ LDFLAGS="-Wl,-rpath=$PREFIX/lib" \ 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