summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b794288c662392ba54bdbb27530b354d67fb7c65 (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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Maintainer: Johannes Jöns <johannes@joens.email>
pkgbase=noto-fonts-git
pkgname=('noto-fonts-hinted-git' 'noto-fonts-unhinted-git'
         'noto-fonts-unhinted-variable-git' 'noto-fonts-unhinted-variable-slim-git'
         'noto-fonts-full-git' 'noto-fonts-full-variable-git' 'noto-fonts-full-variable-slim-git')
pkgver=r5.efa9c9f
pkgrel=1
pkgdesc="Noto fonts git version"
arch=(any)
url="https://github.com/notofonts/"
license=('OFL')
makedepends=('git' 'python' 'python-pip' 'python-cairocffi')
conflicts=(noto-fonts{,-extra,})
provides=(noto-fonts{,-extra,})
source=("git+https://github.com/jopejoe1-aur/noto-fonts" "activate"
        "66-noto-sans.conf" "66-noto-serif.conf" "66-noto-mono.conf"
        "46-noto-sans.conf" "46-noto-serif.conf" "46-noto-mono.conf")
sha256sums=('SKIP'
            '11a256a464d24c66d52c109868cbc5c0e40fe7f125dc7762b862e62af1764fd9'
            '52684bebf6447be22618d2a04ff37623ec92f9d8ccf6b6f972e5bcbcfee90d69'
            '4459944b63dc083107280f5d7375c69746bf80a09416a4a4909a100e58e5a33a'
            '4526289f59654e2a81dc734669a1ae4e416f9a56d0896ec3741c6bf065baf8a8'
            '83a8faf6a47954075f97a2d555048e2a6689c38603b2ca00150157bf645f4593'
            'c94368b24506770767d003e5bcba589a8e402e489c240ee52453bf3ac7e9b5fa'
            'f5c09b37280d7569b6c99a78511639be4ae25b8c5406464422fe0421fe13a884')

_blocklist=(Arimo test armenian Cousine hanifi-rohingya multani old-hungarian-ui Tinos)

pkgver() {
    cd "${srcdir}/noto-fonts"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "${srcdir}"
    rm -rf "venv"
    cd "noto-fonts"
    git submodule update --init --recursive

    for font in "${_blocklist[@]}"; do
        rm -rf "$font"
    done

    for dir in */; do
        cd "$dir"
        rm -rf "subset-files"
        rm -rf "venv"
        mkdir "subset-files"
        cd "subset-files"
        ln -s "${srcdir}/noto-fonts/latin-greek-cyrillic"
        cd ../..
    done
}

build() {
    cd "$srcdir/noto-fonts"
    for dir in */; do
        cd "$dir"
        if [ -e "$srcdir/venv/bin/activate" ]; then
            input="$srcdir/noto-fonts/$dir/venv"
            activate=$(cat "$srcdir/activate")
            activate="${activate//§TO_BE_REPLACED/$input}"
            echo "$activate" > "$srcdir/venv/bin/activate"
        else
            python -m pip install --upgrade pip
            python -m pip install --upgrade virtualenv
            python -m virtualenv "$srcdir/venv"
            input="$srcdir/noto-fonts/$dir/venv"
            activate=$(cat "$srcdir/activate")
            activate="${activate//§TO_BE_REPLACED/$input}"
            echo "$activate" > "$srcdir/venv/bin/activate"
        fi
        source "$srcdir/venv/bin/activate"
        python -m pip install --upgrade -r requirements.txt
        python -m fontmake -o variable --print-preview -m "Master_dev.designspace"
        deactivate
        cd ..
    done
}

_package() {
  # Install fontconfig files
  install -Dm644 "$srcdir"/*.conf -t "$pkgdir"/usr/share/fontconfig/conf.avail/
  install -d "$pkgdir"/usr/share/fontconfig/conf.default
  ln -rs "$pkgdir"/usr/share/fontconfig/conf.avail/* "$pkgdir"/usr/share/fontconfig/conf.default
}

package_noto-fonts-hinted-git() {
    _package
    pkgdesc+=' (hinted)'
    conflicts+=(noto-fonts-unhinted-git noto-fonts-unhinted-variable-git noto-fonts-unhinted-variable-slim-git noto-fonts-full-git noto-fonts-full-variable-git noto-fonts-full-variable-slim-git)

    install -vDm644 -t "${pkgdir}"/usr/share/fonts/noto/ \
        ${srcdir}/noto-fonts/*/fonts/*/hinted/ttf/*
}

package_noto-fonts-unhinted-git() {
    _package
    pkgdesc+=' (unhinted)'
    conflicts+=(noto-fonts-hinted-git noto-fonts-unhinted-variable-git noto-fonts-unhinted-variable-slim-git noto-fonts-full-git noto-fonts-full-variable-git noto-fonts-full-variable-slim-git)

    install -vDm644 -t "${pkgdir}"/usr/share/fonts/noto/ \
        ${srcdir}/noto-fonts/*/fonts/*/unhinted/ttf/*
}

package_noto-fonts-unhinted-variable-git() {
    _package
    pkgdesc+=' (unhinted variable)'
    conflicts+=(noto-fonts-hinted-git noto-fonts-unhinted-git noto-fonts-unhinted-variable-slim-git noto-fonts-full-git noto-fonts-full-variable-git noto-fonts-full-variable-slim-git)

    install -vDm644 -t "${pkgdir}"/usr/share/fonts/noto/ \
        ${srcdir}/noto-fonts/*/fonts/*/unhinted/variable-ttf/*
}

package_noto-fonts-unhinted-variable-slim-git() {
    _package
    pkgdesc+=' (unhinted variable slim)'
    conflicts+=(noto-fonts-hinted-git noto-fonts-unhinted-git noto-fonts-unhinted-variable-git noto-fonts-full-git noto-fonts-full-variable-git noto-fonts-full-variable-slim-git)

    install -vDm644 -t "${pkgdir}"/usr/share/fonts/noto/ \
        ${srcdir}/noto-fonts/*/fonts/*/unhinted/slim-variable-ttf/*
}

package_noto-fonts-full-git() {
    _package
    pkgdesc+=' (full)'
    conflicts+=(noto-fonts-hinted-git noto-fonts-unhinted-git noto-fonts-unhinted-variable-git noto-fonts-unhinted-variable-slim-git noto-fonts-full-variable-git noto-fonts-full-variable-slim-git)

    install -vDm644 -t "${pkgdir}"/usr/share/fonts/noto/ \
        ${srcdir}/noto-fonts/*/fonts/*/full/ttf/*
}

package_noto-fonts-full-variable-git() {
    _package
    pkgdesc+=' (full variable)'
    conflicts+=(noto-fonts-hinted-git noto-fonts-unhinted-git noto-fonts-unhinted-variable-git noto-fonts-unhinted-variable-slim-git noto-fonts-full-git noto-fonts-full-variable-slim-git)

    install -vDm644 -t "${pkgdir}"/usr/share/fonts/noto/ \
        ${srcdir}/noto-fonts/*/fonts/*/full/variable-ttf/*
}

package_noto-fonts-full-variable-slim-git() {
    _package
    pkgdesc+=' (full variable slim)'
    conflicts+=(noto-fonts-hinted-git noto-fonts-unhinted-git noto-fonts-unhinted-variable-git noto-fonts-unhinted-variable-slim-git noto-fonts-full-git noto-fonts-full-variable-git)

    install -vDm644 -t "${pkgdir}"/usr/share/fonts/noto/ \
        ${srcdir}/noto-fonts/*/fonts/*/full/slim-variable-ttf/*
}