summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 754f1ca7dd70197d891753ef8c31a6dcb9bd0396 (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
# Maintainer: Dct Mei <dctxmei@yandex.com>

pkgbase=grub-themes-git
_pkgbase=grub2-themes
pkgname=('grub-theme-tela-color-1080p-git'
         'grub-theme-tela-color-2k-git'
         'grub-theme-tela-color-4k-git'
         'grub-theme-tela-color-ultrawide-git'
         'grub-theme-tela-color-ultrawide2k-git'
         'grub-theme-tela-white-1080p-git'
         'grub-theme-tela-white-2k-git'
         'grub-theme-tela-white-4k-git'
         'grub-theme-tela-white-ultrawide-git'
         'grub-theme-tela-white-ultrawide2k-git'
         'grub-theme-tela-whitesur-1080p-git'
         'grub-theme-tela-whitesur-2k-git'
         'grub-theme-tela-whitesur-4k-git'
         'grub-theme-tela-whitesur-ultrawide-git'
         'grub-theme-tela-whitesur-ultrawide2k-git'
         'grub-theme-vimix-color-1080p-git'
         'grub-theme-vimix-color-2k-git'
         'grub-theme-vimix-color-4k-git'
         'grub-theme-vimix-color-ultrawide-git'
         'grub-theme-vimix-color-ultrawide2k-git'
         'grub-theme-vimix-white-1080p-git'
         'grub-theme-vimix-white-2k-git'
         'grub-theme-vimix-white-4k-git'
         'grub-theme-vimix-white-ultrawide-git'
         'grub-theme-vimix-white-ultrawide2k-git'
         'grub-theme-vimix-whitesur-1080p-git'
         'grub-theme-vimix-whitesur-2k-git'
         'grub-theme-vimix-whitesur-4k-git'
         'grub-theme-vimix-whitesur-ultrawide-git'
         'grub-theme-vimix-whitesur-ultrawide2k-git'
         'grub-theme-stylish-color-1080p-git'
         'grub-theme-stylish-color-2k-git'
         'grub-theme-stylish-color-4k-git'
         'grub-theme-stylish-color-ultrawide-git'
         'grub-theme-stylish-color-ultrawide2k-git'
         'grub-theme-stylish-white-1080p-git'
         'grub-theme-stylish-white-2k-git'
         'grub-theme-stylish-white-4k-git'
         'grub-theme-stylish-white-ultrawide-git'
         'grub-theme-stylish-white-ultrawide2k-git'
         'grub-theme-stylish-whitesur-1080p-git'
         'grub-theme-stylish-whitesur-2k-git'
         'grub-theme-stylish-whitesur-4k-git'
         'grub-theme-stylish-whitesur-ultrawide-git'
         'grub-theme-stylish-whitesur-ultrawide2k-git'
         'grub-theme-slaze-color-1080p-git'
         'grub-theme-slaze-color-2k-git'
         'grub-theme-slaze-color-4k-git'
         'grub-theme-slaze-white-1080p-git'
         'grub-theme-slaze-white-2k-git'
         'grub-theme-slaze-white-4k-git'
         'grub-theme-slaze-whitesur-1080p-git'
         'grub-theme-slaze-whitesur-2k-git'
         'grub-theme-slaze-whitesur-4k-git'
         'grub-theme-whitesur-color-1080p-git'
         'grub-theme-whitesur-color-2k-git'
         'grub-theme-whitesur-color-4k-git'
         'grub-theme-whitesur-white-1080p-git'
         'grub-theme-whitesur-white-2k-git'
         'grub-theme-whitesur-white-4k-git'
         'grub-theme-whitesur-whitesur-1080p-git'
         'grub-theme-whitesur-whitesur-2k-git'
         'grub-theme-whitesur-whitesur-4k-git')
pkgver=2021.01.26.r4.gae0fced
pkgrel=1
pkgdesc="Flat Design themes for Grub"
arch=('any')
url="https://github.com/vinceliuice/grub2-themes"
license=('GPL3')
depends=('grub')
makedepends=('git')
source=("git+${url}.git")
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}"/"${_pkgbase}"/
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

_package() {
    cd "${srcdir}"/"${_pkgbase}"/
    install -Dm 644 LICENSE -t "${pkgdir}"/usr/share/licenses/"${name}-${icon}-${resolution}-git"/
    install -Dm 644 common/* -t "${pkgdir}"/usr/share/grub/themes/"${name}-${icon}-${resolution}"/
    install -Dm 644 config/"theme-${resolution}.txt" "${pkgdir}"/usr/share/grub/themes/"${name}-${icon}-${resolution}"/theme.txt
    install -Dm 644 backgrounds/"${resolution}"/"background-${name}.jpg" "${pkgdir}"/usr/share/grub/themes/"${name}-${icon}-${resolution}"/background.jpg
    for icons in 'color' 'white' 'whitesur'; do
        if [[ "${icon}" == "${icons}" ]]; then
            if [[ "${resolution}" == 'ultrawide' ]]; then
                install -Dm 644 assets/assets-select/select-1080p/* -t "${pkgdir}"/usr/share/grub/themes/"${name}-${icon}-${resolution}"/
                install -Dm 644 assets/"assets-${icon}"/icons-1080p/* -t "${pkgdir}"/usr/share/grub/themes/"${name}-${icon}-${resolution}"/icons/
            elif [[ "${resolution}" == 'ultrawide2k' ]]; then
                install -Dm 644 assets/assets-select/select-2k/* -t "${pkgdir}"/usr/share/grub/themes/"${name}-${icon}-${resolution}"/
                install -Dm 644 assets/"assets-${icon}"/icons-2k/* -t "${pkgdir}"/usr/share/grub/themes/"${name}-${icon}-${resolution}"/icons/
            else
                install -Dm 644 assets/assets-select/"select-${resolution}"/* -t "${pkgdir}"/usr/share/grub/themes/"${name}-${icon}-${resolution}"/
                install -Dm 644 assets/"assets-${icon}"/"icons-${resolution}"/* -t "${pkgdir}"/usr/share/grub/themes/"${name}-${icon}-${resolution}"/icons/
            fi
        fi
    done
}

main() {
    for _pkgname in "${pkgname[@]}"; do
        eval "package_${_pkgname}() {
            provides=("${_pkgname%-*}")
            conflicts=("${_pkgname%-*}")
            name="$(echo ${_pkgname%-*} | sed 's/grub-theme-//' | awk -F '-' '{print $1}')"
            icon="$(echo ${_pkgname%-*} | sed 's/grub-theme-//' | awk -F '-' '{print $2}')"
            resolution="$(echo ${_pkgname%-*} | sed 's/grub-theme-//' | awk -F '-' '{print $3}')"
            _package
        }"
    done
}

main