summaryrefslogtreecommitdiff
path: root/inkscape/Pkgfile
blob: 6cdf87b8d5a7c24324af2f61fb28fb357f05c03d (plain)
    1 # Description: An open source SVG editor.
    2 # URL: https://www.inkscape.org/
    3 # Maintainer: Danny Rawlins, crux at romster dot me
    4 # Depends on: boehm-gc boost double-conversion graphicsmagick gsl gtkmm3 libsoup libxslt poppler-glib popt potrace gdl
    5 
    6 name=inkscape
    7 _name=inkscape-INKSCAPE
    8 version=1.1.1
    9 _version=1.1.1_2021-09-20_3bf5ae0d25
   10 _pversion=21.10.0
   11 _psoversion=114
   12 release=1
   13 source=(#https://media.inkscape.org/dl/resources/file/$name-$version.tar.xz
   14 	https://inkscape.org/gallery/item/29255/inkscape-$_version.tar.xz
   15 	https://poppler.freedesktop.org/poppler-$_pversion.tar.xz)
   16 
   17 poppler() {
   18 	cmake -S poppler-$_pversion -B build-poppler -G Ninja \
   19 		-D CMAKE_INSTALL_PREFIX=/usr \
   20 		-D CMAKE_INSTALL_LIBDIR=lib \
   21 		-D CMAKE_BUILD_TYPE=Release \
   22 		-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
   23 		-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
   24 		-D ENABLE_UNSTABLE_API_ABI_HEADERS=ON \
   25 		-D ENABLE_UTILS=ON \
   26 		-D ENABLE_CPP=ON \
   27 		-D ENABLE_GLIB=ON \
   28 		-D ENABLE_QT5=OFF \
   29 		-D ENABLE_ZLIB=ON \
   30 		-D ENABLE_CMS=lcms2 \
   31 		-D ENABLE_LIBOPENJPEG=none \
   32 		-D WITH_NSS3=OFF \
   33 		-Wno-dev
   34 
   35 	cmake --build build-poppler
   36 	DESTDIR=$SRC/poppler cmake --install build-poppler
   37 	install -D -t $PKG/usr/lib $SRC/poppler/usr/lib/libpoppler.so.$_psoversion
   38 
   39 	export CXXFLAGS+=" -I$SRC/poppler/usr/include -I$SRC/poppler/usr/include/poppler"
   40 	export PKG_CONFIG_PATH="$SRC/poppler/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
   41 }
   42 
   43 build() {
   44 	[ ! -e "/usr/lib/libpoppler.so.$_psoversion" ] && poppler
   45 
   46 	# https://gitlab.gnome.org/GNOME/glib/-/issues/2331
   47 	CFLAGS+=' -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_66'
   48 	CXXFLAGS+=' -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_46 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_66'
   49 
   50 	cmake -S $name-$_version -B build -G Ninja \
   51 		-D CMAKE_INSTALL_PREFIX=/usr \
   52 		-D CMAKE_INSTALL_LIBDIR=lib \
   53 		-D CMAKE_BUILD_TYPE=Release \
   54 		-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
   55 		-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
   56 		-D WITH_INTERNAL_2GEOM=ON \
   57 		-Wno-dev
   58 
   59 	cmake --build build
   60 	DESTDIR=$PKG cmake --install build
   61 
   62 	rm -r 	$PKG/usr/share/man/?? \
   63 		$PKG/usr/share/man/zh_TW \
   64 		$PKG/usr/share/locale \
   65 		$PKG/usr/share/inkscape/doc
   66 
   67 	rm	$PKG/usr/share/inkscape/extensions/README.md \
   68 		$PKG/usr/share/inkscape/extensions/inkex/deprecated-simple/README.rst \
   69 
   70 	find $PKG/usr/share/inkscape -name README -exec rm -f {} +
   71 
   72 	/usr/bin/python3 -mcompileall $PKG
   73 	/usr/bin/python3 -O -m compileall $PKG
   74 	/usr/bin/python3 -OO -m compileall $PKG
   75 }

Generated by cgit