summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4b030a605712ca0c3a444b5dce4ef563589d7837 (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: Camille 'DrasLorus' Monière <draslorus@draslorus.fr>

pkgname=libmatio-cpp-git
pkgver=r170.960ed1b
pkgrel=2
pkgdesc="A C++ wrapper of the matio library, with memory ownership handling."
arch=('x86_64')
url="https://github.com/dic-iit/matio-cpp"
license=('BSD')
groups=()
depends=('libmatio')
makedepends=('git'
	'cmake')
checkdepends=('catch2')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
replaces=()
backup=()
options=()
install=
source=('libmatio-cpp::git+https://github.com/dic-iit/matio-cpp')
noextract=()
md5sums=('SKIP')

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

build() {
	cmake -B build -S "${pkgname%-git}" -DCMAKE_BUILD_TYPE=None \
		-Wno-dev \
		-DCMAKE_GENERATOR="Unix Makefiles" \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build -j
}

check() {
	cmake -B build_testing -S "${pkgname%-git}" -DCMAKE_BUILD_TYPE=None \
		-Wno-dev \
		-DCMAKE_GENERATOR="Unix Makefiles" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_TESTING=ON
	cmake --build build_testing -j
	cd build_testing && ctest 
}

package() {
	cd "$srcdir/build"
	make DESTDIR="$pkgdir/" install
	install -Dm644 "$srcdir/${pkgname%-git}/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}