Merge pull request #330065 from ExpidusOS/feat/glslang/outputs

glslang: add dev and lib outputs to prevent cross comp issues
This commit is contained in:
Atemu
2024-08-04 22:51:29 +02:00
committed by GitHub
@@ -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; {