summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ede6ead03a8900067f171e0bfd644fa599d3325b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Maintainer: pkfbcedkrz <pkfbcedkrz@gmail.com>
# Contributor: Alan Strauhs <scarydoorsyeah@gmail.com>

_dotted_zero=false
_centered_tilde=true
_encodings='uni i15'

pkgname='uw-ttyp0-otb'
pkgver=1.3
pkgrel=2
pkgdesc='Monospaced bitmap font with unicode support and powerline symbols (OTB version)'
arch=('any')
url='http://people.mpi-inf.mpg.de/~uwe/misc/uw-ttyp0'
license=('custom:TTYP0')
makedepends=('fonttosfnt-git' 'perl')
source=("${url}/uw-ttyp0-${pkgver}.tar.gz")
md5sums=("SKIP")

prepare() {
	cd "uw-ttyp0-${pkgver}"
	if [[ -f ${SRCDEST}/VARIANTS.dat ]] ; then
		cp "${SRCDEST}/VARIANTS.dat" .
	else
		if ${_dotted_zero} ; then
			echo 'COPYTO Digit0Dotted Digit0'
		else
			echo 'COPYTO Digit0Slashed Digit0'
		fi >> VARIANTS.dat

		if ${_centered_tilde} ; then
			echo 'COPYTO MTilde AccTildeAscii'
		fi >> VARIANTS.dat
	fi

	if [[ -f ${SRCDEST}/TARGETS.dat ]] ; then
		cp "${SRCDEST}/TARGETS.dat" .
	else
		if [[ -n ${_encodings} ]] ; then
			echo "ENCODINGS = ${_encodings}"
		fi >> TARGETS.dat
	fi
}

build() {
    cd "uw-ttyp0-${pkgver}"
	./configure
	make bdf
	
	mkdir -p otb
	for f in genbdf/*.bdf ; do
		if grep -Fq 'FAMILY_NAME "' "$f" 2>/dev/null; then
        	family_name="$(grep -F 'FAMILY_NAME "' "$f")"
        	family_name="${family_name%\"}"
        	family_name_otb="$family_name (OTB)"
        	sed -i "s/$family_name/$family_name_otb/" "$f"
        fi
	    f=${f##*/}
	    fonttosfnt -b -c -g 2 -m 2 -o "otb/uw-ttyp0-${pkgver}-${f/bdf/otb}" "genbdf/${f}"
	done
}

package() {
	cd "uw-ttyp0-${pkgver}"

	install -d "$pkgdir/usr/share/fonts/misc"

	install -m644 otb/*.otb "${pkgdir}/usr/share/fonts/misc/"
	install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}