summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 09a58abf74c94f975db909871ce25e8781825f8a (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
# Maintainer: Alexandre Bouvier <contact@amb.tf>
# Contributor: katt <magunasu.b97@gmail.com>
_pkgname=librw
pkgname=$_pkgname-git
pkgver=r557.05db81b
pkgrel=1
pkgdesc="A re-implementation of the RenderWare Graphics engine"
arch=('aarch64' 'armv7h' 'i486' 'i686' 'pentium4' 'x86_64')
url="https://github.com/aap/librw"
license=('MIT')
depends=('gcc-libs' 'glfw>=3.3.7' 'glibc')
makedepends=('cmake' 'git')
provides=("$_pkgname=${pkgver#r}" 'librw.so')
conflicts=("$_pkgname")
source=("$_pkgname::git+$url.git")
b2sums=('SKIP')

pkgver() {
	cd $_pkgname
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
	cmake -S $_pkgname -B build \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
		-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DLIBRW_GL3_GFXLIB=GLFW \
		-DLIBRW_PLATFORM=GL3 \
		-DLIBRW_TOOLS=OFF \
		-Wno-dev
	cmake --build build
}

package() {
	# shellcheck disable=SC2154
	DESTDIR="$pkgdir" cmake --install build
	install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname $_pkgname/LICENSE
}