2022-07-10 13:30:56 +00:00
|
|
|
{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, makeWrapper, vulkan-loader, QuartzCore }:
|
2021-10-03 15:37:26 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2021-10-04 18:22:09 +00:00
|
|
|
pname = "wgpu-utils";
|
2023-04-20 21:30:51 +00:00
|
|
|
version = "0.16.0";
|
2021-10-03 15:37:26 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gfx-rs";
|
2021-10-04 18:22:09 +00:00
|
|
|
repo = "wgpu";
|
2022-11-09 07:21:16 +00:00
|
|
|
rev = "v${version}";
|
2023-04-20 21:30:51 +00:00
|
|
|
hash = "sha256-2BS38Ybz/j6QnlI1G9zc/lFJKXj4Bh7+jlvyweUVhfA=";
|
2021-10-03 15:37:26 +00:00
|
|
|
};
|
|
|
|
|
2023-03-25 23:16:46 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"d3d12-0.6.0" = "sha256-xCazXUriIQWMVa3DOI1aySBATmYwyDqsVYULRV2l/44=";
|
2023-04-20 21:30:51 +00:00
|
|
|
"naga-0.12.0" = "sha256-EZ8ZKixOFPT9ZTKIC/UGh2B3F09ENbCTUi+ASamJzMM=";
|
2023-03-25 23:16:46 +00:00
|
|
|
};
|
|
|
|
};
|
2021-10-03 15:37:26 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
2022-07-10 13:30:56 +00:00
|
|
|
buildInputs = lib.optional stdenv.isDarwin QuartzCore;
|
|
|
|
|
2021-10-03 15:37:26 +00:00
|
|
|
# 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";
|
|
|
|
};
|
|
|
|
}
|