summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e442aed10b178ddb32bf4b278b92ac368aae0a7b (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
# Maintainer: Lina Roether <lina.roether@proton.me>

pkgname=niji-git
pkgver=0.1.0
pkgrel=2
pkgdesc="A customizable tool for theming linux systems"
url="https://github.com/lina-roether/niji"
arch=("x86_64" "i686" "arm" "armv6h" "armv7h" "aarch64")
license=("GPL-3.0")
makedepends=("cargo" "git")
provides=("niji")
conflicts=("niji")
source=("git+${url}.git"
        "git+https://github.com/vinceliuice/Colloid-gtk-theme.git")
md5sums=("SKIP" "SKIP")

pkgver() {
	cd niji
    git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
	cd niji
	git submodule init
	git config submodule.colloid.url "$srcdir/Colloid-gtk-theme"
	git -c protocol.file.allow=always submodule update
	cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
	cd niji
	export RUST_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --frozen --release
}

package() {
	cd niji

	# Install binary
	install -Dm755 target/release/niji -t "$pkgdir/usr/bin"

	# Install modules and themes
	mkdir -p "$pkgdir/usr/share/niji"
	cp -a assets/modules "$pkgdir/usr/share/niji/"
	cp -a assets/themes "$pkgdir/usr/share/niji/"
}