1{
2 lib,
3 fetchgit,
4 unstableGitUpdater,
5 stdenv,
6 doxygen,
7 graphviz,
8 python3Packages,
9}:
10
11stdenv.mkDerivation {
12 pname = "xtf";
13 version = "0-unstable-2025-07-24";
14
15 outputs = [
16 "out" # xtf-runner and test suite.
17 "doc" # Autogenerated HTML documentation website.
18 "dev" # Development headers.
19 ];
20
21 src = fetchgit {
22 url = "https://xenbits.xenproject.org/git-http/xtf.git";
23 rev = "1f7323571e7be793a2f969eaf95273564f323b0d";
24 hash = "sha256-cqechUi+UbrvNni9wryxWCtXw2+rDGfqpq0DE4INlPw=";
25 };
26
27 nativeBuildInputs =
28 (with python3Packages; [
29 python
30 wrapPython
31 ])
32 ++ [
33 doxygen
34 graphviz
35 ];
36
37 buildFlags = [ "doxygen" ];
38
39 installFlags = [
40 "xtfdir=$(out)/share/xtf"
41 ];
42
43 postInstall =
44 # Much like Xen, XTF installs its files to dist/nix/store/*/*,
45 # so we need to copy them to the right place.
46 ''
47 mkdir -p ''${!outputBin}/share
48 cp -prvd dist/nix/store/*/* ''${!outputBin}
49 ''
50 # The documentation and development headers aren't in the dist/
51 # folder, so we copy those too.
52 + ''
53 mkdir -p ''${!outputDoc}/share/doc/xtf
54 cp -prvd docs/autogenerated/html ''${!outputDoc}/share/doc/xtf
55
56 mkdir -p ''${!outputDev}/include
57 cp -prvd include ''${!outputDev}
58 ''
59 # Wrap xtf-runner, and link it to $out/bin.
60 # This is necessary because the real xtf-runner should
61 # be in the same directory as the tests/ directory.
62 + ''
63 wrapPythonProgramsIn "''${!outputBin}/share/xtf" "''${!outputBin} $pythonPath"
64 mkdir -p ''${!outputBin}/bin
65 ln -s ''${!outputBin}/share/xtf/xtf-runner ''${!outputBin}/bin/xtf-runner
66 '';
67
68 passthru.updateScript = unstableGitUpdater { };
69
70 meta = {
71 description = "Xen Test Framework and Suite for creating microkernel-based tests";
72 homepage = "https://xenbits.xenproject.org/docs/xtf/index.html";
73 license = lib.licenses.bsd2;
74 teams = [ lib.teams.xen ];
75 mainProgram = "xtf-runner";
76 platforms = lib.lists.intersectLists lib.platforms.linux lib.platforms.x86_64;
77 };
78}