2024-06-24 18:47:55 +00:00
|
|
|
{ lib, rustPlatform, fetchgit, fetchpatch
|
2023-11-16 04:20:00 +00:00
|
|
|
, pkg-config, protobuf, python3, wayland-scanner
|
2022-08-12 12:06:08 +00:00
|
|
|
, libcap, libdrm, libepoxy, minijail, virglrenderer, wayland, wayland-protocols
|
2024-07-01 15:47:52 +00:00
|
|
|
, pkgsCross
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "crosvm";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "125.0";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
src = fetchgit {
|
2022-11-21 17:40:18 +00:00
|
|
|
url = "https://chromium.googlesource.com/chromiumos/platform/crosvm";
|
2024-06-20 14:57:18 +00:00
|
|
|
rev = "6a7ff1ecb7fad6820d3bbfe8b11e65854059aba5";
|
|
|
|
hash = "sha256-y/vHU8i9YNbzSHla853z/2w914mVMFOryyaHE1uxlvM=";
|
2022-08-12 12:06:08 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-24 18:47:55 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "musl.patch";
|
|
|
|
url = "https://chromium.googlesource.com/chromiumos/platform/crosvm/+/128e591037c0be0362ed814d0b5583aa65ff09e1%5E%21/?format=TEXT";
|
|
|
|
decode = "base64 -d";
|
|
|
|
hash = "sha256-p5VzHRb0l0vCJNe48cRl/uBYHwTQMEykMcBOMzL3yaY=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
separateDebugInfo = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
cargoHash = "sha256-1AUfd9dhIZvVVUsVbnGoLKc0lBfccwM4wqWgU4yZWOE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config protobuf python3 rustPlatform.bindgenHook wayland-scanner
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildInputs = [
|
2022-09-09 14:08:57 +00:00
|
|
|
libcap libdrm libepoxy minijail virglrenderer wayland wayland-protocols
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
2022-07-18 16:21:45 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs third_party/minijail/tools/*.py
|
2022-08-12 12:06:08 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
CROSVM_USE_SYSTEM_MINIGBM = true;
|
2023-08-22 20:05:09 +00:00
|
|
|
CROSVM_USE_SYSTEM_VIRGLRENDERER = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
buildFeatures = [ "virgl_renderer" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = ./update.py;
|
|
|
|
tests = {
|
|
|
|
musl = pkgsCross.musl64.crosvm;
|
|
|
|
};
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Secure virtual machine monitor for KVM";
|
2023-11-16 04:20:00 +00:00
|
|
|
homepage = "https://crosvm.dev/";
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "crosvm";
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ qyliss ];
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = [ "aarch64-linux" "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|