### this file is sourced not run
PKGVER=2.40.20 # this is the latest version that does not require rust compiler
PKGBUILD=1     # note this one requires gtk3 for rsvg-viewer. See 2.34.2 for last gtk2 version
PKGARCH=i686

# source: BLFS 2013-08-1 updated
TARBALL=librsvg-$PKGVER.tar.xz
MD5SUM=4949d313b0c5d9161a5c259104af5568
SRC_URL=http://ftp.gnome.org/pub/gnome/sources/librsvg/2.40/$TARBALL
BUNDLE=

SLACKREQ='gtk2_32 gdk-pixbuf32 libcroco32 pango32'
SLACKDESC="librsvg32: librsvg32 $PKGVER (SVG image library)  
librsvg32:  
librsvg32: The librsvg package contains a library and tools used to manipulate, 
librsvg32: convert and view Scalable Vector Graphic (SVG) images. 
librsvg32: 
librsvg32: This contains 32-bit version of the library.
librsvg32: 
librsvg32: 
librsvg32: 
librsvg32: 
librsvg32:
"

# hopefully one of these will work
SLACKINSTALL='
# hopefully one of these will work
# but be careful not to destroy existing loaders.cache if all fails
if type chroot > /dev/null; then
	chroot . /usr/bin/gdk-pixbuf-query-loaders-32 --update-cache
else
	./usr/bin/gdk-pixbuf-query-loaders-32 > /dev/null &&
	./usr/bin/gdk-pixbuf-query-loaders-32 > ./usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache 
fi 
'

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/librsvg* &&
	patch -Np1 -i ../pkg/enable-unconditional-xlink.patch
}

### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share
}

### build
pkg_build() {
	CONFFLAGS="$CONFFLAGS --disable-static"
	pkg_build_autoconf && pkg_build_slackdesc &&
	rm -f /usr/$LIBDIR/gdk-pixbuf-2.0/2.10.0/loaders.cache &&

	# multilib
	mv -v /usr/share/gir-1.0/* /usr/share/gir-1.0-32 &&
	rm -r /usr/share/gir-1.0/
}
