Unverified Commit b6d56993 authored by Colin's avatar Colin Committed by GitHub
Browse files

perlPackages.ExtUtilsPkgConfig: fix pkg-config use for cross (#397047)

parents 5fa3af9c c7e1962f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -12667,16 +12667,23 @@ with self;
      hash = "sha256-u+rO2ZXX2NEM/FGjpaZtpBzrK8BP7cq1DhDmMA6AHG4=";
    };
    nativeBuildInputs = [ buildPackages.pkg-config ];
    propagatedBuildInputs = [ pkgs.pkg-config ];
    propagatedNativeBuildInputs = [ pkgs.pkg-config ];
    postPatch = ''
      # no pkg-config binary when cross-compiling so the check fails
      substituteInPlace Makefile.PL \
        --replace "pkg-config" "$PKG_CONFIG"
      # use correctly prefixed pkg-config binary
      substituteInPlace lib/ExtUtils/PkgConfig.pm \
        --replace-fail '`pkg-config' '`${stdenv.cc.targetPrefix}pkg-config' \
        --replace-fail '"pkg-config' '"${stdenv.cc.targetPrefix}pkg-config' \
        --replace-fail '/pkg-config' '/${stdenv.cc.targetPrefix}pkg-config'
    '';
    doCheck = false; # expects test_glib-2.0.pc in PKG_CONFIG_PATH
    meta = {
      description = "Simplistic interface to pkg-config";
      homepage = "https://gitlab.gnome.org/GNOME/perl-extutils-pkgconfig";
      license = with lib.licenses; [ lgpl21Plus ];
      maintainers = [ lib.maintainers.fliegendewurst ];
    };
  };