2021-10-03 15:37:26 +00:00
|
|
|
{ lib, rustPlatform, fetchFromGitHub, pkg-config, makeWrapper, vulkan-loader }:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2021-10-04 18:22:09 +00:00
|
|
|
pname = "wgpu-utils";
|
2021-10-03 15:37:26 +00:00
|
|
|
version = "0.10.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gfx-rs";
|
2021-10-04 18:22:09 +00:00
|
|
|
repo = "wgpu";
|
|
|
|
rev = "utils-${version}";
|
|
|
|
sha256 = "sha256-bOUcLtT5iPZuUgor2d/pJQ4Y+I1LMzREgj1cwLAvd+s=";
|
2021-10-03 15:37:26 +00:00
|
|
|
};
|
|
|
|
|
2021-10-04 18:22:09 +00:00
|
|
|
cargoSha256 = "sha256-SSEG8JApQrgP7RWlXqb+xuy482oQZ5frE2IaVMruuG0=";
|
2021-10-03 15:37:26 +00:00
|
|
|
|
|
|
|
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";
|
|
|
|
};
|
|
|
|
}
|