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-01-25 03:21:06 +00:00
|
|
|
version = "1.2.198.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}";
|
|
|
|
sha256 = "sha256-FRiqsfoyjUW2kbbphxcy0Hn0TLVaszatM/nnWBrchRY=";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|