summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fcbe5193f357b250e5cfba5fa4c78c4b97a1efa3 (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
# Maintainer: AlphaJack <alphajack at tuta dot io>

pkgname="citadel-git"
pkgver=r196.8cf1dd2
pkgrel=1
pkgdesc="Manage your ebook library without frustrations. Calibre compatible."
url="https://github.com/every-day-things/citadel"
license=("MIT")
arch=("x86_64" "aarch64" "armv7h")
provides=("citadel")
conflicts=("citadel")
depends=("webkit2gtk" "gtk3")
makedepends=("bun" "cargo")
source=("git+$url")
b2sums=("SKIP")

pkgver(){
 cd "${pkgname%-git}"
 printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

pepare(){
 cd "${pkgname%-git}"
 # explicitely build a deb package https://tauri.app/v1/guides/building/linux/#prerequisites
 sed -i "src-tauri/tauri.conf.json" \
     -e 's|"targets": .*,|"targets": ["deb"],|'
}

build(){
 cd "${pkgname%-git}"
 export RUSTUP_TOOLCHAIN=stable
 export CARGO_TARGET_DIR=target
 # install dependencies, including tauri and vite
 bun install
 # build front-end and back-end
 bun run build
}

package(){
 cd "${pkgname%-git}"
 # use the files used to bundle the .deb package
 cp -r "src-tauri/target/release/bundle/deb/"*"/data/"* "$pkgdir"
 install -D -m 664 "LICENSE" -t "$pkgdir/usr/share/licenses/citadel"
}