summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d97859c52044e03b545d29a3f2d56400e9cb7805 (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
# Maintainer: Alexandre Bouvier <contact@amb.tf>
_pkgname=luabridge
pkgname=$_pkgname-git
pkgver=2.8.r6.g6580b18
pkgrel=1
pkgdesc="A lightweight, dependency-free library for binding Lua to C++"
arch=('any')
url="https://github.com/vinniefalco/LuaBridge"
license=('MIT')
makedepends=('cmake' 'git')
checkdepends=('gtest')
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
source=("$_pkgname::git+$url.git")
b2sums=('SKIP')

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

build() {
	cmake -S $_pkgname -B build \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DLUABRIDGE_TESTING="$CHECKFUNC" \
		-Wno-dev
	cmake --build build
}

check() {
	ctest --test-dir build
}

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