summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b12333b31a877500df0895f58c4b151b8cc8f1a5 (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
# Maintainer: Michał Janiszewski <janisozaur+aur@gmail.com>
# Contributor: Philipp Claßen <philipp.classen@posteo.de>

pkgname=lib32-benchmark
pkgver=1.5.0
pkgrel=1
pkgdesc="A microbenchmark support library, by Google (32-bit)"
arch=('x86_64')
url="https://github.com/google/benchmark"
license=('Apache')
depends=('lib32-gcc-libs')
makedepends=('cmake' 'gcc-multilib')

source=("https://github.com/google/benchmark/archive/v${pkgver}.tar.gz")
sha256sums=('3c6a165b6ecc948967a1ead710d4a181d7b0fbcaa183ef7ea84604994966221a')

prepare() {
  cd "${srcdir}/benchmark-${pkgver}"

  mkdir -p build && cd build

  export CFLAGS="-m32 ${CFLAGS}"
  export CXXFLAGS="-m32 ${CXXFLAGS}"
  export LDFLAGS="-m32 ${LDFLAGS}"
  export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'

  cmake .. -DCMAKE_BUILD_TYPE="Release" \
           -DCMAKE_INSTALL_PREFIX=/usr \
           -DCMAKE_INSTALL_LIBDIR=lib32 \
           -DBUILD_SHARED_LIBS=ON \
           -DBENCHMARK_ENABLE_LTO=ON \
           -DBENCHMARK_ENABLE_INSTALL=ON \
           -DBENCHMARK_ENABLE_GTEST_TESTS=OFF
}

build() {
  cd "${srcdir}/benchmark-${pkgver}/build"
  make
}

package() {
  cd "${srcdir}/benchmark-${pkgver}/build"
  make DESTDIR="$pkgdir/" install
  rm -rf "$pkgdir"/usr/{include,lib,share}
}