summaryrefslogtreecommitdiff
path: root/pcr/unifont/PKGBUILD
blob: 0f05679d2c48e17180f53a39c44b6c9176777d0b (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Maintainer: Wael Karram <wael@waelk.tech>
# Maintainer (aur): neeshy <neeshy@tfwno.gf>
# Contributor: Carlos Aznarán <caznaranl@uni.pe>
# Contributor: Martin C. Doege <mdoege at compuserve dot com>
# Contributor: Gregory G Danielson III <gregdan3@protonmail.com>
# Contributor: nl6720 <nl6720@archlinux.org>
# Contributor: David McInnis <dave@dave3.xyz>
# Contributor: megadriver <megadriver at gmx dot com>
# Contributor: Antonio Rojas <arojas@archlinux.org>
# Contributor: Ronald van Haren <ronald.archlinux.org>
# Contributor: felix <`base64 -d <<< ZmVsaXgudm9uLnNAcG9zdGVvLmRlCg`>


# parabola changes and rationale:
#   - install documentation
#   - combination of several AUR packages

# NOTE: This package should be built per-arch.
#       The fonts are for 'any' arch; but 'unifont-utils' is arch-specific.
#       In order to publish all of these packages, `librestage` must be run twice.
#       The first run will stage the 'any' packages.
#       In order to librestage the per-arch 'unifont-utils' and source packages,
#       uncomment the commented arch=() array temporarily.


pkgname=('pcf-unifont'
         'psf-unifont'
         'hex-unifont'
         'bdf-unifont'
#         'ttf-unifont'
         'otf-unifont'
         'unifont-utils')
pkgbase=unifont
pkgver=15.1.04
pkgrel=1
pkgdesc="A free bitmap font with wide Unicode support (PCF, PSF and hex versions)"
arch=('any')
# arch=('armv7h' 'i686' 'x86_64') # for librestage (see NOTE above)
url="http://unifoundry.com/"
license=('GPL' 'custom:OFL')
source=("http://unifoundry.com/pub/unifont/unifont-$pkgver/unifont-$pkgver.tar.gz"{,.sig})
sha256sums=('4a0a481c06338543399f5130cb50cbec6b73eeff6b3466f72891c38cbe1c5cf7'
            'SKIP')
validpgpkeys=('95D2E9AB8740D8046387FD151A09227B1F435A33') # Paul Hardy <unifoundry@unifoundry.com>

build() {
  cd "${srcdir}"/${pkgbase}-${pkgver}

  local variation
  for variation in bold italic bolditalic; do
    "mk$variation" "unifont-$pkgver.bdf" | gzip -c >"unifont-$variation-$pkgver.bdf.gz"
  done

  make
}

package_pcf-unifont() {
  pkgdesc="A free bitmap font with wide Unicode support (PCF version)"

  # Install the font.
  cd "$srcdir/unifont-$pkgver/font/precompiled"
  install -Dm644 "unifont-$pkgver.pcf.gz" "$pkgdir/usr/share/fonts/misc/unifont.pcf.gz"
  # Install the license.
  cd "$srcdir/unifont-$pkgver"
  install -Dm644 OFL-1.1.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  # Install the documentation.
  install -Dm644 doc/unifont.pdf "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 doc/unifont.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_psf-unifont() {
  pkgdesc="A free bitmap font with wide Unicode support (PSF version)"

  # Install the font.
  cd "$srcdir/unifont-$pkgver/font/precompiled"
  install -Dm644 "Unifont-APL8x16-$pkgver.psf.gz" "$pkgdir/usr/share/kbd/consolefonts/Unifont-APL8x16.psf.gz"
  # Install the license.
  cd "$srcdir/unifont-$pkgver"
  install -Dm644 OFL-1.1.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  # Install the documentation.
  install -Dm644 doc/unifont.pdf "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 doc/unifont.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_hex-unifont() {
  pkgdesc="A free bitmap font with wide Unicode support (hex version)"

  # Install the font.
  cd "$srcdir/unifont-$pkgver/font/precompiled"
  install -Dm644 "unifont-$pkgver.hex" "$pkgdir/usr/share/unifont/unifont.hex"
  # Install the license.
  cd "$srcdir/unifont-$pkgver"
  install -Dm644 OFL-1.1.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  # Install the documentation.
  install -Dm644 doc/unifont.pdf "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 doc/unifont.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_bdf-unifont () {
  pkgdesc="A free bitmap font with wide Unicode support (BDF version)"

  # Install the font.
  cd "$srcdir/unifont-$pkgver/font/precompiled"
  gzip -d --force "unifont-$pkgver.bdf.gz"
  install -Dm644 "unifont-$pkgver.bdf" "$pkgdir/usr/share/fonts/misc/unifont.bdf"
  # Install the license.
  cd "$srcdir/unifont-$pkgver"
  install -Dm644 OFL-1.1.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  # Install the documentation.
  install -Dm644 doc/unifont.pdf "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 doc/unifont.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_ttf-unifont() {
  pkgdesc="A free bitmap font with wide Unicode support (TTF version)"

  # Install the font.
  cd "$srcdir/unifont-$pkgver/font/precompiled"
  install -d "$pkgdir/usr/share/fonts/Unifont/"
  install -m644 "unifont-$pkgver.ttf" "$pkgdir/usr/share/fonts/Unifont/Unifont.ttf"
  install -m644 "unifont_jp-$pkgver.ttf" "$pkgdir/usr/share/fonts/Unifont/Unifont_jp.ttf"
  install -m644 "unifont_upper-$pkgver.ttf" "$pkgdir/usr/share/fonts/Unifont/Unifont_Upper.ttf"
  install -m644 "unifont_csur-$pkgver.ttf" "$pkgdir/usr/share/fonts/Unifont/Unifont_CSUR.ttf"
  # Install the license.
  cd "$srcdir/unifont-$pkgver"
  install -Dm644 OFL-1.1.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  # Install the documentation.
  install -Dm644 doc/unifont.pdf "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 doc/unifont.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_otf-unifont() {
  pkgdesc="A free bitmap font with wide Unicode support (OTF version)"

  # Install the font.
  cd "$srcdir/unifont-$pkgver/font/precompiled"
  install -d "$pkgdir/usr/share/fonts/Unifont/"
  install -m644 "unifont-$pkgver.otf" "$pkgdir/usr/share/fonts/Unifont/Unifont.otf"
  install -m644 "unifont_jp-$pkgver.otf" "$pkgdir/usr/share/fonts/Unifont/Unifont_jp.otf"
  install -m644 "unifont_upper-$pkgver.otf" "$pkgdir/usr/share/fonts/Unifont/Unifont_Upper.otf"
  install -m644 "unifont_csur-$pkgver.otf" "$pkgdir/usr/share/fonts/Unifont/Unifont_CSUR.otf"
  # Install the license.
  cd "$srcdir/unifont-$pkgver"
  install -Dm644 OFL-1.1.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  # Install the documentation.
  install -Dm644 doc/unifont.pdf "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 doc/unifont.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_unifont-utils() {
  pkgdesc="A free bitmap font with wide Unicode support - utilities"
  arch=('armv7h' 'i686' 'x86_64')
  license=('GPL')
  depends=('perl')
  optdepends=(
    'perl-wx: for the unifont-viewer utility'
    'perl-gd: for the unihex2png and unipng2hex utilities'
  )

  cd "$srcdir/unifont-$pkgver"
  make -C src install PREFIX="$pkgdir/usr" LOCALBINDIR=../bin
  make -C man install PREFIX="$pkgdir/usr" COMPRESS=1
}