summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8aee53626281aa3a69de47e2e6d3a17224ac9e58 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Maintainer: Tulpenkiste <tulpenkiste at the amogus email domain which is .cloud>
_pkgname=brux-gdk
pkgname=brux-gdk-git
pkgver=0.2.11.r214.g5f68dac
pkgrel=3
pkgdesc="A free runtime and development kit using SDL and Squirrel"

arch=('x86_64' 'riscv64' 'aarch64' 'i686' 'riscv32' 'armv7h')

url="https://github.com/KelvinShadewing/brux-gdk"
license=('AGPL-3.0-only')

depends=(
	'physfs'
	'sdl2'
	'sdl2_gfx'
	'sdl2_image'
	'sdl2_mixer'
	'sdl2_net'
)

makedepends=(
	'base-devel'
	'cmake'
	'git'
)

provides=("brux-gdk")
conflicts=("brux-gdk")

source=("$_pkgname::git+$url.git#branch=unstable")
sha256sums=('SKIP')

pkgver() {
	cd "$_pkgname/rte"

	local tag
	tag=$(git describe --tags --abbrev=0)

	# Get the number of commits since the last tag
	local commits
	commits=$(git rev-list "${tag}..HEAD" --count)

	# Get the current commit hash (abbreviated)
	local commit_hash
	commit_hash=$(git rev-parse --short HEAD)

	# Remove the 'v' prefix if it exists
	tag=${tag#v}

	# Construct the version string
	echo "${tag}.r${commits}.g${commit_hash}"
}

prepare() {
	cd "$_pkgname/rte"
	git submodule update --init --recursive
}

build() {
	cmake -B build -S $_pkgname/rte -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release

	cmake --build build
}

package() {
	cmake --install build

	if [ "$pkgdir" != "" ]; then
		rm -rf "$pkgdir/home"
	fi

	install -Dm755 build/brux "$pkgdir/usr/bin/brux"
}