mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 06:03:40 +00:00
6492af66e1
This requires knock-on upgrades for glslang and spirv-tools. I have also made the validation layers easier to use: - library files identified by layer definitions now use absolute paths - the layer definition path is prepended to XDG_DATA_DIRS Previously, one would have to modify LD_LIBRARY_PATH or install the derivation in a known location for vulkan-loader to find relevant files. These changes make using validation layers in a nix-shell work automatically. Use XDG_DATA_DIRS environment variable rather than VK_LAYER_PATH
45 lines
1.2 KiB
Nix
45 lines
1.2 KiB
Nix
{ stdenv, fetchFromGitHub, cmake, python }:
|
|
|
|
let
|
|
|
|
spirv_sources = {
|
|
# `glslang` requires a specific version of `spirv-tools` and `spirv-headers` as specified in `known-good.json`.
|
|
tools = fetchFromGitHub {
|
|
owner = "KhronosGroup";
|
|
repo = "SPIRV-Tools";
|
|
rev = "9bfe0eb25e3dfdf4f3fd86ab6c0cda009c9bd661";
|
|
sha256 = "1spfii4zib1lmz40vnz1d1cr6is7q2n7rvar1vfzi33gwrn8rqhi";
|
|
};
|
|
headers = fetchFromGitHub {
|
|
owner = "KhronosGroup";
|
|
repo = "SPIRV-Headers";
|
|
rev = "d5b2e1255f706ce1f88812217e9a554f299848af";
|
|
sha256 = "18530mpa030ckjhn78z9vbfd35l5jgh3mg22ra6k8gw8zx4wjhsl";
|
|
};
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "spirv-tools-${version}";
|
|
version = "2018-09-20";
|
|
|
|
src = spirv_sources.tools;
|
|
patchPhase = ''ln -sv ${spirv_sources.headers} external/spirv-headers'';
|
|
enableParallelBuilding = true;
|
|
|
|
buildInputs = [ cmake python ];
|
|
|
|
passthru = {
|
|
headers = spirv_sources.headers;
|
|
};
|
|
|
|
meta = with stdenv.lib; {
|
|
inherit (src.meta) homepage;
|
|
description = "The SPIR-V Tools project provides an API and commands for processing SPIR-V modules";
|
|
license = licenses.asl20;
|
|
platforms = platforms.linux;
|
|
maintainers = [ maintainers.ralith ];
|
|
};
|
|
}
|