archrelease: copy trunk to community-any
[ArchLinux/community.git] / ttf-monoid / trunk / PKGBUILD
blob90770b84041e2fd63cb539e6dfc279ec7bc48ff8
1 # Maintainer: George Rawlinson <george@rawlinson.net.nz>
2 # Contributor: Severen Redwood <severen@shrike.me>
4 pkgname='ttf-monoid'
5 pkgver=0.61
6 pkgrel=7
7 pkgdesc='A customisable coding font'
8 arch=('any')
9 license=('MIT' 'custom:OFL')
10 makedepends=('fontforge' 'python')
11 url='https://larsenwork.com/monoid/'
12 source=("${pkgname}-${pkgver}.tar.gz::https://github.com/larsenwork/monoid/archive/${pkgver}.tar.gz"
13         "fontbuilder-python3.patch")
14 sha512sums=('2acae11b3d0a86ac1d0588de986fbcf13a83bdcb857b0eb1deaeae55615fdccbfd8f19b5618ee61abd1261c3f203cadcaa7b37f44f535a3fe462240602ab51dc'
15             '7f06b8827ed12b3070512ae58424b92a05635eefe0dee0d6314f1b92230f431e2fde5a2d70adbff324bbcb4ce70b135ccda2a6dfaaeb7b6e4219a447034f00c0')
17 prepare () {
18   cd "monoid-${pkgver}"
20   # extract LICENSE from README
21   sed -n '/Monoid is dual licensed/,/OTHER DEALINGS IN THE FONT SOFTWARE./p' \
22     'Readme.md' > \
23     'LICENSE'
25   # patch fontbuilder script
26   cd "Scripts"
27   patch -sp1 < "${srcdir}/fontbuilder-python3.patch"
30 build () {
31   cd "monoid-${pkgver}"
33   # ensure python can find fontbuilder module
34   export PYTHONPATH="$(pwd)/Scripts"
36   # list of fonts to build
37   # note: Monoid-Diacritic variants are buggy, so they are skipped
38   local FONT_FILES=(
39     "Source/Monoid.sfdir"
40     "Source/Monoid-Bold.sfdir"
41     "Source/Monoid-Italic.sfdir"
42     "Source/Monoid-Retina.sfdir"
43     "Monoisome/Monoisome.sfdir"
44   )
46   # build fonts
47   for FONT_FILE in "${FONT_FILES[@]}"; do
48     python3 -c "import fontbuilder; fontbuilder.build('_build', '"${FONT_FILE}"');"
49   done
52 package () {
53   cd "monoid-${pkgver}"
55   # fonts
56   install -vDm644 _build/*.ttf -t "${pkgdir}/usr/share/fonts/TTF"
58   # license
59   install -Dm644 LICENSE \
60   "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"