diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2017-08-24 10:57:50 +0200 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2017-08-24 11:06:53 +0200 |
commit | 8137a8cb73833432e8da8281663b56ac01d3ba0b (patch) | |
tree | 668c15897c9d23a41ef5ec908caa33ac3558caf6 /pkgs/tools/text/gawk/default.nix | |
parent | 2fc7651b2584fe7b248fe0d93a6e9f58ba8a42d2 (diff) | |
download | nixpkgs-8137a8cb73833432e8da8281663b56ac01d3ba0b.tar nixpkgs-8137a8cb73833432e8da8281663b56ac01d3ba0b.tar.gz nixpkgs-8137a8cb73833432e8da8281663b56ac01d3ba0b.tar.bz2 nixpkgs-8137a8cb73833432e8da8281663b56ac01d3ba0b.tar.lz nixpkgs-8137a8cb73833432e8da8281663b56ac01d3ba0b.tar.xz nixpkgs-8137a8cb73833432e8da8281663b56ac01d3ba0b.tar.zst nixpkgs-8137a8cb73833432e8da8281663b56ac01d3ba0b.zip |
gawk: refactor
- Don't build with libsigsegv by default. The build apparently attempted to link against it, but it never retained the reference anyway... - Side effect: stdenv bootstrapping needs no libsigsegv anymore. - Run checks, but only in the interactive gawk by default on Linux, so that stdenv bootstrap isn't slowed down (by glibc locales, etc.). - xz should be no longer needed in inputs, as we have it in stdenvs now. The whole change was triggered by some used kernel versions still breaking libsigsegv tests #28464.
Diffstat (limited to 'pkgs/tools/text/gawk/default.nix')
-rw-r--r-- | pkgs/tools/text/gawk/default.nix | 66 |
1 files changed, 37 insertions, 29 deletions
diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix index dec7af04525..415a2ade28d 100644 --- a/pkgs/tools/text/gawk/default.nix +++ b/pkgs/tools/text/gawk/default.nix @@ -1,5 +1,19 @@ -{ stdenv, fetchurl, xz, libsigsegv, readline, interactive ? false -, locale ? null }: +{ stdenv, fetchurl +# TODO: links -lsigsegv but loses the reference for some reason +, withSigsegv ? (false && stdenv.system != "x86_64-cygwin"), libsigsegv +, interactive ? false, readline + +/* Test suite broke on: + stdenv.isCygwin # XXX: `test-dup2' segfaults on Cygwin 6.1 + || stdenv.isDarwin # XXX: `locale' segfaults + || stdenv.isSunOS # XXX: `_backsmalls1' fails, locale stuff? + || stdenv.isFreeBSD +*/ +, doCheck ? (interactive && stdenv.isLinux), glibcLocales ? null +, locale ? null +}: + +assert (doCheck && stdenv.isLinux) -> glibcLocales != null; let inherit (stdenv.lib) optional; @@ -13,36 +27,30 @@ stdenv.mkDerivation rec { }; # When we do build separate interactive version, it makes sense to always include man. - outputs = [ "out" "info" ] ++ stdenv.lib.optional (!interactive) "man"; + outputs = [ "out" "info" ] ++ optional (!interactive) "man"; - # FIXME: 4.1.4 testsuite breaks when only C locales are available - doCheck = false /*!( - stdenv.isCygwin # XXX: `test-dup2' segfaults on Cygwin 6.1 - || stdenv.isDarwin # XXX: `locale' segfaults - || stdenv.isSunOS # XXX: `_backsmalls1' fails, locale stuff? - || stdenv.isFreeBSD - )*/; + nativeBuildInputs = optional (doCheck && stdenv.isLinux) glibcLocales; - nativeBuildInputs = [ xz.bin ]; buildInputs = - stdenv.lib.optional (stdenv.system != "x86_64-cygwin") libsigsegv - ++ stdenv.lib.optional interactive readline - ++ stdenv.lib.optional stdenv.isDarwin locale; - - configureFlags = stdenv.lib.optional (stdenv.system != "x86_64-cygwin") "--with-libsigsegv-prefix=${libsigsegv}" - ++ [(if interactive then "--with-readline=${readline.dev}" else "--without-readline")]; - - postInstall = - if interactive then - '' - rm "$out"/bin/gawk-* - ln -s gawk.1 "''${!outputMan}"/share/man/man1/awk.1 - '' - else # TODO: remove this other branch on a stdenv rebuild - '' - rm $out/bin/gawk-* - ln -s $man/share/man/man1/gawk.1 $man/share/man/man1/awk.1 - ''; + optional withSigsegv libsigsegv + ++ optional interactive readline + ++ optional stdenv.isDarwin locale; + + configureFlags = [ + (if withSigsegv then "--with-libsigsegv-prefix=${libsigsegv}" else "--without-libsigsegv") + (if interactive then "--with-readline=${readline.dev}" else "--without-readline") + ]; + + inherit doCheck; + + postInstall = '' + rm "$out"/bin/gawk-* + ln -s gawk.1 "''${!outputMan}"/share/man/man1/awk.1 + ''; + + passthru = { + libsigsegv = if withSigsegv then libsigsegv else null; # for stdenv bootstrap + }; meta = with stdenv.lib; { homepage = http://www.gnu.org/software/gawk/; |