Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 python3,
4 fetchFromGitHub,
5 fetchpatch,
6 which,
7 acpica-tools,
8 unstableGitUpdater,
9}:
10
11python3.pkgs.buildPythonApplication rec {
12 pname = "igvm-tooling";
13 version = "1.5.0-unstable-2024-06-06";
14 pyproject = true;
15
16 src = fetchFromGitHub {
17 owner = "microsoft";
18 repo = "igvm-tooling";
19 rev = "53656ddde294bbafcae6349b5acfc5da9f7dbb92";
20 hash = "sha256-X9Gi+kTmc/ZcsgbHldEj9zPnOmd5puDD7/+J1s1CVws=";
21 };
22
23 patches = [
24 # drop unused libclang dependency
25 # remove once https://github.com/microsoft/igvm-tooling/pull/53 is merged
26 (fetchpatch {
27 name = "0001-setup.py-remove-unused-libclang-dependency.patch";
28 url = "https://github.com/microsoft/igvm-tooling/commit/7182e925de9b5e9f5c8c3a3ce6e3942a92506064.patch";
29 hash = "sha256-tcVxcuLxknyEdo2YjeHOqSG9xQna8US+YyvlcfX+Htw=";
30 stripLen = 1;
31 })
32 ];
33
34 postPatch = ''
35 substituteInPlace igvm/acpi.py \
36 --replace-fail 'os.path.join(os.path.dirname(__file__), "acpi", "acpi.zip")' "\"$out/share/igvm-tooling/acpi/acpi.zip\""
37 '';
38
39 sourceRoot = "${src.name}/src";
40
41 nativeBuildInputs = [ acpica-tools ];
42
43 propagatedBuildInputs =
44 (with python3.pkgs; [
45 setuptools
46 ecdsa
47 cstruct
48 pyelftools
49 pytest
50 cached-property
51 frozendict
52 ])
53 ++ [
54 acpica-tools
55 which
56 ];
57
58 postInstall = ''
59 mkdir -p $out/share/igvm-tooling/acpi/acpi-clh
60 cp -rT igvm/acpi/acpi-clh $out/share/igvm-tooling/acpi/acpi-clh
61 cp igvm/acpi/acpi.zip $out/share/igvm-tooling/acpi/acpi.zip
62 find $out/share/igvm-tooling/acpi -name "*.dsl" -exec iasl -f {} \;
63 '';
64
65 passthru.updateScript = unstableGitUpdater {
66 tagPrefix = "igvm-";
67 };
68
69 meta = {
70 description = "IGVM Image Generator";
71 homepage = "https://github.com/microsoft/igvm-tooling";
72 license = lib.licenses.mit;
73 maintainers = with lib.maintainers; [
74 malt3
75 katexochen
76 ];
77 changelog = "https://github.com/microsoft/igvm-tooling/releases/tag/igvm-${version}";
78 mainProgram = "igvmgen";
79 platforms = lib.platforms.all;
80 };
81}