archrelease: copy trunk to community-any
[ArchLinux/community.git] / gtest / repos / community-x86_64 / PKGBUILD
blobdedcdae1e629ed74aed6a5df347c340e7b9efa2a
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>
9 pkgname=gtest
10 pkgver=1.13.0
11 pkgrel=1
12 pkgdesc='Google Test - C++ testing utility'
13 url='https://github.com/google/googletest'
14 arch=('x86_64')
15 license=('BSD')
16 depends=('gcc-libs' 'sh')
17 makedepends=('python' 'cmake' 'gcc-libs' 'sh')
18 optdepends=('python: gmock generator')
19 conflicts=('gmock')
20 replaces=('gmock')
21 provides=('gmock')
22 _srcname=googletest-${pkgver}
23 source=(${_srcname}.tar.gz::https://github.com/google/googletest/archive/v${pkgver}.tar.gz
24         gtest-version.patch)
25 sha512sums=('70c0cfb1b4147bdecb467ecb22ae5b5529eec0abc085763213a796b7cdbd81d1761d12b342060539b936fa54f345d33f060601544874d6213fdde79111fa813e'
26             'ebfd53ac33298e870c04a1f89609d8327152d3d73e7842219af3a11d5ee484033543064b557cc9c8f45057e608e0ee347318070a3ea5d17040bace02110ed8df')
28 prepare() {
29   cd ${_srcname}
30   sed "s|__GOOGLETEST_VERSION__|${pkgver}|g" -i ../gtest-version.patch
31   patch -Np1 -i ../gtest-version.patch
34 build() {
35  cmake -H${_srcname} -Bbuild \
36     -DCMAKE_INSTALL_PREFIX=/usr \
37     -DBUILD_SHARED_LIBS=ON \
38     -Dgtest_build_tests=ON
39   cmake --build build
42 check() {
43   cmake --build build --target test
46 package() {
47   DESTDIR="${pkgdir}" cmake --build build --target install
49   # Shouldn't be present
50   find "${pkgdir}" -name '*.pump' -printf 'Removing %P\n' -delete
52   cd ${_srcname}
53   install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
54   install -Dm 644 README.md CONTRIBUTORS -t "${pkgdir}/usr/share/doc/${pkgname}"
56   cd googletest
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"
61   cd ../googlemock
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"
72 # vim: ts=2 sw=2 et: