Files
nixpkgs/pkgs/by-name/gl/glslang/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

74 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
bison,
cmake,
jq,
python3,
spirv-headers,
spirv-tools,
}:
stdenv.mkDerivation rec {
pname = "glslang";
version = "15.4.0";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "glslang";
rev = version;
hash = "sha256-sPc+G7/ua7LQ7scuSvqWs7Q7Q+gFvXQ5wGQsEXbWH6w=";
};
outputs = [
"bin"
"out"
"dev"
];
# 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
];
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
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 -p $dev/include/External
moveToOutput lib/pkgconfig "''${!outputDev}"
moveToOutput lib/cmake "''${!outputDev}"
'';
# Fix the paths in .pc, even though it's unclear if these .pc are really useful.
postFixup = ''
substituteInPlace $dev/lib/pkgconfig/*.pc \
--replace-fail '=''${prefix}//' '=/' \
--replace-fail "includedir=$dev/$dev" "includedir=$dev"
# add a symlink for backwards compatibility
ln -s $bin/bin/glslang $bin/bin/glslangValidator
'';
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 ];
};
}