forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.nix
More file actions
78 lines (68 loc) · 1.58 KB
/
package.nix
File metadata and controls
78 lines (68 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
lib,
stdenv,
fetchFromGitHub,
fetchurl,
flex,
bison,
bc,
cpio,
perl,
elfutils,
python3,
sevVariant ? false,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libkrunfw";
version = "4.9.0";
src = fetchFromGitHub {
owner = "containers";
repo = "libkrunfw";
tag = "v${finalAttrs.version}";
hash = "sha256-wmvjex68Mh7qehA33WNBYHhV9Q/XWLixokuGWnqJ3n0=";
};
kernelSrc = fetchurl {
url = "mirror://kernel/linux/kernel/v6.x/linux-6.12.20.tar.xz";
hash = "sha256-Iw6JsHsKuC508H7MG+4xBdyoHQ70qX+QCSnEBySbasc=";
};
postPatch = ''
substituteInPlace Makefile \
--replace 'curl $(KERNEL_REMOTE) -o $(KERNEL_TARBALL)' 'ln -s $(kernelSrc) $(KERNEL_TARBALL)'
'';
nativeBuildInputs = [
flex
bison
bc
cpio
perl
python3
python3.pkgs.pyelftools
];
buildInputs = [
elfutils
];
makeFlags =
[
"PREFIX=${placeholder "out"}"
]
++ lib.optionals sevVariant [
"SEV=1"
];
# Fixes https://github.com/containers/libkrunfw/issues/55
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.targetPlatform.isAarch64 "-march=armv8-a+crypto";
enableParallelBuilding = true;
meta = with lib; {
description = "Dynamic library bundling the guest payload consumed by libkrun";
homepage = "https://github.com/containers/libkrunfw";
license = with licenses; [
lgpl2Only
lgpl21Only
];
maintainers = with maintainers; [
nickcao
RossComputerGuy
nrabulinski
];
platforms = [ "x86_64-linux" ] ++ lib.optionals (!sevVariant) [ "aarch64-linux" ];
};
})