summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 10d704655382a5d89f0d0ac1f0868b378bd6a367 (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
# Maintainer: AtticFinder65536 <atticventilation-aur at protonmail dot com>

pkgname=('undither-rs-git')
_gitname=('undither')
pkgver=0.2.r15.g95755d0
pkgrel=1
pkgdesc="Smart filter to remove Floyd-Steinberg dithering from paletted images (git)"
url="https://github.com/kornelski/undither"
license=('GPL3')
source=('git+https://github.com/kornelski/undither.git')
b2sums=('SKIP')
arch=('any')
makedepends=('cargo' 'git')
provides=('undither-rs')
conflicts=('undither-rs')
options=('!strip')

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

prepare() {
	cd "${_gitname}"
	cargo update
	cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
	cd "${_gitname}"
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --frozen --release --all-features
}

check() {
	cd "${_gitname}"
	export RUSTUP_TOOLCHAIN=stable
	cargo test --frozen --all-features
}

package(){
	cd "${_gitname}"
	install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$_gitname"
}