aboutsummaryrefslogtreecommitdiffstats
path: root/main/gtest/APKBUILD
blob: 62d78346ef5f928ea8d8588ea003237838ce5b35 (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
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=gtest
pkgver=1.10.0
pkgrel=1
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
	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="bd52abe938c3722adc2347afad52ea3a17ecc76730d8d16b065e165bc7477d762bce0997a427131866a89f1001e3f3315198204ffa5d643a9355f1f4d0d7b1a9  gtest-1.10.0.tar.gz
fd53e4a703c39cf4f1bc2eec2fac6c567e583d5e5a2ab4b52700ead77caf4f4903c4d32b8b25b983c5f650fc2b1e835fdf124b04a971705f42a707a42b34a99e  gtest-1.8.1-libversion.patch
afa75f975d8aed453c901245dae753939958d8b72e3e5c52995efe7980f44de4fd1ea08f1b0a4cc927443d858de0a1fe34a919512ce05ae443bfb9600b08f029  gtest-1.8.1-null-pointer.patch"