archrelease: copy trunk to community-any
[arch-community.git] / rapidcheck / trunk / PKGBUILD
blob1965e897291d5fc71831752b4afbb90a8593a085
1 # Maintainer: Caleb Maclennan <caleb@alerque.com>
2 # Contributor: Bart Verhagen <bart at verhagenconsultancy dot be>
4 # Upstream has no tags or release versioning, see:
5 # https://github.com/emil-e/rapidcheck/issues/255
6 # Commit here was picked based on what works to build nix.
7 # https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/rapidcheck/default.nix
8 _commit=b78f89288c7e086d06e2a1e10b605d8375517a8a
10 pkgname=rapidcheck
11 pkgver=r1010.b78f892
12 pkgrel=1
13 pkgdesc='QuickCheck clone for C++'
14 arch=(x86_64 aarch64 i686 arm armv6h armv7h)
15 url="https://github.com/emil-e/$pkgname"
16 license=(BSD)
17 makedepends=(cmake
18              git)
19 options=(!lto)
20 source=("git+$url.git#commit=$_commit")
21 sha256sums=('SKIP')
23 prepare() {
24         cd "$pkgname"
25         mkdir -p build
28 pkgver() {
29         cd "$pkgname"
30         printf "r%s.%s" \
31                 "$(git rev-list --count HEAD)" \
32                 "$(git rev-parse --short=7 HEAD)"
35 build() {
36         cd "$pkgname"
37         cmake \
38                 -G "Unix Makefiles" \
39                 -D CMAKE_BUILD_TYPE=Release \
40                 -D CMAKE_INSTALL_PREFIX="$pkgdir/usr/" \
41                 -D CMAKE_POSITION_INDEPENDENT_CODE=True \
42                 -D RC_ENABLE_EXAMPLES=Off \
43                 -D RC_ENABLE_TESTS=Off \
44                 -D RC_INSTALL_ALL_EXTRAS=On \
45                 -B build
46         make -C build all
49 check() {
50         cd "$pkgname"
51         cmake \
52                 -G "Unix Makefiles" \
53                 -D CMAKE_POSITION_INDEPENDENT_CODE=True \
54                 -D RC_ENABLE_EXAMPLES=On \
55                 -B build
56         make -C build counter
57         build/examples/counter/counter
60 package_rapidcheck() {
61         cd "$pkgname"
62         cmake -P "build/cmake_install.cmake"
63         install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE.md