aboutsummaryrefslogtreecommitdiffstats
path: root/main/gtest/APKBUILD
blob: 1a811261eb3c5ec5b0db58121b7b2a467b260c78 (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
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=gtest
pkgver=1.11.0_git20220205
pkgrel=2
_githash="14aa11db02d9851d957f93ef9fddb110c1aafdc6"
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/$_githash.tar.gz"

builddir="$srcdir/googletest-$_githash"

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="
d0b0c60c051fb2a42dfd94a9053b76b22f8481305d0953f0d357c83d945c3868a8134a8fb490a90bd177744ea490ce4d4e8f8e58896c22e145f64b2b197c11c9  gtest-1.11.0_git20220205.tar.gz
"