summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b02c80a65922adc0da3340845edf3eafbbd97cdd (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
# Maintainer: Sebastian Ruziczka <aur@sebastianruziczka.de>
pkgname=budgetbutlerweb-desktop
_pkgnameshort=budgetbutlerweb
pkgver=4.2.5
pkgrel=1
pkgdesc="Simple and fast household book with offline and online functionality in German."
arch=("x86_64")
url="https://sebastianrzk.github.io/BudgetButlerWeb/"
license=('AGPL-3.0-or-later')
groups=()
depends=(electron glibc bash gcc-libs openssl)
makedepends=(git nodejs-lts-jod npm cargo glibc bash gcc-libs openssl)
checkdepends=(cargo  glibc bash gcc-libs openssl)
provides=(budgetbutlerweb budgetbutlerweb-backend)
changelog=
source=("git+https://github.com/sebastianrzk/budgetbutlerweb#tag=v$pkgver")
sha256sums=('SKIP')

prepare() {
	cd "$_pkgnameshort"
	cd application-wrapper/BudgetButlerWeb
	npm install
	cd ../..
}

build() {
	cd "$_pkgnameshort"
	cd butler_offline
	CFLAGS+=' -ffat-lto-objects' cargo build --release
	cd ..
	cd application-wrapper/BudgetButlerWeb
	npm run package
	cd ..
}

check() {
	cd "$_pkgnameshort"
	cd butler_offline
	CFLAGS+=' -ffat-lto-objects' cargo test
}

package() {
	cd "$_pkgnameshort"
	mkdir -p "${pkgdir}/usr/share/${_pkgnameshort}"
	install -d "${pkgdir}/usr/share/" "${pkgdir}/usr/bin/" "${pkgdir}/usr/lib/"

	install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${_pkgnameshort}/LICENSE"
	install -D -m644 "application-wrapper/BudgetButlerWeb/out/budgetbutlerweb-linux-x64/resources/app.asar" "${pkgdir}/usr/share/${_pkgnameshort}/app.asar"
	install -D -m644 "application-wrapper/BudgetButlerWeb/src/BBFav.png" "${pkgdir}/usr/share/${_pkgnameshort}/icon.png"

	install -D -m644 "application-wrapper/BudgetButlerWeb.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"

	install -D -m755 "butler_offline/target/release/budgetbutlerweboffline" "${pkgdir}/usr/lib/${_pkgnameshort}/budgetbutlerweb-backend"
	install -D -m755 "application-wrapper/budgetbutlerweb" "${pkgdir}/usr/lib/${_pkgnameshort}/budgetbutlerweb"

	cp -r "butler_offline/static" "${pkgdir}/usr/share/${_pkgnameshort}/"

	ln -s "/usr/lib/${_pkgnameshort}/budgetbutlerweb-backend" "${pkgdir}/usr/bin/budgetbutlerweb-backend"
	ln -s "/usr/lib/${_pkgnameshort}/budgetbutlerweb" "${pkgdir}/usr/bin/budgetbutlerweb"
}