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

pkgname="citadel-git"
pkgver=r201.0ec173e
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")
optdepends=("calibre: initialize ebook library")
source=("git+$url")
b2sums=("SKIP")

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

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, limiting the targets to a .deb package
 bun run build --bundles deb
}

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"
}