nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 python3,
5 libseccomp,
6 nixosTests,
7 testers,
8 benchexec,
9}:
10python3.pkgs.buildPythonApplication rec {
11 pname = "benchexec";
12 version = "3.27";
13
14 src = fetchFromGitHub {
15 owner = "sosy-lab";
16 repo = "benchexec";
17 rev = version;
18 hash = "sha256-lokz7klAQAascij0T/T43/PrbMh6ZUAvFnIqg13pVUk=";
19 };
20
21 pyproject = true;
22
23 postPatch = ''
24 substituteInPlace pyproject.toml \
25 --replace-fail 'setuptools ==' 'setuptools >='
26 '';
27
28 nativeBuildInputs = with python3.pkgs; [ setuptools ];
29
30 # NOTE: CPU Energy Meter is not added,
31 # because BenchExec should call the wrapper configured
32 # via `security.wrappers.cpu-energy-meter`
33 # in `programs.cpu-energy-meter`, which will have the required
34 # capabilities to access MSR.
35 # If we add `cpu-energy-meter` here, BenchExec will instead call an executable
36 # without `CAP_SYS_RAWIO` and fail.
37 propagatedBuildInputs = with python3.pkgs; [
38 coloredlogs
39 lxml
40 pystemd
41 pyyaml
42 ];
43
44 makeWrapperArgs = [ "--set-default LIBSECCOMP ${lib.getLib libseccomp}/lib/libseccomp.so" ];
45
46 passthru.tests =
47 let
48 testVersion =
49 result:
50 testers.testVersion {
51 command = "${result} --version";
52 package = benchexec;
53 };
54 in
55 {
56 nixos = nixosTests.benchexec;
57 benchexec-version = testVersion "benchexec";
58 runexec-version = testVersion "runexec";
59 table-generator-version = testVersion "table-generator";
60 containerexec-version = testVersion "containerexec";
61 };
62
63 meta = with lib; {
64 description = "Framework for Reliable Benchmarking and Resource Measurement";
65 homepage = "https://github.com/sosy-lab/benchexec";
66 maintainers = with maintainers; [ lorenzleutgeb ];
67 license = licenses.asl20;
68 mainProgram = "benchexec";
69 };
70}