# Contributor: Breno Leitao <breno.leitao@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=font-unifont
pkgver=16.0.02
pkgrel=0
pkgdesc="GNU Unifont glyphs"
url="https://unifoundry.com/unifont/index.html"
arch="all"
options="!check"  # No way to test fonts.
license="GFDL-1.3-or-later GPL-2.0-or-later WITH Font-exception-2.0"
subpackages="unifont-dev unifont-doc unifont-misc unifont-tools"
source="https://unifoundry.com/pub/unifont/unifont-$pkgver/unifont-$pkgver.tar.gz"
builddir="$srcdir/unifont-$pkgver"

prepare() {
	default_prepare
	# clean precompiled
	make clean
}

build() {
	make
}

package() {
	# renamed from unifont
	provides="unifont=$pkgver-r$pkgrel"
	replaces="unifont"

	make PREFIX="$pkgdir/usr" install

	cd "$pkgdir"/usr/share/unifont
	rm -r html ChangeLog* INSTALL* NEWS* README* ./*.pdf
}

tools() {
	depends="bdftopcf perl-gd"

	amove usr/bin
}

doc() {
	default_doc
	amove usr/share/unifont/*.info.*
}

misc() {
	pkgdesc="$pkgdesc (misc hex/bmp files)"

	amove usr/share/unifont
}

sha512sums="
29165d029ced651d907c6e600fd83551a483163f5d489ff00044c1c1717ce452e4cb43e2df06c8a4de913ee93487a4acb38339e70ae16f7d9c30264228225bd8  unifont-16.0.02.tar.gz
"
