depot/third_party/nixpkgs/pkgs/tools/graphics/wgpu-utils/default.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

38 lines
1.1 KiB
Nix

{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, makeWrapper, vulkan-loader, QuartzCore }:
rustPlatform.buildRustPackage rec {
pname = "wgpu-utils";
version = "0.10.0";
src = fetchFromGitHub {
owner = "gfx-rs";
repo = "wgpu";
rev = "utils-${version}";
sha256 = "sha256-bOUcLtT5iPZuUgor2d/pJQ4Y+I1LMzREgj1cwLAvd+s=";
};
cargoSha256 = "sha256-SSEG8JApQrgP7RWlXqb+xuy482oQZ5frE2IaVMruuG0=";
nativeBuildInputs = [
pkg-config
makeWrapper
];
buildInputs = lib.optional stdenv.isDarwin QuartzCore;
# 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";
};
}