Skip to content

Commit

Permalink
gawk: move gawkbug to gawkInteractive
Browse files Browse the repository at this point in the history
This change removes gawkbug program from non-interactive build, similar
to the bash{,Interactive} package.
  • Loading branch information
tie committed Aug 14, 2024
1 parent 2677781 commit f0e142a
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions pkgs/tools/text/gawk/default.nix
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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
'';
Expand Down

0 comments on commit f0e142a

Please sign in to comment.