2022-07-17 08:50:19 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, boxfort, meson, libcsptr, pkg-config, gettext
|
|
|
|
, cmake, ninja, protobuf, libffi, libgit2, dyncall, nanomsg, nanopbMalloc
|
|
|
|
, python3Packages }:
|
2019-10-09 12:44:38 +00:00
|
|
|
|
2024-05-04 02:52:28 +00:00
|
|
|
let
|
|
|
|
# follow revisions defined in .wrap files
|
|
|
|
debugbreak = fetchFromGitHub {
|
|
|
|
owner = "MrAnno";
|
|
|
|
repo = "debugbreak";
|
|
|
|
rev = "83bf7e933311b88613cbaadeced9c2e2c811054a";
|
|
|
|
sha256 = "sha256-OPrPGBUZN73Nl5NMEf/nME843yTolt913yjut3rAos0=";
|
|
|
|
};
|
|
|
|
|
|
|
|
klib = fetchFromGitHub {
|
|
|
|
owner = "attractivechaos";
|
|
|
|
repo = "klib";
|
|
|
|
rev = "cdb7e9236dc47abf8da7ebd702cc6f7f21f0c502";
|
|
|
|
sha256 = "sha256-+GaI5nXz4jYI0rO17xDhNtFpLlGL2WzeSVLMfB6Cl6E=";
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-10-09 12:44:38 +00:00
|
|
|
pname = "criterion";
|
2024-05-04 02:52:28 +00:00
|
|
|
version = "2.4.2";
|
2019-10-09 12:44:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Snaipe";
|
|
|
|
repo = "Criterion";
|
|
|
|
rev = "v${version}";
|
2024-05-04 02:52:28 +00:00
|
|
|
sha256 = "sha256-5GH7AYjrnBnqiSmp28BoaM1Xmy8sPs1atfqJkGy3Yf0=";
|
2019-10-09 12:44:38 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2022-07-17 08:50:19 +00:00
|
|
|
nativeBuildInputs = [ meson ninja cmake pkg-config protobuf ];
|
2019-10-09 12:44:38 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boxfort.dev
|
|
|
|
dyncall
|
|
|
|
gettext
|
|
|
|
libcsptr
|
|
|
|
nanomsg
|
2022-07-17 08:50:19 +00:00
|
|
|
nanopbMalloc
|
|
|
|
libgit2
|
|
|
|
libffi
|
2019-10-09 12:44:38 +00:00
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [ cram ];
|
2019-10-09 12:44:38 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
2022-07-17 08:50:19 +00:00
|
|
|
|
2024-05-04 02:52:28 +00:00
|
|
|
prePatch = ''
|
|
|
|
cp -r ${debugbreak} subprojects/debugbreak
|
|
|
|
cp -r ${klib} subprojects/klib
|
|
|
|
|
|
|
|
for dep in "debugbreak" "klib"; do
|
|
|
|
local meson="$dep/meson.build"
|
|
|
|
|
|
|
|
chmod +w subprojects/$dep
|
|
|
|
cp subprojects/packagefiles/$meson subprojects/$meson
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2022-07-17 08:50:19 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs ci/isdir.py src/protocol/gen-pb.py
|
|
|
|
'';
|
2019-10-09 12:44:38 +00:00
|
|
|
|
|
|
|
outputs = [ "dev" "out" ];
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2019-10-09 12:44:38 +00:00
|
|
|
description = "A cross-platform C and C++ unit testing framework for the 21th century";
|
|
|
|
homepage = "https://github.com/Snaipe/Criterion";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [
|
|
|
|
thesola10
|
|
|
|
Yumasi
|
|
|
|
];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|