mirror of
https://github.com/JoshiCodes/knock.git
synced 2026-12-04 15:09:41 +01:00
- macOS: universal .app/.dmg and a universal CLI binary - Windows (best effort): .msi, setup .exe and the CLI - Linux on Ubuntu 22.04 amd64: deb, rpm, AppImage with a smoke test - Tags attach everything to the GitHub release - custom-protocol feature, so a plain cargo release build embeds the frontend instead of pointing at the dev server
50 lines
1.7 KiB
Bash
50 lines
1.7 KiB
Bash
# Maintainer: Joshua <joshua at joshicodes dot de>
|
|
pkgname=knock-git
|
|
pkgver=r0
|
|
pkgrel=1
|
|
pkgdesc="Offline desktop API client for REST, GraphQL and WebSocket with plain-file collections (latest main)"
|
|
arch=('x86_64')
|
|
url="https://git.joshicodes.de/JoshiCodes/knock"
|
|
license=('MIT')
|
|
depends=('webkit2gtk-4.1' 'gtk3' 'libsecret' 'hicolor-icon-theme')
|
|
makedepends=('rust' 'cargo' 'nodejs' 'npm' 'git')
|
|
optdepends=('kwallet: store secrets in KWallet' 'gnome-keyring: store secrets in GNOME Keyring')
|
|
provides=('knock')
|
|
conflicts=('knock' 'knock-bin')
|
|
# aws-lc and sqlite are C; makepkg's LTO flags produce objects the Rust linker cannot read.
|
|
options=('!lto')
|
|
source=("knock::git+$url.git")
|
|
sha256sums=('SKIP')
|
|
|
|
pkgver() {
|
|
cd knock
|
|
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
|
}
|
|
|
|
prepare() {
|
|
cd knock
|
|
export RUSTUP_TOOLCHAIN=stable
|
|
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
|
|
npm ci
|
|
}
|
|
|
|
build() {
|
|
cd knock
|
|
export RUSTUP_TOOLCHAIN=stable
|
|
npm run build
|
|
cargo build --frozen --release -p knock-app -p knock-cli --features knock-app/custom-protocol
|
|
}
|
|
|
|
package() {
|
|
cd knock
|
|
install -Dm755 target/release/knock-app "$pkgdir/usr/bin/knock-app"
|
|
install -Dm755 target/release/knock "$pkgdir/usr/bin/knock"
|
|
install -Dm644 packaging/linux/knock-app.desktop "$pkgdir/usr/share/applications/knock-app.desktop"
|
|
install -Dm644 logo/knock-app-icon.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/knock-app.svg"
|
|
for s in 32 128; do
|
|
install -Dm644 "src-tauri/icons/${s}x${s}.png" "$pkgdir/usr/share/icons/hicolor/${s}x${s}/apps/knock-app.png"
|
|
done
|
|
install -Dm644 src-tauri/icons/[email protected] "$pkgdir/usr/share/icons/hicolor/256x256/apps/knock-app.png"
|
|
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
|
}
|