summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6c88b54b61d631b3e770350588d7d6d4c9414099 (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
# Maintainer: George Rawlinson <george@rawlinson.net.nz>
# Contributor: Severen Redwood <severen@shrike.me>

pkgname='ttf-monoid'
pkgver=0.61
pkgrel=4
pkgdesc='A customisable coding font'
arch=('any')
license=('MIT' 'custom:OFL')
depends=('xorg-font-utils' 'fontconfig')
makedepends=('fontforge' 'python')
url='http://larsenwork.com/monoid/'
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/larsenwork/monoid/archive/${pkgver}.tar.gz"
'fontbuilder-python3.patch')
sha512sums=('2acae11b3d0a86ac1d0588de986fbcf13a83bdcb857b0eb1deaeae55615fdccbfd8f19b5618ee61abd1261c3f203cadcaa7b37f44f535a3fe462240602ab51dc'
            '7f06b8827ed12b3070512ae58424b92a05635eefe0dee0d6314f1b92230f431e2fde5a2d70adbff324bbcb4ce70b135ccda2a6dfaaeb7b6e4219a447034f00c0')

prepare () {
  # Create LICENSE file
  cd "monoid-${pkgver}"
  sed -n '/Monoid is dual licensed/,/OTHER DEALINGS IN THE FONT SOFTWARE./p' \
    'Readme.md' > \
    'LICENSE'

  # Patch fontbuilder script
  cd "Scripts"
  patch -sp1 < "${srcdir}/fontbuilder-python3.patch"
}

build () {
  cd "monoid-${pkgver}"
  export PYTHONPATH="$(pwd)/Scripts"
  python3 -c 'import fontbuilder; fontbuilder.build("_build", "Source/Monoid.sfdir");'
  python3 -c 'import fontbuilder; fontbuilder.build("_build", "Source/Monoid-Bold.sfdir");'
  python3 -c 'import fontbuilder; fontbuilder.build("_build", "Source/Monoid-Italic.sfdir");'
  python3 -c 'import fontbuilder; fontbuilder.build("_build", "Source/Monoid-Retina.sfdir");'
}

package () {
  cd "monoid-${pkgver}"
  install -dm755 "${pkgdir}/usr/share/fonts/TTF"
  install -m644 _build/*.ttf "${pkgdir}/usr/share/fonts/TTF"
  install -Dm644 LICENSE \
  "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}