# Maintainer: Baptiste Jonglez <archlinux at bitsofnetworks dot org>
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Bart Verhagen <barrie.verhagen at gmail dot com>
pkgname=catch2-v2
_gitcommit=182c910b4b63ff587a3440e08f84f70497e49a81
pkgver=2.13.10
pkgrel=2
pkgdesc="Modern, C++-native, header-only, test framework for unit-tests, TDD and BDD"
arch=('any')
url="https://github.com/catchorg/catch2"
license=('Boost')
makedepends=('git' 'cmake' 'python') # python seems to be necessary for building tests (FS#60273)
conflicts=('catch2')
source=(${pkgname/-v2}::"git+https://github.com/catchorg/Catch2#commit=${_gitcommit}?signed")
sha512sums=('SKIP')
validpgpkeys=(
E29C46F3B8A7502860793B7DECC9C20E314B2360 # Martin Hořeňovský
81E70B717FFB27AFDB45F52090BBFF120F9C087B # Jozef Grajciar
)
pkgver() {
cd ${pkgname/-v2}
git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
build() {
cd ${pkgname/-v2/}
# our recent default flags break test 14 (ApprovalTests)
unset CXXFLAGS
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCATCH_USE_VALGRIND=OFF \
-DCATCH_BUILD_EXAMPLES=OFF \
-DCATCH_ENABLE_COVERAGE=OFF \
-DCATCH_ENABLE_WERROR=OFF \
-DBUILD_TESTING=ON
make -C build
}
check() {
cd ${pkgname/-v2}
make -C build test
}
package() {
cd ${pkgname/-v2}
make -C build DESTDIR="$pkgdir" install
}
# vim: ts=2 sw=2 et: