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