summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0d89e41a75cb168ba450d7fe8a1247eb17af3ba1 (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
# Maintainer:  dreieck
# Contributor: Karim Abou Zeid <karim23697 at gmail dot tld>

_pkgbase="nonicons"
pkgbase="${_pkgbase}-bin-git"
pkgname=(
  "${_pkgbase}-license-git"
  "${_pkgbase}-doc-git"
  "ttf-${pkgbase}"
  "woff-${pkgbase}"
)
pkgver=r68.20241213.5f56cf0
pkgrel=1
pkgdesc="A next-generation icon set for developers that extends octicons."
arch=("any")
url="https://github.com/yamatsum/nonicons"
license=('MIT')
makedepends=('git')
source=(
  "${_pkgbase}::git+${url}.git"
)
sha256sums=(
  'SKIP'
)

prepare() {
  cd "${srcdir}/${_pkgbase}"
  git log > "${srcdir}/git.log"
}

pkgver() {
  cd "${srcdir}/${_pkgbase}"

  _rev="$(git rev-list --count HEAD)"
  _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
  _hash="$(git rev-parse --short HEAD)"

  if [ -z "${_rev}" ]; then
    error "Git commit count could not be determined."
    return 1
  else
    printf '%s' "r${_rev}.${_date}.${_hash}"
  fi
}

package_nonicons-license-git() {
  optdepends=(
    "ttf-nonicons: TTF font this license is for."
    "woff-nonicons: WOFF font this license is for."
  )
  provides=(
    "nonicons-license"
  )
  conflicts=(
    "nonicons-license"
  )

  install -Dvm644 "${srcdir}/${_pkgbase}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgbase}/"
}

package_nonicons-doc-git() {
  optdepends=(
    "ttf-nonicons: TTF font this documentation is for."
    "woff-nonicons: WOFF font this documentation is for."
  )
  provides=(
    "nonicons-doc"
  )
  conflicts=(
    "nonicons-doc"
  )

  cd "${srcdir}/${_pkgbase}"

  install -Dvm644 README.md dist/{nonicons.html,nonicons.css} "${srcdir}/git.log" -t "${pkgdir}/usr/share/doc/${_pkgbase}/"

  install -dvm755 "${pkgdir}/usr/share/licenses/${pkgname}"
  ln -svr "${pkgdir}/usr/share/licenses/${pkgbase}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_ttf-nonicons-bin-git() {
  depends=(
    "nonicons-license"
  )
  optdepends=(
    "nonicons-doc: For information files about nonicons."
  )
  provides=(
    "ttf-nonicons"
    "nonicons-git=${pkgver}"
  )
  conflicts=(
    "ttf-nonicons"
    "nonicons-git"
  )
  replaces=(
    "nonicons-git<=r67.8454b3b"
  )

  cd "${srcdir}/${_pkgbase}"

  install -Dvm644 "dist/nonicons.ttf" -t "$pkgdir/usr/share/fonts/nonicons"

  install -dvm755 "${pkgdir}/usr/share/licenses/${pkgname}"
  ln -svr "${pkgdir}/usr/share/licenses/${pkgbase}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_woff-nonicons-bin-git() {
  depends=(
    "nonicons-license"
  )
  optdepends=(
    "nonicons-doc: For information files about nonicons."
  )
  provides=(
    "woff-nonicons"
  )
  conflicts=(
    "woff-nonicons"
  )

  cd "${srcdir}/${_pkgbase}"

  install -Dvm644 "dist/nonicons.woff" -t "$pkgdir/usr/share/fonts/nonicons"

  install -dvm755 "${pkgdir}/usr/share/licenses/${pkgname}"
  ln -svr "${pkgdir}/usr/share/licenses/${pkgbase}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}