# Contributor: Breno Leitao <breno.leitao@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=font-unifont
pkgver=16.0.01
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="
cfbb6598fc7fda7bbe1d061d3d35e3433df033bece0468fe469338ecac82fddd3fd9fd35f4693147284f28b02011939cad3c2570d878677c472227909f65af27  unifont-16.0.01.tar.gz
"
