2021-01-22 11:25:31 +00:00
|
|
|
{ lib, stdenv
|
2021-01-05 22:17:35 +00:00
|
|
|
, fetchFromGitHub
|
2019-08-06 22:45:23 +00:00
|
|
|
, bison
|
|
|
|
, cmake
|
|
|
|
, jq
|
|
|
|
, python3
|
|
|
|
, spirv-headers
|
|
|
|
, spirv-tools
|
|
|
|
}:
|
2016-04-02 19:34:50 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-06 22:45:23 +00:00
|
|
|
pname = "glslang";
|
2024-01-17 17:15:15 +00:00
|
|
|
version = "14.0.0";
|
2016-04-02 19:34:50 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "KhronosGroup";
|
|
|
|
repo = "glslang";
|
2023-05-01 11:48:04 +00:00
|
|
|
rev = version;
|
2024-01-17 17:15:15 +00:00
|
|
|
hash = "sha256-7kIIU45pe+IF7lGltpIKSvQBmcXR+TWFvmx7ztMNrpc=";
|
2019-08-06 22:45:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# These get set at all-packages, keep onto them for child drvs
|
|
|
|
passthru = {
|
2022-01-16 00:31:37 +00:00
|
|
|
spirv-tools = spirv-tools;
|
|
|
|
spirv-headers = spirv-headers;
|
2016-04-02 19:34:50 +00:00
|
|
|
};
|
|
|
|
|
2019-08-06 22:45:23 +00:00
|
|
|
nativeBuildInputs = [ cmake python3 bison jq ];
|
2016-04-02 19:34:50 +00:00
|
|
|
|
2018-08-17 06:04:30 +00:00
|
|
|
postPatch = ''
|
2022-01-16 00:31:37 +00:00
|
|
|
cp --no-preserve=mode -r "${spirv-tools.src}" External/spirv-tools
|
|
|
|
ln -s "${spirv-headers.src}" External/spirv-tools/external/spirv-headers
|
2018-03-23 04:32:24 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-16 15:12:12 +00:00
|
|
|
# This is a dirty fix for lib/cmake/SPIRVTargets.cmake:51 which includes this directory
|
|
|
|
postInstall = ''
|
|
|
|
mkdir $out/include/External
|
|
|
|
'';
|
|
|
|
|
2022-09-17 11:35:19 +00:00
|
|
|
# Fix the paths in .pc, even though it's unclear if these .pc are really useful.
|
|
|
|
postFixup = ''
|
2023-08-22 17:01:16 +00:00
|
|
|
substituteInPlace $out/lib/pkgconfig/*.pc \
|
2022-09-18 17:59:17 +00:00
|
|
|
--replace '=''${prefix}//' '=/'
|
2023-08-22 17:01:16 +00:00
|
|
|
|
|
|
|
# add a symlink for backwards compatibility
|
|
|
|
ln -s $out/bin/glslang $out/bin/glslangValidator
|
2022-09-17 11:35:19 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2016-04-02 19:34:50 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "Khronos reference front-end for GLSL and ESSL";
|
2017-01-04 09:56:26 +00:00
|
|
|
license = licenses.asl20;
|
2021-01-05 22:17:35 +00:00
|
|
|
platforms = platforms.unix;
|
2017-04-01 19:28:59 +00:00
|
|
|
maintainers = [ maintainers.ralith ];
|
2016-04-02 19:34:50 +00:00
|
|
|
};
|
|
|
|
}
|