summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b0a0b5b9a33b39f553cce6cec7d02854823a5373 (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
# Maintainer: Otreblan <otreblain@gmail.com>

pkgname=leafish-git
pkgver=r207.b3b467c
pkgrel=1
pkgdesc="Multi-version Minecraft-compatible client written in Rust."
arch=('x86_64')
url="https://github.com/Lea-fish/Leafish"
license=('APACHE')
groups=()
depends=('libxcb' 'openssl')
makedepends=('cargo' 'git' 'desktop-file-utils')
checkdepends=()
optdepends=()
provides=(${pkgname%-git})
conflicts=(${pkgname%-git})
source=("$pkgname::git+$url.git" "leafish.desktop")
sha256sums=(
	'SKIP'
	'c9de3b7a74ba7ec863809d23dc61f44e744eddb98ba66f2c0f946081215dfd91'
)

pkgver() {
	cd "$srcdir/$pkgname"
	( set -o pipefail
	git describe --tags --long 2>/dev/null | sed 's/^v-//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
	)
}

prepare() {
	cd "$srcdir/$pkgname"

	cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
	cd "$srcdir/$pkgname"

	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --frozen --release --all-features
}

package() {
	desktop-file-install -m 644 --dir "$pkgdir/usr/share/applications/" "leafish.desktop"

	cd "$srcdir/$pkgname"

	install -Dm755 "target/release/${pkgname%-git}" -t "$pkgdir/usr/bin"
	install -Dm644 "resources/assets/leafish/logo/leafish-logo.svg" -t "$pkgdir/usr/share/pixmaps"
}