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

49 lines
1.7 KiB
Nix
Raw Normal View History

2018-08-17 08:04:30 +02:00
{ stdenv, fetchFromGitHub, fetchpatch, cmake, bison, spirv-tools, jq }:
2016-04-02 21:34:50 +02:00
stdenv.mkDerivation rec {
name = "glslang-git-${version}";
2018-08-17 08:04:30 +02:00
version = "2018-07-27";
2016-04-02 21:34:50 +02:00
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "glslang";
2018-08-17 08:04:30 +02:00
rev = "e99a26810f65314183163c07664a40e05647c15f";
sha256 = "1w11z518xfbnf34xgzg1mp3xicpw2qmpcvaixlzw79s9ifqg5lqs";
2016-04-02 21:34:50 +02:00
};
2018-08-17 08:04:30 +02:00
patches = [
# spirv-tools bump for vulkan sdk 1.1.82.1; remove on update
(fetchpatch {
url = "https://github.com/lenny-lunarg/glslang/commit/c7f4e818ac55f545289f87f8c37571b2eadcde86.patch";
sha256 = "197293alxjdpm3x1vd6pksdb1d9za42vlyn8yn2w786av0l7vf1k";
})
];
buildInputs = [ cmake bison jq ] ++ spirv-tools.buildInputs;
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
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 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
'';
2018-08-08 20:27:45 +02:00
doCheck = false; # fails 3 out of 3 tests (ctest)
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
};
}