summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 33ac3ccbc3bc20b227cb60a692a583d11aad4fbb (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
# Maintainer: Caleb Maclennan <caleb@alerque.com>

_pkgname=glif
pkgname=mfek-$_pkgname-git
pkgver=1.1.0b2.r8.gc4f7fb0
pkgrel=2
pkgdesc='A stand-alone glyph viewer and editor (from Modular Font Editor K)'
arch=(x86_64)
url="https://github.com/MFEK/$_pkgname"
license=(Apache)
depends=(gtk3
         libxcb
         sdl2)
makedepends=(cargo
             cmake
             git
             python)
optdepends=('mfek-metadata: read and write font metadata')
provides=("${pkgname%-git}=$pkgver")
conflicts=("${pkgname%-git}")
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

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

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

build() {
	cd "$pkgname"
	export CARGO_TARGET_DIR=target
	cargo build --frozen --release --no-default-features
}

check() {
	cd "$pkgname"
	cargo test --frozen --no-default-features
}

package() {
	cd "$pkgname"
	install -Dm0755 "target/release/MFEK$_pkgname" "$pkgdir/usr/bin/${pkgname%-git}"
}