From e6bdd9690ced527fffa7a432ec80135e932907c4 Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Sun, 3 Oct 2021 17:37:26 +0200 Subject: [PATCH] wgpu: init at 0.10.0 --- pkgs/tools/graphics/wgpu/default.nix | 36 ++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/tools/graphics/wgpu/default.nix diff --git a/pkgs/tools/graphics/wgpu/default.nix b/pkgs/tools/graphics/wgpu/default.nix new file mode 100644 index 000000000000..31933000bf96 --- /dev/null +++ b/pkgs/tools/graphics/wgpu/default.nix @@ -0,0 +1,36 @@ +{ lib, rustPlatform, fetchFromGitHub, pkg-config, makeWrapper, vulkan-loader }: + +rustPlatform.buildRustPackage rec { + pname = "wgpu"; + version = "0.10.0"; + + src = fetchFromGitHub { + owner = "gfx-rs"; + repo = pname; + rev = "9da5c1d3a026c275feb57606b8c8d61f82b43386"; + sha256 = "sha256-DcIMP06tlMxI16jqpKqei32FY8h7z41Nvygap2MQC8A="; + }; + + cargoSha256 = "sha256-3gtIx337IP5t4nYGysOaU7SZRJrvVjYXN7mAqGbVlo8="; + + nativeBuildInputs = [ + pkg-config + makeWrapper + ]; + + # Tests fail, as the Nix sandbox doesn't provide an appropriate adapter (e.g. Vulkan). + doCheck = false; + + postInstall = '' + wrapProgram $out/bin/wgpu-info \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ vulkan-loader ]} + ''; + + meta = with lib; { + description = "Safe and portable GPU abstraction in Rust, implementing WebGPU API."; + homepage = "https://wgpu.rs/"; + license = with licenses; [ asl20 /* or */ mit ]; + maintainers = with maintainers; [ erictapen ]; + mainProgram = "wgpu-info"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9538749c5fa4..784e2874532d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10481,6 +10481,8 @@ with pkgs; }); }; + wgpu = callPackage ../tools/graphics/wgpu { }; + wg-bond = callPackage ../applications/networking/wg-bond { }; which = callPackage ../tools/system/which { };