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-03-23 04:32:24 +00:00
|
|
|
rev = "9e19fc0f31ceaf1f6bc907dbf17dcfded85f2ce8";
|
|
|
|
sha256 = "1zpwznq0fyvkzs5h9nnkr7g6svr0w8z6zx62xgnss17c2a5cz0lk";
|
2016-08-31 11:19:14 +01:00
|
|
|
};
|
|
|
|
headers = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "SPIRV-Headers";
|
2018-03-23 04:32:24 +00:00
|
|
|
rev = "ce309203d7eceaf908bea8862c27f3e0749f7d00";
|
|
|
|
sha256 = "1sv1iy2d46sg7r3xy591db6fn9h78wd079yvfa87vwmwsdkhiqhm";
|
2016-08-31 11:19:14 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "spirv-tools-${version}";
|
2018-03-23 04:32:24 +00:00
|
|
|
version = "2018-02-05";
|
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
|
|
|
};
|
|
|
|
}
|