Unverified Commit 9b7f1a39 authored by Tristan Ross's avatar Tristan Ross
Browse files

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

parent 4f660376
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -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; {