1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
3 # Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
4 # Contributor: Alexandre Bique <bique.alexandre@gmail.com>
5 # Contributor: Louis R. Marascio <lrm@fitnr.com>
6 # Contributor: Cody Maloney <cmaloney@theoreticalchaos.com>
7 # Contributor: acxz <akashpatel2008 at yahoo dot com>
12 pkgdesc='Google Test - C++ testing utility'
13 url='https://github.com/google/googletest'
16 depends=('gcc-libs' 'sh')
17 makedepends=('python' 'cmake' 'gcc-libs' 'sh')
18 optdepends=('python: gmock generator')
22 _srcname=googletest-${pkgver}
23 source=(${_srcname}.tar.gz::https://github.com/google/googletest/archive/v${pkgver}.tar.gz
25 sha512sums=('70c0cfb1b4147bdecb467ecb22ae5b5529eec0abc085763213a796b7cdbd81d1761d12b342060539b936fa54f345d33f060601544874d6213fdde79111fa813e'
26 'ebfd53ac33298e870c04a1f89609d8327152d3d73e7842219af3a11d5ee484033543064b557cc9c8f45057e608e0ee347318070a3ea5d17040bace02110ed8df')
30 sed "s|__GOOGLETEST_VERSION__|${pkgver}|g" -i ../gtest-version.patch
31 patch -Np1 -i ../gtest-version.patch
35 cmake -H${_srcname} -Bbuild \
36 -DCMAKE_INSTALL_PREFIX=/usr \
37 -DBUILD_SHARED_LIBS=ON \
38 -Dgtest_build_tests=ON
43 cmake --build build --target test
47 DESTDIR="${pkgdir}" cmake --build build --target install
49 # Shouldn't be present
50 find "${pkgdir}" -name '*.pump' -printf 'Removing %P\n' -delete
53 install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
54 install -Dm 644 README.md CONTRIBUTORS -t "${pkgdir}/usr/share/doc/${pkgname}"
57 install -Dm 644 cmake/* -t "${pkgdir}/usr/src/googletest/cmake"
58 install -Dm 644 src/* -t "${pkgdir}/usr/src/googletest/src"
59 install -Dm 644 CMakeLists.txt -t "${pkgdir}/usr/src/googletest"
62 install -Dm 644 cmake/* -t "${pkgdir}/usr/src/gmock/cmake"
63 install -Dm 644 src/* -t "${pkgdir}/usr/src/gmock/src"
64 install -Dm 644 CMakeLists.txt -t "${pkgdir}/usr/src/gmock"
66 sed -i 's|src/||' "${pkgdir}/usr/src/gmock/src/gmock-all.cc"
68 python -m compileall -d /usr/share/gmock "${pkgdir}/usr/share/gmock"
69 python -O -m compileall -d /usr/share/gmock "${pkgdir}/usr/share/gmock"