2022-08-21 13:32:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2023-05-24 13:37:59 +00:00
|
|
|
, cargo
|
2022-08-21 13:32:41 +00:00
|
|
|
, pkg-config
|
|
|
|
, glibc
|
|
|
|
, openssl
|
|
|
|
, libkrunfw
|
2023-05-24 13:37:59 +00:00
|
|
|
, rustc
|
2022-08-21 13:32:41 +00:00
|
|
|
, sevVariant ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libkrun";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.8.1";
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchFromGitHub {
|
2022-08-21 13:32:41 +00:00
|
|
|
owner = "containers";
|
2024-01-02 11:29:13 +00:00
|
|
|
repo = "libkrun";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-rrNiqwx4aEOB3fTyv8xcZEDsNJX4NNPhp13W0qnl1O0=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
2024-01-02 11:29:13 +00:00
|
|
|
inherit pname version src;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-6Zfy0LtxUDZzwlhul2fZpsI1c7GWntAMfsT6j+QefVs=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
cargo
|
|
|
|
rustc
|
2024-01-02 11:29:13 +00:00
|
|
|
] ++ lib.optionals sevVariant [
|
|
|
|
pkg-config
|
|
|
|
];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2022-09-14 18:05:37 +00:00
|
|
|
(libkrunfw.override { inherit sevVariant; })
|
2022-08-21 13:32:41 +00:00
|
|
|
glibc
|
|
|
|
glibc.static
|
2024-01-02 11:29:13 +00:00
|
|
|
] ++ lib.optionals sevVariant [
|
|
|
|
openssl
|
|
|
|
];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
] ++ lib.optionals sevVariant [
|
|
|
|
"SEV=1"
|
|
|
|
];
|
2022-09-14 18:05:37 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A dynamic library providing Virtualization-based process isolation capabilities";
|
|
|
|
homepage = "https://github.com/containers/libkrun";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ nickcao ];
|
2023-02-02 18:25:31 +00:00
|
|
|
platforms = libkrunfw.meta.platforms;
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
}
|