nixpkgs/pkgs/development/tools/spirv-tools/default.nix

46 lines
1.2 KiB
Nix
Raw Normal View History

2016-08-31 10:19:14 +00:00
{ stdenv, fetchFromGitHub, cmake, python }:
let
spirv_sources = {
# `vulkan-loader` requires a specific version of `spirv-tools` and `spirv-headers` as specified in
2017-04-01 19:28:59 +00:00
# `<vulkan-loader-repo>/external_revisions/spirv-tools_revision`.
2016-08-31 10:19:14 +00:00
tools = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Tools";
2017-12-13 19:18:11 +00:00
rev = "7e2d26c77b606b21af839b37fd21381c4a669f23";
sha256 = "1nlzj081v1xdyfz30nfs8hfcnqd072fra127h46gav179f04kss2";
2016-08-31 10:19:14 +00:00
};
headers = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Headers";
2017-12-13 19:18:11 +00:00
rev = "2bb92e6fe2c6aa410152fc6c63443f452acb1a65";
sha256 = "1rgjd7kpa7xpbwpzd6m3f6yq44s9xn5ddhz135213pxwbi5c0c26";
2016-08-31 10:19:14 +00:00
};
};
in
stdenv.mkDerivation rec {
name = "spirv-tools-${version}";
2017-12-13 19:18:11 +00:00
version = "2017-09-01";
2016-08-31 10:19:14 +00:00
src = spirv_sources.tools;
patchPhase = ''ln -sv ${spirv_sources.headers} external/spirv-headers'';
enableParallelBuilding = true;
2016-08-31 10:19:14 +00:00
buildInputs = [ cmake python ];
passthru = {
headers = spirv_sources.headers;
};
2016-08-31 10:19:14 +00:00
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;
2017-04-01 19:28:59 +00:00
maintainers = [ maintainers.ralith ];
2016-08-31 10:19:14 +00:00
};
}