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

# 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='glib freetype2 libgraphite2 libicu'
SLACKDESC="harfbuzz: harfbuzz $PKGVER (OpenType text shaping engine)  
harfbuzz:  
harfbuzz: Harfbuzz is an OpenType text shaping engine. It provides functions 
harfbuzz: to convert Unicode text to glyph indices and positions; which can 
harfbuzz: later be rendered using Freetype.  
harfbuzz: 
harfbuzz: This version of harfbuzz also depends on libicu for better support.
harfbuzz: 
harfbuzz: 
harfbuzz: 
harfbuzz: 
"

### 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
}

### defaulg pkg_package
### 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-64 &&
	rm -r /usr/share/gir-1.0/
}


