* add criterion

This commit is contained in:
Alexander Baldeck 2024-11-25 08:56:44 +01:00
parent ae4e95d469
commit 760e65e5d2
3 changed files with 83 additions and 0 deletions

21
criterion/.SRCINFO Normal file
View File

@ -0,0 +1,21 @@
pkgbase = criterion
pkgdesc = A cross-platform C and C++ unit testing framework for the 21st century
pkgver = 2.4.2
pkgrel = 3
url = https://github.com/Snaipe/Criterion
arch = x86_64
arch = riscv64
license = MIT
checkdepends = python-cram
makedepends = cmake
makedepends = git
makedepends = meson
depends = glibc
depends = libffi
depends = libgit2
depends = nanomsg
options = !lto
source = criterion-2.4.2.tar.gz::https://github.com/Snaipe/Criterion/archive/v2.4.2.tar.gz
sha256sums = 83e1a39c8c519fbef0d64057dc61c8100b3a5741595788c9f094bba2eeeef0df
pkgname = criterion

View File

@ -0,0 +1,5 @@
[criterion]
source = "git"
git = "https://github.com/Snaipe/Criterion"
prefix = "v"
include_regex = '^v\d+\.\d+\.\d+$'

57
criterion/PKGBUILD Normal file
View File

@ -0,0 +1,57 @@
# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Contributor: László Várady <laszlo.varady93@gmail.com>
# Contributor: Snaipe
pkgname=criterion
_pkgname=Criterion
pkgver=2.4.2
pkgrel=3
pkgdesc="A cross-platform C and C++ unit testing framework for the 21st century"
arch=(x86_64 riscv64)
url="https://github.com/Snaipe/Criterion"
license=(MIT)
depends=(
glibc
libffi
libgit2
nanomsg
)
makedepends=(
cmake
git
meson
)
checkdepends=(python-cram)
options=(!lto)
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('83e1a39c8c519fbef0d64057dc61c8100b3a5741595788c9f094bba2eeeef0df')
prepare() {
cd $_pkgname-$pkgver
# Use system packages for these instead.
rm -v \
subprojects/libffi.wrap \
subprojects/libgit2-cmake.wrap \
subprojects/nanomsg-cmake.wrap
# Download of nanopb produces an error as it does not contain a meson.build
# file. A meson.build file is not necessary, so ignore the error.
meson subprojects download || :
}
build() {
cd $_pkgname-$pkgver
arch-meson build
meson compile -C build
}
check() {
cd $_pkgname-$pkgver
meson test -C build --print-errorlogs
}
package() {
cd $_pkgname-$pkgver
meson install -C build --destdir "$pkgdir"
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}