15 stdenv.mkDerivation (finalAttrs: {
16 pname = "rutabaga_gfx";
20 url = "https://chromium.googlesource.com/crosvm/crosvm";
21 rev = "v${finalAttrs.version}-rutabaga-release";
22 fetchSubmodules = true;
23 hash = "sha256-0RJDKzeU7U6hc6CLKks8QcRs3fxN+/LYUbB0t6W790M=";
27 # Make gfxstream optional
28 # https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4860836
30 url = "https://chromium.googlesource.com/crosvm/crosvm/+/c3ad0e43eb12cbf737a6049e0134d483e337363f%5E%21/?format=TEXT";
32 hash = "sha256-Ji1bK7jnRlg0OpDfCLcTHfPSiz3zYcdgsWL4n3EoIYI=";
34 # Fix error in Makefile where it uses eight spaces instead of a tab
35 # https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4863380
37 url = "https://chromium.googlesource.com/crosvm/crosvm/+/fc415bccc43d36f63a2fd4c28878591bb1053450%5E%21/?format=TEXT";
39 hash = "sha256-SLzlZ4o1+R2bGTPvA0a5emq97hOIIIHrubFhcQjqYwg=";
41 # Install the dylib on Darwin.
42 ./darwin-install.patch
48 rustPlatform.cargoSetupHook
52 ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform gfxstream) (
57 ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libdrm) [
62 cargoDeps = rustPlatform.fetchCargoTarball {
63 inherit (finalAttrs) src;
64 hash = "sha256-wuF3Isrp+u5J8jPQoPsIOWYGNKLSNa2pLfvladAWkLs=";
67 CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec;
68 "CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER" = "${stdenv.cc.targetPrefix}cc";
72 substituteInPlace Makefile --replace-fail pkg-config "$PKG_CONFIG"
75 # make install always rebuilds
80 "OUT=target/${stdenv.hostPlatform.rust.cargoShortTarget}/release"
84 homepage = "https://crosvm.dev/book/appendix/rutabaga_gfx.html";
85 description = "cross-platform abstraction for GPU and display virtualization";
86 license = licenses.bsd3;
87 maintainers = with maintainers; [ qyliss ];
88 platforms = platforms.darwin ++ platforms.linux;