2016-08-31 11:19:14 +01:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, python }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
spirv_sources = {
|
2018-03-23 04:32:24 +00:00
|
|
|
# `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-06-27 04:30:48 +01:00
|
|
|
rev = "f2c93c6e124836797311facb8449f9a0b76fefc2";
|
|
|
|
sha256 = "03w5xk2hjijj1rfbx5dw3lhy7vb9zrssfcwvp09q47f77vkgl105";
|
2016-08-31 11:19:14 +01:00
|
|
|
};
|
|
|
|
headers = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "SPIRV-Headers";
|
2018-06-27 04:30:48 +01:00
|
|
|
rev = "12f8de9f04327336b699b1b80aa390ae7f9ddbf4";
|
|
|
|
sha256 = "0fswk5ndvkmy64har3dmhpkv09zmvb0p4knbqc4fdl4qiggz0fvf";
|
2016-08-31 11:19:14 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "spirv-tools-${version}";
|
2018-06-27 04:30:48 +01:00
|
|
|
version = "2018-06-06";
|
2016-08-31 11:19:14 +01:00
|
|
|
|
|
|
|
src = spirv_sources.tools;
|
|
|
|
patchPhase = ''ln -sv ${spirv_sources.headers} external/spirv-headers'';
|
2016-09-18 06:19:40 +01:00
|
|
|
enableParallelBuilding = true;
|
2016-08-31 11:19:14 +01:00
|
|
|
|
|
|
|
buildInputs = [ cmake python ];
|
|
|
|
|
2016-09-18 06:19:40 +01:00
|
|
|
passthru = {
|
|
|
|
headers = spirv_sources.headers;
|
|
|
|
};
|
|
|
|
|
2016-08-31 11:19:14 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
inherit (src.meta) homepage;
|
2017-01-04 09:56:26 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|