5083ee08a2
GitOrigin-RevId: 10ecda252ce1b3b1d6403caeadbcc8f30d5ab796
52 lines
1.3 KiB
Nix
52 lines
1.3 KiB
Nix
{ lib, stdenv
|
|
, fetchFromGitHub
|
|
, bison
|
|
, cmake
|
|
, jq
|
|
, python3
|
|
, spirv-headers
|
|
, spirv-tools
|
|
}:
|
|
stdenv.mkDerivation rec {
|
|
pname = "glslang";
|
|
version = "1.3.224.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "KhronosGroup";
|
|
repo = "glslang";
|
|
rev = "sdk-${version}";
|
|
hash = "sha256-VEOENuy/VhYBBX52O4QHJFXUjsj6jL4vDD4cLDlQcIA=";
|
|
};
|
|
|
|
# These get set at all-packages, keep onto them for child drvs
|
|
passthru = {
|
|
spirv-tools = spirv-tools;
|
|
spirv-headers = spirv-headers;
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake python3 bison jq ];
|
|
|
|
postPatch = ''
|
|
cp --no-preserve=mode -r "${spirv-tools.src}" External/spirv-tools
|
|
ln -s "${spirv-headers.src}" External/spirv-tools/external/spirv-headers
|
|
'';
|
|
|
|
# This is a dirty fix for lib/cmake/SPIRVTargets.cmake:51 which includes this directory
|
|
postInstall = ''
|
|
mkdir $out/include/External
|
|
'';
|
|
|
|
# Fix the paths in .pc, even though it's unclear if these .pc are really useful.
|
|
postFixup = ''
|
|
substituteInPlace "$out"/lib/pkgconfig/SPIRV-Tools{,-shared}.pc \
|
|
--replace '=''${prefix}//' '=/'
|
|
'';
|
|
|
|
meta = with lib; {
|
|
inherit (src.meta) homepage;
|
|
description = "Khronos reference front-end for GLSL and ESSL";
|
|
license = licenses.asl20;
|
|
platforms = platforms.unix;
|
|
maintainers = [ maintainers.ralith ];
|
|
};
|
|
}
|