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

pkgname=libmatio-cpp
pkgver=0.1.1
pkgrel=1
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=('cmake')
checkdepends=('catch2')
provides=("$pkgname")
conflicts=("$pkgname-git")
replaces=()
backup=()
options=()
install=
source=("libmatio-cpp-${pkgver}.tar.gz::https://github.com/dic-iit/matio-cpp/archive/v${pkgver}.tar.gz")
noextract=()
sha256sums=('8c52ccb08ef31311161eb0f2e348a4d0a170a4b18e1232ff974cf6514a72a706')

prepare() {
	cd "$srcdir"
	mv matio-cpp-"$pkgver" "$pkgname-$pkgver"
}

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

check() {
	cd "$pkgname-$pkgver"
	cmake -B build_testing -S . -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 "$pkgname-$pkgver/build"
	make DESTDIR="$pkgdir/" install
	install -Dm644 "$srcdir/$pkgname-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}