summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 37ea5e04860ab89b365aabadee806d1d45087614 (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
# Maintainer: HaroldLoui<Riven970309@gmail.com>
pkgname=minesweeper-tauri-git
base=minesweeper-tauri
pkgver=v0.2.0.r3.g8f84694
pkgrel=1
pkgdesc="A minesweeper game follow windowsXP style based on tauri."
arch=('x86_64' 'aarch64')
url="https://github.com/HaroldLoui/minesweeper-tauri"
license=('custom')
depends=('git' 'webkit2gtk' 'libappindicator-gtk3')
makedepends=('cargo-tauri' 'jq' 'rust' 'moreutils')
optdepends=('appmenu-gtk-module: Application Menu GTK+ Module')
source=(
    "${base}-${pkgver}-git::git+${url}"
    "${base}.desktop"
)

sha256sums=(
    'SKIP'
    '5608145f8050f7794bfd32c9016d2d2f6e0c39cf90e2f244feead154ceca3e60'
)

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

prepare(){
	cd $srcdir/${base}-${pkgver}-git

	cd src-tauri
	# only build the excutable
	jq '.tauri.bundle.active = false' tauri.conf.json|sponge tauri.conf.json
	# disable updater
	jq '.tauri.updater.active = false' tauri.conf.json|sponge tauri.conf.json
}

build(){
	cd $srcdir/${base}-${pkgver}-git
	cargo-tauri build
}

package(){
	cd $srcdir/${base}-${pkgver}-git
	install -Dm755 src-tauri/target/release/minesweeper -t ${pkgdir}/usr/bin/
	mv ${pkgdir}/usr/bin/minesweeper ${pkgdir}/usr/bin/minesweeper-tauri

	# Icons
	install -Dm644 src-tauri/icons/icon.png ${pkgdir}/usr/share/icons/${base}.png
	for i in 32x32 128x128; do
		install -Dm644 src-tauri/icons/${i}.png \
			"$pkgdir"/usr/share/icons/hicolor/$i/apps/${base}.png
	done

	install -Dm644 ${srcdir}/${base}.desktop -t ${pkgdir}/usr/share/applications
}