From 28257606653cef6913d4ccd76ead276f050507e1 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 1 Aug 2023 19:08:53 +0000 Subject: [PATCH] rutabaga_gfx: init at 0.1.2 (cherry picked from commit a8c49d6e2801627f97e0b4ceda1ccd4bf4ec8698) --- .../libraries/rutabaga_gfx/default.nix | 41 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/libraries/rutabaga_gfx/default.nix diff --git a/pkgs/development/libraries/rutabaga_gfx/default.nix b/pkgs/development/libraries/rutabaga_gfx/default.nix new file mode 100644 index 000000000000..ca220bb6ecc4 --- /dev/null +++ b/pkgs/development/libraries/rutabaga_gfx/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchgit, cargo, pkg-config, rustPlatform +, aemu, gfxstream, libcap, libdrm, minijail +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "rutabaga_gfx"; + version = "0.1.2"; + + src = fetchgit { + url = "https://chromium.googlesource.com/crosvm/crosvm"; + rev = "v${finalAttrs.version}-rutabaga-release"; + fetchSubmodules = true; + hash = "sha256-0RJDKzeU7U6hc6CLKks8QcRs3fxN+/LYUbB0t6W790M="; + }; + + nativeBuildInputs = [ cargo pkg-config rustPlatform.cargoSetupHook ]; + buildInputs = [ aemu gfxstream ] + ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform libdrm) libdrm; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit (finalAttrs) src; + hash = "sha256-wuF3Isrp+u5J8jPQoPsIOWYGNKLSNa2pLfvladAWkLs="; + }; + + # make install always rebuilds + dontBuild = true; + + makeFlags = [ "prefix=$(out)" ]; + + preInstall = '' + cd rutabaga_gfx/ffi + ''; + + meta = with lib; { + homepage = "https://crosvm.dev/book/appendix/rutabaga_gfx.html"; + description = "cross-platform abstraction for GPU and display virtualization"; + license = licenses.bsd3; + maintainers = with maintainers; [ qyliss ]; + platforms = platforms.darwin ++ platforms.linux; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 50fb838053a9..f4985c45c403 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24852,6 +24852,8 @@ with pkgs; rubberband = callPackage ../development/libraries/rubberband { }; + rutabaga_gfx = callPackage ../development/libraries/rutabaga_gfx { }; + rure = callPackage ../development/libraries/rure { }; rustc-demangle = callPackage ../development/libraries/rustc-demangle { };