crun: enable libkrun support when applicable (#504644)
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
go-md2man,
|
||||
pkg-config,
|
||||
libcap,
|
||||
libkrun,
|
||||
libkrun-sev,
|
||||
libseccomp,
|
||||
python3,
|
||||
systemdMinimal,
|
||||
@@ -13,6 +15,8 @@
|
||||
nixosTests,
|
||||
criu,
|
||||
versionCheckHook,
|
||||
withLibkrun ? lib.meta.availableOn stdenv.hostPlatform libkrun,
|
||||
withLibkrunSEV ? false,
|
||||
}:
|
||||
|
||||
let
|
||||
@@ -70,6 +74,16 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
libseccomp
|
||||
systemdMinimal
|
||||
yajl
|
||||
]
|
||||
++ lib.optionals withLibkrun [
|
||||
libkrun
|
||||
]
|
||||
++ lib.optionals withLibkrunSEV [
|
||||
libkrun-sev
|
||||
];
|
||||
|
||||
configureFlags = lib.optionals withLibkrun [
|
||||
"--with-libkrun"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
@@ -88,6 +102,14 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
${lib.concatMapStringsSep "\n" (
|
||||
e: "substituteInPlace Makefile.am --replace-fail 'tests/${e}' ''"
|
||||
) disabledTests}
|
||||
''
|
||||
+ lib.optionalString withLibkrun ''
|
||||
substituteInPlace src/libcrun/handlers/krun.c \
|
||||
--replace-fail '"libkrun.so.1"' '"${libkrun}/lib/libkrun.so.1"'
|
||||
''
|
||||
+ lib.optionalString withLibkrunSEV ''
|
||||
substituteInPlace src/libcrun/handlers/krun.c \
|
||||
--replace-fail '"libkrun-sev.so.1"' '"${libkrun-sev}/lib/libkrun-sev.so.1"'
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
|
||||
Reference in New Issue
Block a user