summaryrefslogtreecommitdiff
path: root/pcr/ttf-fonts-meta/PKGBUILD
blob: 560b83b4391182d09a88bcf529b8bdeedd858cf6 (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
# Maintainer: David P. <megver83@parabola.nu>
# Contributor: bill-auger <bill-auger@programmer.net>


# NOTE: Generally, we do not want packaging to be so dynamic
#         (eg: `date` as 'pkgver', or building from a git branch tip),
#         such that the package version or contents is inherently not reproducible.
#       In the case of pure meta-packages like this one though (and package-groups),
#         reproducibility reduces to that of it's dependencies; and neither
#         meta-packages nor package-groups should play a role in any dependency chain,
#         other than the mandatory ones (currently only 'base').
#       This dynamic approach is far easier to maintain than an explicit white-list,
#         which is a highly desirable property; becasue the use-case for installing
#         1GB of fonts, seems too small to justify maintenance of this package at all.


pkgname=ttf-fonts-meta
pkgver=$(date +%Y%m%d)
pkgrel=1
pkgdesc="Metapackage that installs all available fonts (approx: 1GB)"
arch=(any)
url=https://www.parabola.nu/
license=(GPL)

depends=()
install=${pkgname}.install


package()
{
  local repos='(extra|community|pcr)'
  local filters='(alias|birdfont|fontsel|encodings|mkfontscale|nerd-fonts|ttf-fonts-meta|xlsfonts|xorg-font-util)'
  local overrides='nerd-fonts'
  local fonts=$( ( pacman -Ss ^ttf-     | grep -E "${repos}/ttf-"      ; \
                   pacman -Ss [^d]fonts | grep -E "${repos}/.*fonts.*" ; \
                   pacman -Ss fonts$    | grep -E "${repos}/.*font "   ; ) | \
                 sed -E "s!${repos}/([^ ]*) .*!\2!"                        | \
                 grep -vE "${filters}" | uniq                                )

  depends+=( ${fonts} ${overrides} )

  echo -e "\$fonts found (plus \$overrides):\n${depends[@]}"
}