14 stdenv.mkDerivation (finalAttrs: {
15 pname = "rutabaga_gfx";
19 url = "https://chromium.googlesource.com/crosvm/crosvm";
20 rev = "v${finalAttrs.version}-rutabaga-release";
21 fetchSubmodules = true;
22 hash = "sha256-0RJDKzeU7U6hc6CLKks8QcRs3fxN+/LYUbB0t6W790M=";
26 # Make gfxstream optional
27 # https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4860836
29 url = "https://chromium.googlesource.com/crosvm/crosvm/+/c3ad0e43eb12cbf737a6049e0134d483e337363f%5E%21/?format=TEXT";
31 hash = "sha256-Ji1bK7jnRlg0OpDfCLcTHfPSiz3zYcdgsWL4n3EoIYI=";
33 # Fix error in Makefile where it uses eight spaces instead of a tab
34 # https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4863380
36 url = "https://chromium.googlesource.com/crosvm/crosvm/+/fc415bccc43d36f63a2fd4c28878591bb1053450%5E%21/?format=TEXT";
38 hash = "sha256-SLzlZ4o1+R2bGTPvA0a5emq97hOIIIHrubFhcQjqYwg=";
40 # Install the dylib on Darwin.
41 ./darwin-install.patch
44 nativeBuildInputs = [ cargo pkg-config rustPlatform.cargoSetupHook ];
45 buildInputs = [ libiconv ] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform gfxstream) ([
48 ] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libdrm) [
52 cargoDeps = rustPlatform.fetchCargoTarball {
53 inherit (finalAttrs) src;
54 hash = "sha256-wuF3Isrp+u5J8jPQoPsIOWYGNKLSNa2pLfvladAWkLs=";
57 CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec;
58 "CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER" =
59 "${stdenv.cc.targetPrefix}cc";
63 substituteInPlace Makefile --replace-fail pkg-config "$PKG_CONFIG"
66 # make install always rebuilds
71 "OUT=target/${stdenv.hostPlatform.rust.cargoShortTarget}/release"
75 homepage = "https://crosvm.dev/book/appendix/rutabaga_gfx.html";
76 description = "cross-platform abstraction for GPU and display virtualization";
77 license = licenses.bsd3;
78 maintainers = with maintainers; [ qyliss ];
79 platforms = platforms.darwin ++ platforms.linux;