diff --git a/pkgs/by-name/tu/tup/package.nix b/pkgs/by-name/tu/tup/package.nix index 4bccae8ee432..88d66c069e4b 100644 --- a/pkgs/by-name/tu/tup/package.nix +++ b/pkgs/by-name/tu/tup/package.nix @@ -38,7 +38,19 @@ stdenv.mkDerivation rec { patches = [ ./fusermount-setuid.patch ]; configurePhase = '' - substituteInPlace src/tup/link.sh --replace '`git describe' '`echo ${version}' + substituteInPlace src/tup/link.sh --replace-fail '`git describe' '`echo ${version}' + + for path in Tupfile build.sh src/tup/server/Tupfile ; do + substituteInPlace $path --replace-fail "pkg-config" "${stdenv.cc.targetPrefix}pkg-config" + done + + # Replace "pcre2-config --libs8" => "pkg-config libpcre2-8 --libs". + # + # There is prefixed pkg-config for cross-compilation, but no prefixed "pcre2-config". + for path in Tupfile Tuprules.tup ; do + substituteInPlace $path --replace-fail "pcre2-config" "${stdenv.cc.targetPrefix}pkg-config libpcre2-8 " + done + substituteInPlace Tupfile --replace-fail "--libs8" "--libs" cat << EOF > tup.config CONFIG_CC=${stdenv.cc.targetPrefix}cc