glslang: add dev and lib outputs to prevent cross comp issues

This commit is contained in:
Tristan Ross 2024-07-25 21:37:05 -07:00
parent 4f6603762b
commit 9b7f1a3913
No known key found for this signature in database
GPG Key ID: B09C422035669AF8

View File

@ -18,6 +18,8 @@ stdenv.mkDerivation rec {
hash = "sha256-slKBFq6NyWHQmJq/YR3LmbGnHyZgRg0hej90tZDOGzA=";
};
outputs = [ "bin" "out" "dev" ];
# These get set at all-packages, keep onto them for child drvs
passthru = {
spirv-tools = spirv-tools;
@ -33,16 +35,19 @@ stdenv.mkDerivation rec {
# This is a dirty fix for lib/cmake/SPIRVTargets.cmake:51 which includes this directory
postInstall = ''
mkdir $out/include/External
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 $out/lib/pkgconfig/*.pc \
--replace '=''${prefix}//' '=/'
substituteInPlace $dev/lib/pkgconfig/*.pc \
--replace-fail '=''${prefix}//' '=/' \
--replace-fail "includedir=$dev/$dev" "includedir=$dev"
# add a symlink for backwards compatibility
ln -s $out/bin/glslang $out/bin/glslangValidator
ln -s $dev/bin/glslang $dev/bin/glslangValidator
'';
meta = with lib; {