summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b1ca7fb6c79ad957f2aa826d6ee31f149a5f9da9 (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
# Maintainer: Sebastian Ruziczka <aur@sebastianruziczka.de>
pkgname=looksyk-desktop
_pkgnameshort=looksyk
pkgver=1.4.6
pkgrel=1
pkgdesc="A markdown centric, fast and local personal knowledge platform"
arch=("x86_64")
url="https://sebastianrzk.github.io/Looksyk"
license=('AGPL-3.0-or-later')
groups=()
depends=(electron glibc bash gcc-libs)
makedepends=(git nodejs-lts-jod npm cargo glibc bash gcc-libs)
checkdepends=(cargo glibc gcc-libs)
provides=(looksyk looksyk-backend)
changelog=
source=("git+https://github.com/sebastianrzk/looksyk#tag=v$pkgver")
sha256sums=('SKIP')

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

build() {
	cd "$_pkgnameshort"
	cd backend
	CFLAGS+=' -ffat-lto-objects' cargo build --release
	cd ..
	cd frontend/looksyk
	npm run build --configuration=production
	cd ../..
	cd application-wrapper/Looksyk
	npm run package
	cd ..
}

check() {
	cd "$_pkgnameshort"
	cd backend
	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"

	cp -r "frontend/looksyk/dist/looksyk/browser/" "${pkgdir}/usr/share/${_pkgnameshort}/static/"
	install -D -m644 "application-wrapper/Looksyk/out/looksyk-linux-x64/resources/app.asar" "${pkgdir}/usr/share/${_pkgnameshort}/app.asar"
	install -D -m644 "icon/Looksyk-scaled.png" "${pkgdir}/usr/share/${_pkgnameshort}/icon.png"

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

	install -D -m755 "backend/target/release/looksyk" "${pkgdir}/usr/lib/${_pkgnameshort}/looksyk-backend"
	install -D -m755 "application-wrapper/looksyk" "${pkgdir}/usr/lib/${_pkgnameshort}/looksyk"
	
	ln -s "/usr/lib/${_pkgnameshort}/looksyk-backend" "${pkgdir}/usr/bin/looksyk-backend"
	ln -s "/usr/lib/${_pkgnameshort}/looksyk" "${pkgdir}/usr/bin/looksyk"
}