summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d8b888f013ef3db37b1fd57ddd3a19e96993515b (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
# Maintainer: ammarhossain <ammar at butterfly dot so>
pkgname=rice-cooker
pkgver=0.1.2
pkgrel=1
pkgdesc="a visual (toy) tool for ricing"
arch=('x86_64')
url="https://github.com/amarsbar/rice-cooker"
_srcdir="$pkgname-$pkgver"
license=('BSD-3-Clause')
depends=('electron41' 'git' 'hicolor-icon-theme' 'hyprland' 'hyprpolkitagent' 'polkit' 'qt6-5compat' 'qt6-multimedia' 'quickshell-git')
makedepends=('cargo' 'npm' 'rust')
optdepends=(
    'paru: preferred AUR helper for installing rice dependencies'
    'yay: alternative AUR helper for installing rice dependencies'
    'ttf-material-symbols-variable: icon font for Whisker and Nandoroid'
    'ttf-outfit: intended UI font for Whisker'
)
source=(
    "$pkgname-$pkgver.tar.gz::$url/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz"
    'rice-cooker.sh'
    'rice-cooker.desktop'
)
sha256sums=('d1a9b99df2b5a34c37e388d73602a0f7968dff08f5a5585d6501c947518d1752'
            '1527354310806f2ae55a2629d2954f02efa6b4063d85233ef3ecc50f53887b91'
            'ed4a26ab693d922de7392f4020a61d75c723c5dfaaa3b828ea5f4c870fb4933d')

prepare() {
    cd "$_srcdir/backend"
    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
    cd "$_srcdir"
    npm ci
    npm run build

    cd backend
    export CARGO_TARGET_DIR=target
    cargo build --frozen --release
}

check() {
    cd "$_srcdir/backend"
    cargo test --frozen --lib
}

package() {
    cd "$_srcdir"

    install -Dm755 "backend/target/release/rice-cooker-backend" \
        "$pkgdir/usr/bin/rice-cooker-backend"
    install -Dm644 "backend/catalog.toml" \
        "$pkgdir/usr/share/rice-cooker/catalog.toml"
    install -Dm644 "backend/polkit/so.butterfly.ricecooker.policy" \
        "$pkgdir/usr/share/polkit-1/actions/so.butterfly.ricecooker.policy"
    install -Dm644 "packaging/icons/rice-cooker.svg" \
        "$pkgdir/usr/share/icons/hicolor/scalable/apps/rice-cooker.svg"
    install -Dm644 "packaging/icons/rice-cooker.png" \
        "$pkgdir/usr/share/icons/hicolor/512x512/apps/rice-cooker.png"

    install -dm755 "$pkgdir/usr/share/rice-cooker"
    cp -a out package.json "$pkgdir/usr/share/rice-cooker/"
    install -Dm644 "packaging/icons/rice-cooker.png" \
        "$pkgdir/usr/share/rice-cooker/rice-cooker.png"

    install -Dm755 "$srcdir/rice-cooker.sh" "$pkgdir/usr/bin/rice-cooker"
    install -Dm644 "$srcdir/rice-cooker.desktop" \
        "$pkgdir/usr/share/applications/rice-cooker.desktop"
    install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}