2018-08-17 07:04:30 +01:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, cmake, bison, spirv-tools, jq }:
|
2016-04-02 20:34:50 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-09-18 06:19:40 +01:00
|
|
|
name = "glslang-git-${version}";
|
2018-12-07 18:17:57 +00:00
|
|
|
version = "2018-09-26";
|
2016-04-02 20:34:50 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "glslang";
|
2018-12-07 18:17:57 +00:00
|
|
|
rev = "91ac4290bcf2cb930b4fb0981f09c00c0b6797e1";
|
|
|
|
sha256 = "0q477pm0n495acnss16ddlf82a6i5l2dfmvc7r8yi0bgmgpzi4av";
|
2016-04-02 20:34:50 +01:00
|
|
|
};
|
|
|
|
|
2018-03-23 04:32:24 +00:00
|
|
|
buildInputs = [ cmake bison jq ] ++ spirv-tools.buildInputs;
|
2016-09-18 06:19:40 +01:00
|
|
|
enableParallelBuilding = true;
|
2016-04-02 20:34:50 +01:00
|
|
|
|
2018-08-17 07:04:30 +01:00
|
|
|
postPatch = ''
|
2018-03-23 04:32:24 +00:00
|
|
|
cp --no-preserve=mode -r "${spirv-tools.src}" External/spirv-tools
|
|
|
|
ln -s "${spirv-tools.headers}" External/spirv-tools/external/spirv-headers
|
|
|
|
'';
|
|
|
|
|
|
|
|
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')
|
|
|
|
if [ "$HEADERS_COMMIT" != "${spirv-tools.headers.rev}" ] || [ "$TOOLS_COMMIT" != "${spirv-tools.src.rev}" ]; then
|
2018-08-17 07:04:30 +01: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
|
|
|
|
'';
|
|
|
|
|
2018-08-08 19:27:45 +01:00
|
|
|
doCheck = false; # fails 3 out of 3 tests (ctest)
|
|
|
|
|
2016-04-02 20:34:50 +01: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 20:28:59 +01:00
|
|
|
maintainers = [ maintainers.ralith ];
|
2016-04-02 20:34:50 +01:00
|
|
|
};
|
|
|
|
}
|