contrib/inkscape/Pkgfile

57 lines
1.8 KiB
Plaintext

# Description: An open source SVG editor.
# URL: https://www.inkscape.org/
# Maintainer: John McQuah, jmcquah at disroot dot org
# Depends on: boehm-gc double-conversion graphicsmagick gsl gtkmm3 libsoup libxslt poppler-ink popt potrace
name=inkscape
version=1.3.2
release=3
source=(https://media.inkscape.org/dl/resources/file/$name-$version.tar.xz 6209.patch)
build() {
export LDFLAGS+=" -Wl,-rpath=/usr/lib/inkscape"
export PKG_CONFIG_PATH="/usr/lib/inkscape/pkgconfig:$PKG_CONFIG_PATH"
cd ${name}-${version}*
# patch for the new poppler ABI
patch -Np1 -i ../6209.patch
# add missing header file (merge request 6089)
sed -e '/^#include <libxml.uri/a #include <libxml/xmlmemory.h>' \
-i src/object/uri.h
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_FLAGS_RELEASE="-L/usr/lib/inkscape $CFLAGS" \
-D CMAKE_C_FLAGS_RELEASE="-L/usr/lib/inkscape $CXXFLAGS" \
-D POPPLER_INCLUDE_DIR="/usr/include/poppler-ink" \
-D POPPLER_GLIB_INCLUDE_DIR="/usr/include/poppler-ink/glib" \
-D WITH_INTERNAL_2GEOM=ON \
-D BUILD_TESTING=OFF \
-D WITH_LIBCDR=OFF \
-D WITH_NLS=OFF \
-Wno-dev
sed -e '/^#include <poppler/s;poppler/;;' \
-i src/extension/internal/pdfinput/pdf-input.cpp
cmake --build build
DESTDIR=$PKG cmake --install build
rm -r $PKG/usr/share/man/?? \
$PKG/usr/share/man/??_?? \
$PKG/usr/share/inkscape/doc
find $PKG/usr/share/inkscape \( -name 'README' -o -name 'README.*' \
-o -name 'LICENSE.txt' \) -delete
prt-get isinst bash-completion || rm -rf $PKG/usr/share/bash-completion
/usr/bin/python3 -m compileall $PKG
/usr/bin/python3 -O -m compileall $PKG
/usr/bin/python3 -OO -m compileall $PKG
}