From 9b7f1a3913168bc9b9c070dbc9720dad1d06b49c Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Thu, 25 Jul 2024 21:37:05 -0700 Subject: [PATCH] glslang: add dev and lib outputs to prevent cross comp issues --- pkgs/development/compilers/glslang/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/glslang/default.nix b/pkgs/development/compilers/glslang/default.nix index 5fe11e35a434..fff581bae4f6 100644 --- a/pkgs/development/compilers/glslang/default.nix +++ b/pkgs/development/compilers/glslang/default.nix @@ -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; {