Skip to content

Commit

Permalink
Merge pull request #314720 from tie/remove-gawkbug
Browse files Browse the repository at this point in the history
gawk: move gawkbug to gawkInteractive
  • Loading branch information
philiptaron authored Aug 14, 2024
2 parents 8a97770 + f0e142a commit fa70b50
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 fa70b50

Please sign in to comment.