# Contributor: Mika Havela <mika.havela@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=fontconfig
pkgver=2.12.6
pkgrel=1
pkgdesc="Library for configuring and customizing font access"
url="http://fontconfig.org"
arch="all"
license="GPL"
depends=""
depends_dev=""
makedepends="$depends_dev freetype-dev expat-dev python3-dev gperf"
triggers="$pkgname.trigger=/usr/share/fonts/*"
subpackages="$pkgname-doc $pkgname-dev"
source="http://fontconfig.org/release/${pkgname}-${pkgver}.tar.gz"

builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	# regenerate hash functions
	rm -f src/fcobjshash.h

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--enable-static \
		--disable-docs
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make -j1 DESTDIR="$pkgdir" install

	install -m644 -D COPYING "$pkgdir"/usr/share/licenses/"${pkgname}"/COPYING
}

sha512sums="7c8a4039b4139fefddb3f73881a72e6c9ca940824d9315a1f111f0bf00f3604e15dd06b88cdc597332791820daf57d95f0ac6e7e9f6d3c3127cd0fffef9ce079  fontconfig-2.12.6.tar.gz"
