2024-07-27 06:49:29 +00:00
|
|
|
{ lib, rustPlatform, fetchgit
|
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-07-27 06:49:29 +00:00
|
|
|
version = "126.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-07-27 06:49:29 +00:00
|
|
|
rev = "5533201f3ff3230d121e06100557d369c055e6dc";
|
|
|
|
hash = "sha256-Ufi8dIhNgXvD53PWLG2uj7CD37UZIegrqAQz3wTKTvE=";
|
2022-08-12 12:06:08 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
separateDebugInfo = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
cargoHash = "sha256-E2lyBgptQs+/5JS2WJc4ietguXdK16DFEVzqylmX+Pk=";
|
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" ];
|
|
|
|
};
|
|
|
|
}
|