aboutsummaryrefslogtreecommitdiffstats
path: root/main/gtest/APKBUILD
blob: 3ad0de0619ad76e30b0a614f739c38c5953014fd (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
46
47
48
49
50
51
52
53
54
55
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=gtest
pkgver=1.11.0
pkgrel=0
pkgdesc="Google Test - C++ testing utility based on the xUnit framework (like JUnit)"
url="https://github.com/google/googletest"
arch="all"
options="!check"  # googletest-death-test-test hangs
license="BSD-3-Clause"
depends_dev="${pkgname}=$pkgver-r${pkgrel} gmock=$pkgver-r${pkgrel} cmake"
makedepends="$depends_dev python3-dev"
subpackages="$pkgname-dev gmock"
source="$pkgname-$pkgver.tar.gz::https://github.com/google/googletest/archive/release-$pkgver.tar.gz
	gtest-1.8.1-libversion.patch
	gtest-1.8.1-null-pointer.patch" # https://src.fedoraproject.org/rpms/gtest/tree/master

builddir="$srcdir"/googletest-release-$pkgver

prepare() {
	# fixup version as they are never correct
	sed -E "s|(GOOGLETEST_VERSION) [0-9\\.]+|\\1 ${pkgver}|" -i CMakeLists.txt
}

build() {
	cmake -B build . \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DPYTHON_EXECUTABLE=python3 \
		-Dgtest_build_tests=ON \
		-DBUILD_GMOCK=ON
	make -C build
}

check() {
	make -C build test
}

package() {
	make -C build DESTDIR="$pkgdir" 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="
6fcc7827e4c4d95e3ae643dd65e6c4fc0e3d04e1778b84f6e06e390410fe3d18026c131d828d949d2f20dde6327d30ecee24dcd3ef919e21c91e010d149f3a28  gtest-1.11.0.tar.gz
fd53e4a703c39cf4f1bc2eec2fac6c567e583d5e5a2ab4b52700ead77caf4f4903c4d32b8b25b983c5f650fc2b1e835fdf124b04a971705f42a707a42b34a99e  gtest-1.8.1-libversion.patch
afa75f975d8aed453c901245dae753939958d8b72e3e5c52995efe7980f44de4fd1ea08f1b0a4cc927443d858de0a1fe34a919512ce05ae443bfb9600b08f029  gtest-1.8.1-null-pointer.patch
"