2018-03-23 05:32:24 +01:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, bison, spirv-tools, jq }:
|
2016-04-02 21:34:50 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-09-18 07:19:40 +02:00
|
|
|
name = "glslang-git-${version}";
|
2018-03-23 05:32:24 +01:00
|
|
|
version = "2018-02-05";
|
2016-04-02 21:34:50 +02:00
|
|
|
|
2016-08-31 12:22:01 +02:00
|
|
|
# `vulkan-loader` requires a specific version of `glslang` as specified in
|
2017-04-01 21:28:59 +02:00
|
|
|
# `<vulkan-loader-repo>/external_revisions/glslang_revision`.
|
2016-04-02 21:34:50 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "glslang";
|
2018-03-23 05:32:24 +01:00
|
|
|
rev = "2651ccaec8";
|
|
|
|
sha256 = "0x5x5i07n9g809rzf5jgw70mmwck31ishdmxnmi0wxx737jjqwaq";
|
2016-04-02 21:34:50 +02:00
|
|
|
};
|
|
|
|
|
2018-03-23 05:32:24 +01:00
|
|
|
buildInputs = [ cmake bison jq ] ++ spirv-tools.buildInputs;
|
2016-09-18 07:19:40 +02:00
|
|
|
enableParallelBuilding = true;
|
2016-04-02 21:34:50 +02:00
|
|
|
|
2018-03-23 05:32:24 +01:00
|
|
|
patchPhase = ''
|
|
|
|
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
|
|
|
|
echo "ERROR: spirv-tools commits do not match expected versions";
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2016-04-02 21:34:50 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Khronos reference front-end for GLSL and ESSL";
|
2017-01-04 10:56:26 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.linux;
|
2017-04-01 21:28:59 +02:00
|
|
|
maintainers = [ maintainers.ralith ];
|
2016-04-02 21:34:50 +02:00
|
|
|
};
|
|
|
|
}
|