summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d31861b9ae9031ac70a97b943a6c4e22c5bf8970 (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
# Maintainer: Daniele Moser <dnlmsr0@gmail.com>

_pkgname="cpputest"
pkgname="${_pkgname}-git"
pkgver=4.0.r674.g81eb8b8
pkgrel=2
pkgdesc="Unit testing and mocking framework for C/C++"
arch=("x86_64")
url="https://github.com/cpputest/cpputest"
license=("BSD")
makedepends=("cmake" "git")
options=(
	!strip
	staticlibs
)
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=("${_pkgname}::git+${url}.git")
sha512sums=('SKIP')

pkgver() {
	cd "${srcdir}/${_pkgname}"
	printf "%s" "$(git describe --long --tags --abbrev=7 --exclude latest* | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')"
}

build() {
	cd "${srcdir}/${_pkgname}"
	local cmake_options=(
		-B build
		-D CMAKE_BUILD_TYPE=None
		-D CMAKE_INSTALL_PREFIX=/usr
		-D LONGLONG=ON
		-D C++11=ON
		-S .
		-W no-dev
	)

	cmake "${cmake_options[@]}"
	cmake --build build
}

check() {
	cd "${srcdir}/${_pkgname}"
	ctest --test-dir build --output-on-failure
}

package() {
	cd "${srcdir}/${_pkgname}"
	DESTDIR="${pkgdir}" cmake --install build
	install -vDm 644 ./COPYING -t "${pkgdir}/usr/share/licenses/${_pkgname}/"
}