### this file is sourced not run
PKGVER=1.7.6
PKGBUILD=1
PKGARCH=i686

# source: libreoffice (post post BLFS 8.2 2018-06-01 uses the same version)
TARBALL=harfbuzz-$PKGVER.tar.bz2
MD5SUM=ffb94cf2942327344ac31330d07036ba
SRC_URL=https://dev-www.libreoffice.org/src/$TARBALL
#SRC_URL=http://www.freedesktop.org/software/harfbuzz/release/$TARBALL
BUNDLE=

SLACKREQ='glib32 freetype2_32 libgraphite2_32 libicu32'
SLACKDESC="harfbuzz32: harfbuzz32 $PKGVER (OpenType text shaping engine)  
harfbuzz32:  
harfbuzz32: Harfbuzz is an OpenType text shaping engine. It provides functions 
harfbuzz32: to convert Unicode text to glyph indices and positions; which can 
harfbuzz32: later be rendered using Freetype.  
harfbuzz32: 
harfbuzz32: This version of harfbuzz also depends on libicu for better support.
harfbuzz32: 
harfbuzz32: This contains 32-bit version of the library.
harfbuzz32: 
harfbuzz32: 
"

### default pkg_download
### default pkg_prepare
pkg_prepare() {
	pkg_prepare_default
	cd tmp/harfbuzz* &&
	sed -i -e "s/ -fno-rtti//" configure #enable static build if wanted
}

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

### build
pkg_build() {
	export ICU_DATA=/usr/share/icu/current/
	export CFLAGS="-Os -fPIC"
	export CPPFLAGS="-Os -fPIC"
	export LDFLAGS="-Wl,--no-as-needed -ldl "
	CONFFLAGS="$CONFFLAGS \
			--with-gobject \
			--with-icu \
			--with-cairo \
			--with-glib \
			--disable-gtk-doc \
			--with-graphite2=yes"
	pkg_build_autoconf && 
	pkg_build_slackdesc &&

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


