aboutsummaryrefslogtreecommitdiffstats
path: root/main/gtest/APKBUILD
blob: 63c701bc0a7c75f3bc802e0bb6e413017211e829 (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
52
53
54
55
56
57
58
59
60
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=gtest
pkgver=1.8.1
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=""
makedepends="python2-dev cmake"
install=""
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() {
	cd "$builddir"
	# fixup version as they are never correct
	sed -E "s|(GOOGLETEST_VERSION) [0-9\\.]+|\\1 ${pkgver}|" -i CMakeLists.txt
}

build() {
	cd "$builddir"
	mkdir build
	cd build

	cmake -DCMAKE_INSTALL_PREFIX=/usr \
	      -DCMAKE_INSTALL_LIBDIR=lib \
	      -DBUILD_SHARED_LIBS=ON \
	      -DPYTHON_EXECUTABLE=python2 \
	      -Dgtest_build_tests=ON \
	      ..
	make
}

check() {
	cd "$builddir"/build
	make test
}

package() {
	cd "$builddir"

	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="e6283c667558e1fd6e49fa96e52af0e415a3c8037afe1d28b7ff1ec4c2ef8f49beb70a9327b7fc77eb4052a58c4ccad8b5260ec90e4bceeac7a46ff59c4369d7  gtest-1.8.1.tar.gz
fd53e4a703c39cf4f1bc2eec2fac6c567e583d5e5a2ab4b52700ead77caf4f4903c4d32b8b25b983c5f650fc2b1e835fdf124b04a971705f42a707a42b34a99e  gtest-1.8.1-libversion.patch
afa75f975d8aed453c901245dae753939958d8b72e3e5c52995efe7980f44de4fd1ea08f1b0a4cc927443d858de0a1fe34a919512ce05ae443bfb9600b08f029  gtest-1.8.1-null-pointer.patch"