From f0e142a4cde80c58487a9960bc5a7ce08b91a796 Mon Sep 17 00:00:00 2001 From: Ivan Trubach Date: Sun, 26 May 2024 03:35:00 +0300 Subject: [PATCH] gawk: move gawkbug to gawkInteractive This change removes gawkbug program from non-interactive build, similar to the bash{,Interactive} package. --- pkgs/tools/text/gawk/default.nix | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix index 8857fa29d1c63..941e102cb3b03 100644 --- a/pkgs/tools/text/gawk/default.nix +++ b/pkgs/tools/text/gawk/default.nix @@ -1,4 +1,5 @@ { lib, stdenv, fetchurl +, removeReferencesTo , runtimeShellPackage # TODO: links -lsigsegv but loses the reference for some reason , withSigsegv ? (false && stdenv.hostPlatform.system != "x86_64-cygwin"), libsigsegv @@ -36,15 +37,25 @@ stdenv.mkDerivation rec { outputs = [ "out" "info" ] ++ lib.optional (!interactive) "man"; + strictDeps = true; + # no-pma fix - nativeBuildInputs = [ autoreconfHook ] - ++ lib.optional (doCheck && stdenv.isLinux) glibcLocales; + nativeBuildInputs = [ + autoreconfHook + ] ++ lib.optionals interactive [ + removeReferencesTo + ] ++ lib.optionals (doCheck && stdenv.isLinux) [ + glibcLocales + ]; - buildInputs = [ + buildInputs = lib.optionals interactive [ runtimeShellPackage - ] ++ lib.optional withSigsegv libsigsegv - ++ lib.optional interactive readline - ++ lib.optional stdenv.isDarwin locale; + readline + ] ++ lib.optionals withSigsegv [ + libsigsegv + ] ++ lib.optionals stdenv.isDarwin [ + locale + ]; configureFlags = [ (if withSigsegv then "--with-libsigsegv-prefix=${libsigsegv}" else "--without-libsigsegv") @@ -57,7 +68,12 @@ stdenv.mkDerivation rec { inherit doCheck; - postInstall = '' + postInstall = (if interactive then '' + remove-references-to -t "$NIX_CC" "$out"/bin/gawkbug + patchShebangs --host "$out"/bin/gawkbug + '' else '' + rm "$out"/bin/gawkbug + '') + '' rm "$out"/bin/gawk-* ln -s gawk.1 "''${!outputMan}"/share/man/man1/awk.1 '';