2022-08-12 12:06:08 +00:00
|
|
|
{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, makeWrapper, vulkan-loader, QuartzCore }:
|
2021-10-04 12:37:57 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2021-10-06 13:57:05 +00:00
|
|
|
pname = "wgpu-utils";
|
2023-03-24 00:07:29 +00:00
|
|
|
version = "0.15.2";
|
2021-10-04 12:37:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gfx-rs";
|
2021-10-06 13:57:05 +00:00
|
|
|
repo = "wgpu";
|
2022-11-21 17:40:18 +00:00
|
|
|
rev = "v${version}";
|
2023-03-24 00:07:29 +00:00
|
|
|
hash = "sha256-U2e7uOGaVpT/c9EXubkaKkROjog073hVfot2bbB34AY=";
|
2021-10-04 12:37:57 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
cargoHash = "sha256-QMw3jTZ5XmX9VBe5uiD7yoUIkWGqZcE1pOS6ljZ5qd0=";
|
2021-10-04 12:37:57 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildInputs = lib.optional stdenv.isDarwin QuartzCore;
|
|
|
|
|
2021-10-04 12:37:57 +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";
|
|
|
|
};
|
|
|
|
}
|