summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 23be3ecb7dcc6984d24229daed7d00ca1d285a5e (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
# Maintainer: Mahor Foruzesh <mahor1221 at gmail dot com>

pkgbase=juno-ocean-theme-git
__pkgname="${pkgbase%-theme-git}"
__Pkgname="${__pkgname^}"
__PkgName="$(echo "$__pkgname" | sed -e "s/\b./\u\0/g")"
pkgname=(
    "$__pkgname-gtk-theme-git"
    "plasma5-themes-$__pkgname-git"
    "kvantum-theme-$__pkgname-git"
)
pkgver=r236.22ab42f
pkgrel=1
pkgdesc="GTK themes inspired by epic vscode themes"
arch=("any")
url="https://github.com/EliverLara/Juno"
license=("GPL3")
makedepends=("git" "inkscape" "optipng")
optdepends=(
    "ttf-roboto: default font for gnome-shell"
    "gtk-engine-murrine: GTK2 support"
    "gnome-themes-extra: GTK2 support"
)
source=("$__pkgname::git+$url.git#branch=${__pkgname#juno-}")
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/$__pkgname"
    echo "r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

build() {
    cd "$srcdir/$__pkgname"

    export THEME_FONT_FACE="${THEME_FONT_FACE:-Roboto}"
    export THEME_FONT_SIZE="${THEME_FONT_SIZE:-10}"
    msg2 "To customize the font and size for gnome-shell, build this package"
    msg2 "with the variables below set to the desired font family and size"
    msg2 "- THEME_FONT_FACE (default font family is Roboto)"
    msg2 "- THEME_FONT_SIZE (default font point size is 10)"
    msg2 ""
    msg2 "Setting gnome-shell font face to $THEME_FONT_FACE"
    msg2 "Setting gnome-shell font size to $THEME_FONT_SIZE"

    if [ "$THEME_FONT_FACE" != "Roboto" ]; then
        sed -i -re "s/font-family: (.*);/font-family: $THEME_FONT_FACE, \1;/" \
            "$srcdir/$__pkgname/gnome-shell/gnome-shell.css"
    fi
    if [ "$THEME_FONT_SIZE" != "10" ]; then
        sed -i -re "s/font-size: (.*);/font-size: ${THEME_FONT_SIZE}pt;/" \
            "$srcdir/$__pkgname/gnome-shell/gnome-shell.css"
    fi

    msg2 "Rendering assets, please wait"
    pushd gtk-2.0
    while read $line; do echo -n "."; done < \
        <(./render-assets.sh 2>/dev/null)
    echo
    popd

    pushd src
    while read $line; do echo -n "."; done < \
        <(
            ./render-gtk3-assets.py 2>/dev/null
            ./render-gtk3-assets-hidpi.py 2>/dev/null
            ./render-wm-assets-hidpi.py 2>/dev/null
            ./render-wm-assets.py 2>/dev/null
        )
    echo
    popd
    msg2 "Done!"
}

package_juno-ocean-gtk-theme-git() {
    provides=("${pkgname[0]%-git}")
    conflicts=("${pkgname[0]%-git}" "${pkgbase%-git}")

    mkdir -p "$pkgdir/usr/share/themes"
    cp -a "$srcdir/$__pkgname" "$pkgdir/usr/share/themes/$__Pkgname"
    cd "$pkgdir/usr/share/themes/$__Pkgname"
    rm -r ".git"* "Art/" "kde/" "src/" *".json" "Gulpfile.js"
}
package_plasma5-themes-juno-ocean-git() {
    provides=("${pkgname[1]%-git}")
    conflicts=("${pkgname[1]%-git}" "${pkgbase%-git}")

    mkdir -p "$pkgdir/usr/share"
    cd "$pkgdir/usr/share" 
    cp -a "$srcdir/$__pkgname/kde/"* "./"
    rm -r "kvantum/"
    mkdir -p "aurorae/themes" 
    mkdir -p "sddm/themes"
    mv "sddm/${__PkgName#Juno-}" "sddm/themes/"
    mv "aurorae/${__PkgName#Juno-}" "aurorae/themes/"
}
package_kvantum-theme-juno-ocean-git() {
    provides=("${pkgname[2]%-git}")
    conflicts=("${pkgname[2]%-git}" "${pkgbase%-git}")

    mkdir -p "$pkgdir/usr/share/Kvantum"
    cd "$pkgdir/usr/share/Kvantum"
    cp -a "$srcdir/$__pkgname/kde/kvantum/${__PkgName#Juno-}" "./"
    cp -a "$srcdir/$__pkgname/LICENSE" "./${__PkgName#Juno-}/"
}