summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bced0c6f06ae03478db464319f32646105228374 (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
# Maintainer:

_fontname="twemoji"
_pkgname="ttf-$_fontname"
pkgname="$_pkgname-git"
pkgver=15.1.0.r6.g0dfa4d0
pkgrel=1
pkgdesc="Unicode emoji color OpenType-SVG font"
url="https://github.com/jdecked/twemoji"
license=('CC-BY-4.0' 'MIT')
arch=('any')

makedepends=(
  'fontforge'
  'git'
  'imagemagick'
  'inkscape'
  'nodejs'
  'potrace'
  'python-fonttools'
  'python-setuptools'
  'python-yaml'
  'svgo'
)

provides=(
  'emoji-font'
  'ttf-twemoji'
  'ttf-twemoji-color'
)
conflicts=(
  'ttf-twemoji'
  'ttf-twemoji-color'
)

_pkgsrc="jdecked.twemoji"
_pkgsrc_tcf="13rac1.twemoji-color-font"
_pkgsrc_scf="13rac1.scfbuild"
source=(
  "$_pkgsrc"::"git+https://github.com/jdecked/twemoji.git"
  "$_pkgsrc_tcf"::"git+https://github.com/13rac1/twemoji-color-font.git"
  "13rac1.scfbuild"::"git+https://github.com/13rac1/scfbuild.git"
  '0001-fix-make-parallelism.patch'
)
sha256sums=(
  'SKIP'
  'SKIP'
  'SKIP'
  '5c92883010449928703763f82b1287cdb348862bf08d88c73f103389a626ece0'
)

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

prepare() {
  cd "$_pkgsrc_tcf"
  ln -s "$srcdir/$_pkgsrc_scf" SCFBuild

  rm -r "assets/twemoji-svg"
  mv "$srcdir/$_pkgsrc/assets/svg" "assets/twemoji-svg"

  patch -Np1 -i '../0001-fix-make-parallelism.patch'
}

build() {
  cd "$_pkgsrc_tcf"
  sed -E 's&^(\s*VERSION :=) [0-9\.]+$&\1 '"${pkgver%%.r*}"'&' -i Makefile
  make -j8
}

package() {
  cd "$_pkgsrc_tcf/build/TwitterColorEmoji-SVGinOT-Linux-${pkgver%%.r*}"
  install -Dm644 "TwitterColorEmoji-SVGinOT.ttf" -t "$pkgdir/usr/share/fonts/TTF/"
  install -Dm644 LICENSE* -t "$pkgdir/usr/share/licenses/$pkgname/"
}