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

45 lines
1.2 KiB
Nix
Raw Normal View History

2016-08-31 11:19:14 +01:00
{ stdenv, fetchFromGitHub, cmake, python }:
let
spirv_sources = {
# `glslang` requires a specific version of `spirv-tools` and `spirv-headers` as specified in `known-good.json`.
2016-08-31 11:19:14 +01:00
tools = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Tools";
2018-08-17 07:04:12 +01:00
rev = "1a283f41ed09e31cd720744f904af3d823ceddbf";
sha256 = "1z65wglg081pri9rmiyydvppgd67qr269ppphy4yhg2wg81gg72c";
2016-08-31 11:19:14 +01:00
};
headers = fetchFromGitHub {
owner = "KhronosGroup";
repo = "SPIRV-Headers";
2018-08-17 07:04:12 +01:00
rev = "ff684ffc6a35d2a58f0f63108877d0064ea33feb";
sha256 = "0ypjx61ksr6vda2iy3kxhyjia5qxf0x4qa4jij0giw9x5rsnga6g";
2016-08-31 11:19:14 +01:00
};
};
in
stdenv.mkDerivation rec {
name = "spirv-tools-${version}";
2018-08-17 07:04:12 +01:00
version = "2018-07-04";
2016-08-31 11:19:14 +01:00
src = spirv_sources.tools;
patchPhase = ''ln -sv ${spirv_sources.headers} external/spirv-headers'';
enableParallelBuilding = true;
2016-08-31 11:19:14 +01:00
buildInputs = [ cmake python ];
passthru = {
headers = spirv_sources.headers;
};
2016-08-31 11:19:14 +01: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 20:28:59 +01:00
maintainers = [ maintainers.ralith ];
2016-08-31 11:19:14 +01:00
};
}