aboutsummaryrefslogtreecommitdiffstats
path: root/main/gtest/APKBUILD
blob: 09282bf8c8a1971ca276534861a31aa435eae3a3 (plain) (blame)
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
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=gtest
pkgver=1.12.1
pkgrel=0
pkgdesc="Google Test - C++ testing utility based on the xUnit framework (like JUnit)"
url="https://github.com/google/googletest"
arch="all"
license="BSD-3-Clause"
depends_dev="$pkgname=$pkgver-r$pkgrel gmock=$pkgver-r$pkgrel"
makedepends="$depends_dev cmake python3-dev samurai"
subpackages="$pkgname-dev gmock"
source="$pkgname-$pkgver.tar.gz::https://github.com/google/googletest/archive/refs/tags/release-$pkgver.tar.gz"
builddir="$srcdir/googletest-release-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DPYTHON_EXECUTABLE=python3 \
		-Dgtest_build_tests=ON \
		-DBUILD_GMOCK=ON
	cmake --build build
}

check() {
	# fails of x86
	ctest --test-dir build -E "googletest-port-test"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
	find "$pkgdir" -name '*.pump' -print -delete
}

gmock() {
	pkgdesc="Google Mock - A library for writing and using C++ mock classes"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libgmock*.so* "$subpkgdir"/usr/lib/
}

sha512sums="
a9104dc6c53747e36e7dd7bb93dfce51a558bd31b487a9ef08def095518e1296da140e0db263e0644d9055dbd903c0cb69380cb2322941dbfb04780ef247df9c  gtest-1.12.1.tar.gz
"