# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=font-dejavu
pkgver=2.37
pkgrel=5
pkgdesc="Font family based on the Bitstream Vera Fonts with a wider range of characters"
url="https://dejavu-fonts.github.io/"
arch="noarch"
license="Bitstream-Vera"
options="!check"
depends="fontconfig encodings mkfontscale"
makedepends="font-util-dev"
# added fontconfig configuration from:
# https://github.com/bohoomil/fontconfig-ultimate/tree/master/fontconfig_patches/fonts-settings
source="https://downloads.sourceforge.net/project/dejavu/dejavu/$pkgver/dejavu-fonts-ttf-$pkgver.tar.bz2
	https://downloads.sourceforge.net/project/dejavu/dejavu/$pkgver/dejavu-lgc-fonts-ttf-$pkgver.tar.bz2
	45-dejavu.conf
	90-tt-dejavu.conf
	"
builddir="$srcdir"

# backwards compat (<3.17)
provides="ttf-dejavu=$pkgver-r$pkgrel"
replaces="ttf-dejavu"

package() {
	mkdir -p	"$pkgdir"/etc/fonts/conf.d

	install -Dm644 \
		dejavu-fonts-ttf-$pkgver/ttf/*.ttf \
		-t "$pkgdir"/usr/share/fonts/dejavu

	install -Dm644 \
		"$srcdir"/dejavu-fonts-ttf-$pkgver/fontconfig/*.conf \
		"$srcdir"/dejavu-lgc-fonts-ttf-$pkgver/fontconfig/*.conf \
		-t "$pkgdir"/etc/fonts/conf.avail/

	cd "$pkgdir"/etc/fonts/conf.d
	local j
	for j in "$srcdir"/*.conf; do
		install -Dm644 "$j" -t "$pkgdir"/etc/fonts/conf.avail/
		ln -sf /etc/fonts/conf.avail/${j##*/}
	done
}

sha512sums="
bafa39321021097432777f0825d700190c23f917d754a4504722cd8946716c22c083836294dab7f3ae7cf20af63c4d0944f3423bf4aa25dbca562d1f30e00654  dejavu-fonts-ttf-2.37.tar.bz2
4bf36813b4143a482a50ee20377166cbc22e3aa62ccb453fe6ce27d2286acaf2b6f06759eb5d5000d2f868a7d93ecad851ad29de60fb531ed9ac2fcd7b9bdc1f  dejavu-lgc-fonts-ttf-2.37.tar.bz2
df82fea7ad6c58edcc20c960fd2de9d49c70e23f9e63180b063c848a6f0d5592e2ce31dc0dc4a0b5abc8e682393c827c96b4a9da9203974672ebd3a77e5b9fc3  45-dejavu.conf
bc12705369050739143eda6a2dadaada954112ea262bd297a4823b31861f3da0f61e17ad6fb61226caea16323c3bc9cd88e8b0e60f61b2af6d245af885a4399c  90-tt-dejavu.conf
"
