2019-08-06 22:45:23 +00:00
|
|
|
{ stdenv, fetchFromGitHub
|
|
|
|
, bison
|
|
|
|
, cmake
|
|
|
|
, jq
|
|
|
|
, python3
|
|
|
|
, spirv-headers
|
|
|
|
, spirv-tools
|
|
|
|
}:
|
|
|
|
|
2016-04-02 19:34:50 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-06 22:45:23 +00:00
|
|
|
pname = "glslang";
|
2020-01-29 06:32:22 +00:00
|
|
|
version = "8.13.3559";
|
2016-04-02 19:34:50 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "glslang";
|
2019-08-06 22:45:23 +00:00
|
|
|
rev = version;
|
2020-01-29 06:32:22 +00:00
|
|
|
sha256 = "0waamlh2vqh1k40m169294xdlm0iqjkx2vis4qyxfki0r0cnsmnk";
|
2019-08-06 22:45:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# These get set at all-packages, keep onto them for child drvs
|
|
|
|
passthru = {
|
|
|
|
inherit spirv-tools spirv-headers;
|
2016-04-02 19:34:50 +00:00
|
|
|
};
|
|
|
|
|
2019-08-06 22:45:23 +00:00
|
|
|
nativeBuildInputs = [ cmake python3 bison jq ];
|
2016-09-18 05:19:40 +00:00
|
|
|
enableParallelBuilding = true;
|
2016-04-02 19:34:50 +00:00
|
|
|
|
2018-08-17 06:04:30 +00:00
|
|
|
postPatch = ''
|
2018-03-23 04:32:24 +00:00
|
|
|
cp --no-preserve=mode -r "${spirv-tools.src}" External/spirv-tools
|
2019-02-17 17:54:25 +00:00
|
|
|
ln -s "${spirv-headers.src}" External/spirv-tools/external/spirv-headers
|
2018-03-23 04:32:24 +00:00
|
|
|
'';
|
|
|
|
|
2019-08-06 22:45:23 +00:00
|
|
|
# Ensure spirv-headers and spirv-tools match exactly to what is expected
|
2018-03-23 04:32:24 +00:00
|
|
|
preConfigure = ''
|
|
|
|
HEADERS_COMMIT=$(jq -r < known_good.json '.commits|map(select(.name=="spirv-tools/external/spirv-headers"))[0].commit')
|
|
|
|
TOOLS_COMMIT=$(jq -r < known_good.json '.commits|map(select(.name=="spirv-tools"))[0].commit')
|
2019-02-17 17:54:25 +00:00
|
|
|
if [ "$HEADERS_COMMIT" != "${spirv-headers.src.rev}" ] || [ "$TOOLS_COMMIT" != "${spirv-tools.src.rev}" ]; then
|
2018-08-17 06:04:30 +00:00
|
|
|
echo "ERROR: spirv-tools commits do not match expected versions: expected tools at $TOOLS_COMMIT, headers at $HEADERS_COMMIT";
|
2018-03-23 04:32:24 +00:00
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2016-04-02 19:34:50 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Khronos reference front-end for GLSL and ESSL";
|
2017-01-04 09:56:26 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
2017-04-01 19:28:59 +00:00
|
|
|
maintainers = [ maintainers.ralith ];
|
2016-04-02 19:34:50 +00:00
|
|
|
};
|
|
|
|
}
|