summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5e05cc4267989cc8753da995370ccad73e22be37 (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
# Maintainer: hoornet <hoornet@users.noreply.github.com>
pkgname=vega-nostr-git
pkgver=0.16.4
pkgrel=1
pkgdesc="Cross-platform Nostr desktop client with Lightning integration"
arch=('x86_64')
url="https://github.com/hoornet/vega"
license=('MIT')
depends=(
    'webkit2gtk-4.1'
    'gtk3'
    'libayatana-appindicator'
    'openssl'
    'gst-plugins-base'
    'gst-plugins-good'
    'gst-libav'
)
makedepends=(
    'rust'
    'nodejs'
    'npm'
    'git'
)
optdepends=(
    'gnome-keyring: persistent key storage (any Secret Service provider works)'
    'kwallet: Secret Service provider on KDE'
)
provides=('vega-nostr')
conflicts=('vega-nostr')
options=('!debug')
source=("$pkgname::git+https://github.com/hoornet/vega.git")
sha256sums=('SKIP')

pkgver() {
    cd "$pkgname"
    git describe --tags --long 2>/dev/null | sed 's/^v//;s/-/.r/;s/-/./' || echo "$pkgver"
}

build() {
    cd "$pkgname"
    # Reset makepkg flags — they interfere with Rust cc crate
    # compiling bundled SQLite and Ring assembly
    unset CFLAGS CXXFLAGS LDFLAGS

    # `npm ci --ignore-scripts`, never `npm install` — this mirrors
    # .github/workflows/release.yml. `install` re-resolves inside the caret
    # ranges, so a compromised patch release could reach a user's build
    # without ever appearing in the reviewed lockfile, and postinstall
    # scripts run as the building user. This package builds on the user's
    # own machine, so that gap is theirs, not CI's.
    npm ci --ignore-scripts

    # Tells Vega who built it, so the update banner names this package's
    # own update command instead of guessing `yay -S vega-nostr-git` for
    # every pacman install.
    export VEGA_PACKAGED_BY=aur-git

    # `-- --locked` forwards to cargo (the Tauri CLI passes trailing args
    # through). Cargo's equivalent of `npm ci`: refuse to re-resolve, fail
    # instead of silently building a lockfile nobody reviewed.
    npx tauri build --no-bundle -- --locked
}

package() {
    cd "$pkgname"

    install -Dm755 "src-tauri/target/release/vega" \
        "$pkgdir/usr/bin/vega"

    # Strip build paths from binary (fixes $srcdir reference warning)
    strip --strip-unneeded "$pkgdir/usr/bin/vega"

    # Icons
    install -Dm644 "src-tauri/icons/32x32.png" \
        "$pkgdir/usr/share/icons/hicolor/32x32/apps/vega.png"
    install -Dm644 "src-tauri/icons/128x128.png" \
        "$pkgdir/usr/share/icons/hicolor/128x128/apps/vega.png"
    install -Dm644 "src-tauri/icons/128x128@2x.png" \
        "$pkgdir/usr/share/icons/hicolor/256x256/apps/vega.png"

    # Desktop entry
    install -Dm644 /dev/stdin \
        "$pkgdir/usr/share/applications/vega.desktop" << 'EOF'
[Desktop Entry]
Name=Vega
Comment=Nostr desktop client
Exec=env WEBKIT_DISABLE_DMABUF_RENDERER=1 /usr/bin/vega
Icon=vega
Type=Application
Categories=Network;InstantMessaging;
StartupNotify=true
EOF

    install -Dm644 "LICENSE" \
        "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}