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

_fontname="twemoji"
_pkgname="ttf-$_fontname"
pkgname="$_pkgname-git"
pkgver=15.0.2.r0.g6780a94f
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-yaml'
  'svgo'
)

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

source=(
  'jdecked.twemoji'::'git+https://github.com/jdecked/twemoji.git'
  'git+https://github.com/13rac1/twemoji-color-font.git'
  'git+https://github.com/13rac1/scfbuild.git')
sha256sums=(
  'SKIP'
  'SKIP'
  'SKIP'
)

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

prepare(){
  cd "twemoji-color-font"
  ln -s "$srcdir/scfbuild" SCFBuild
  sed -i 's/package: regular-package linux-package deb-package macos-package windows-package/package: linux-package/' Makefile

  rm -r "assets/twemoji-svg"
  mv "$srcdir/jdecked.twemoji/assets/svg" "assets/twemoji-svg"
}

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

package(){
  cd "twemoji-color-font/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/"
}