Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gawk: move gawkbug to gawkInteractive #314720

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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