nixpkgs/pkgs/development/compilers/glslang/default.nix

38 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, cmake, bison, jq, python, spirv-tools, spirv-headers }:
2016-04-02 21:34:50 +02:00
stdenv.mkDerivation rec {
2019-02-17 18:54:25 +01:00
name = "glslang-${version}";
version = "7.11.3113";
2016-04-02 21:34:50 +02:00
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "glslang";
2019-02-17 18:54:25 +01:00
rev = "${version}";
sha256 = "1kzv2b4q1fddxd7c0hc754nd6rw6y9vijb9fsi13xzzq9dficgb6";
2016-04-02 21:34:50 +02:00
};
2019-02-17 18:54:25 +01:00
nativeBuildInputs = [ cmake python bison jq ];
enableParallelBuilding = true;
2016-04-02 21:34:50 +02:00
2018-08-17 08:04:30 +02:00
postPatch = ''
cp --no-preserve=mode -r "${spirv-tools.src}" External/spirv-tools
2019-02-17 18:54:25 +01:00
ln -s "${spirv-headers.src}" 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')
2019-02-17 18:54:25 +01:00
if [ "$HEADERS_COMMIT" != "${spirv-headers.src.rev}" ] || [ "$TOOLS_COMMIT" != "${spirv-tools.src.rev}" ]; then
2018-08-17 08:04:30 +02:00
echo "ERROR: spirv-tools commits do not match expected versions: expected tools at $TOOLS_COMMIT, headers at $HEADERS_COMMIT";
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";
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
};
}