summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aa90ca09bd0b76e6ee51952f2b56135254e70e1f (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
# Maintainer: creations <creations@creations.works>
pkgname=navithingy-git
pkgver=0.2.0.r24.18300ce
pkgrel=1
pkgdesc="A Navidrome client built with Tauri and Svelte."
arch=("$CARCH")
url="https://github.com/vMohammad24/NaviThingy"
license=('MIT')
depends=('nodejs' 'npm' 'gtk3' 'gstreamer' 'gst-plugins-base' 'gst-plugins-good' 'gst-plugins-bad' 'gst-plugins-ugly')
makedepends=('git' 'rustup' 'pkg-config' 'clang' 'lld' 'webkit2gtk-4.1' 'openssl' 'openssl-1.1' 'glib2' 'zlib' 'patchelf')
optdepends=(
    "libappindicator-gtk3: System tray support"
    "gst-plugin-pipewire: Required for PipeWire-based audio playback"
)
source=("git+https://github.com/vMohammad24/NaviThingy.git")
sha256sums=('SKIP')
install="$pkgname.install"
provides=('navithingy')
conflicts=('navithingy')

pkgver() {
    cd "$srcdir/NaviThingy"
    local tag rev commit
    tag=$(git describe --tags --abbrev=0 | sed 's/^NaviThingy//' | tr -d 'v')
    rev=$(git rev-list --count HEAD)
    commit=$(git rev-parse --short HEAD)

    echo "${tag}.r${rev}.${commit}"
}


prepare() {
    cd "$srcdir/NaviThingy"

    rustup show active-toolchain || rustup default stable
    rustup update stable
    rustup target add "$(rustc -vV | grep host | awk '{print $2}')"

    npm install
}

build() {
    cd "$srcdir/NaviThingy"

    export RUSTFLAGS="-C link-arg=-fuse-ld=lld"
    export CC=clang
    export CXX=clang++

    npm run build
    npm run tauri build -- --no-bundle
}

package() {
    cd "$srcdir/NaviThingy"
    install -d "$pkgdir/usr/bin"
    install -d "$pkgdir/usr/share/applications"
    install -d "$pkgdir/usr/share/icons/hicolor"

    install -m755 "src-tauri/target/release/navithingy" "$pkgdir/usr/bin/"

    cat > "$pkgdir/usr/share/applications/navithingy.desktop" <<EOF
[Desktop Entry]
Type=Application
Name=NaviThingy
Exec=env WEBKIT_DISABLE_COMPOSITING_MODE=1 /usr/bin/navithingy
Icon=navithingy
Categories=Audio;Music;
EOF

    # Install icons
    if [ -d "$srcdir/NaviThingy/static" ]; then
        install -Dm644 "$srcdir/NaviThingy/static/favicon.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/navithingy.png"
        install -Dm644 "$srcdir/NaviThingy/static/logo.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/navithingy.svg"
    fi
}

check() {
    echo "Skipping check() due to svelte-check issue."
    # cd "$srcdir/NaviThingy"
    # npm run check
}