2023-07-15 17:15:38 +00:00
|
|
|
{ lib, rustPlatform, fetchgit, fetchpatch
|
|
|
|
, pkg-config, protobuf, python3, wayland-scanner
|
2022-08-12 12:06:08 +00:00
|
|
|
, libcap, libdrm, libepoxy, minijail, virglrenderer, wayland, wayland-protocols
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "crosvm";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "114.1";
|
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";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "a8b48953a7d209b32d34fe64e2324cb1113b4336";
|
|
|
|
sha256 = "PdP+Jx2oIAy+gxHjJDU5YlAlSYFtoX7ey3r5ELD9QPM=";
|
2022-08-12 12:06:08 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
|
|
|
# Backport fix for non-Glibc.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://chromium.googlesource.com/chromiumos/platform/crosvm/+/8afa6096aa0417ccc5de0213a241dd7ebd25ac0a%5E%21/?format=TEXT";
|
|
|
|
decode = "base64 -d";
|
|
|
|
hash = "sha256-oRwGprs/P2ZG8BM9CMzyEyM8fjuyFINQw4rjTq9rKXA=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
separateDebugInfo = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
cargoSha256 = "EhxrtCGrwCcODCjPUONjY1glPGEXbjvk6No/g2kJzI8=";
|
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
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
# crosvm mistakenly expects the stable protocols to be in the root
|
|
|
|
# of the pkgdatadir path, rather than under the "stable"
|
|
|
|
# subdirectory.
|
|
|
|
PKG_CONFIG_WAYLAND_PROTOCOLS_PKGDATADIR =
|
|
|
|
"${wayland-protocols}/share/wayland-protocols/stable";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildFeatures = [ "default" "virgl_renderer" "virgl_renderer_next" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
passthru.updateScript = ./update.py;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A secure virtual machine monitor for KVM";
|
|
|
|
homepage = "https://chromium.googlesource.com/crosvm/crosvm/";
|
|
|
|
maintainers = with maintainers; [ qyliss ];
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = [ "aarch64-linux" "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|