2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2021-01-09 10:05:03 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, bison
|
|
|
|
, cmake
|
|
|
|
, jq
|
|
|
|
, python3
|
|
|
|
, spirv-headers
|
|
|
|
, spirv-tools
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "glslang";
|
2022-09-14 18:05:37 +00:00
|
|
|
version = "1.3.224.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "glslang";
|
2022-01-25 03:21:06 +00:00
|
|
|
rev = "sdk-${version}";
|
2022-09-14 18:05:37 +00:00
|
|
|
hash = "sha256-+NKp/4e3iruAcTunpxksvCHxoVYmPd0kFI8JDJJUVg4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# These get set at all-packages, keep onto them for child drvs
|
|
|
|
passthru = {
|
2022-01-25 03:21:06 +00:00
|
|
|
spirv-tools = spirv-tools;
|
|
|
|
spirv-headers = spirv-headers;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake python3 bison jq ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2022-01-25 03:21:06 +00:00
|
|
|
cp --no-preserve=mode -r "${spirv-tools.src}" External/spirv-tools
|
|
|
|
ln -s "${spirv-headers.src}" External/spirv-tools/external/spirv-headers
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
# This is a dirty fix for lib/cmake/SPIRVTargets.cmake:51 which includes this directory
|
|
|
|
postInstall = ''
|
|
|
|
mkdir $out/include/External
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Khronos reference front-end for GLSL and ESSL";
|
|
|
|
license = licenses.asl20;
|
2021-01-09 10:05:03 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.ralith ];
|
|
|
|
};
|
|
|
|
}
|