### this file is sourced not run
PKGVER=0.92.3
PKGBUILD=1
PKGARCH=x86_64

# source: post BLFS 8.3 2018-09-28
TARBALL=inkscape-$PKGVER.tar.bz2
MD5SUM=4ef7171cc1de9e1608d8c49b77fed99e
SRC_URL=https://media.inkscape.org/dl/resources/file/$TARBALL
BUNDLE=

SLACKREQ='libgc libboost-common libxslt gtk2mm poppler libpopt'
SLACKDESC="inkscape: inkscape $PKGVER (SVG editor)  
inkscape:  
inkscape: Inkscape is a what you see is what you get Scalable Vector Graphics 
inkscape: editor. It is useful for creating, viewing and changing SVG images. 
inkscape: It is also a versatile vector drawing program.  
inkscape: 
inkscape: 
inkscape: 
inkscape: 
inkscape: 
inkscape: 
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/inkscape* &&

	# BLFS patches
	patch -Np1 -i ../pkg/inkscape-0.92.3-use_versioned_ImageMagick6-1.patch &&
	patch -Np1 -i ../pkg/inkscape-0.92.3-poppler65-1.patch &&
	# fix gcc 7.1 build
	sed -i 's| abs(| std::fabs(|g' src/ui/tools/flood-tool.cpp &&

	# Fatdog lib64 patch
	sed -i -e "s|lib/|${LIBDIR}/|" src/CMakeLists.txt
}

### default pkg_package
### build
pkg_build() {
	CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_BUILD_TYPE=Release"

	pkg_build_cmake || return 1
	# BLFS - remove spurious static libs that got installed
	rm -v /usr/lib/inkscape/lib*_LIB.a &&
	rmdir /usr/lib/inkscape && rmdir /usr/lib ;

	# keep the folder because it could include extensions depending which other packages are installed
	ln -s inkscape/libinkscapebase.so /usr/$LIBDIR/libinkscapebase.so &&

	pkg_build_slackdesc
}


