nixpkgs/pkgs/tools/graphics/wgpu-utils/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.2 KiB
Nix
Raw Normal View History

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 {
pname = "wgpu-utils";
2023-05-25 09:24:48 +00:00
version = "0.16.1";
2021-10-03 15:37:26 +00:00
src = fetchFromGitHub {
owner = "gfx-rs";
repo = "wgpu";
2022-11-09 07:21:16 +00:00
rev = "v${version}";
2023-05-25 09:24:48 +00:00
hash = "sha256-tGjjjQDcN9zkxQSOrW/D1Pu6cycTKo/lh71mTEpZQIE=";
2021-10-03 15:37:26 +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=";
};
};
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";
2021-10-03 15:37:26 +00:00
homepage = "https://wgpu.rs/";
license = with licenses; [ asl20 /* or */ mit ];
maintainers = with maintainers; [ erictapen ];
mainProgram = "wgpu-info";
};
}