From 6f6daf3a6a5be74b70ba2bd270ff19824824c3a5 Mon Sep 17 00:00:00 2001 From: DavHau Date: Thu, 29 Apr 2021 16:06:52 +0700 Subject: [PATCH] man-db: add support for zstd --- pkgs/tools/misc/man-db/default.nix | 16 +++++++++++++++- pkgs/tools/misc/man-db/fix-configure.patch | 13 +++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 pkgs/tools/misc/man-db/fix-configure.patch diff --git a/pkgs/tools/misc/man-db/default.nix b/pkgs/tools/misc/man-db/default.nix index 6a3bca404712..e5364ab4f576 100644 --- a/pkgs/tools/misc/man-db/default.nix +++ b/pkgs/tools/misc/man-db/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "doc" ]; outputMan = "out"; # users will want `man man` to work - nativeBuildInputs = [ pkg-config makeWrapper groff ]; + nativeBuildInputs = [ autoconf automake gettext groff libtool makeWrapper pkg-config zstd ]; buildInputs = [ libpipeline db groff ]; # (Yes, 'groff' is both native and build input) checkInputs = [ libiconv /* for 'iconv' binary */ ]; @@ -28,6 +28,12 @@ stdenv.mkDerivation rec { # Add mandb locations for the above echo "MANDB_MAP /nix/var/nix/profiles/default/share/man /var/cache/man/nixpkgs" >> src/man_db.conf.in + + # use absolute paths to reference programs, otherwise artifacts will have undeclared dependencies + for f in configure.ac m4/man-check-progs.m4 m4/man-po4a.m4; do + substituteInPlace $f \ + --replace AC_CHECK_PROGS AC_PATH_PROGS + done ''; configureFlags = [ @@ -44,7 +50,15 @@ stdenv.mkDerivation rec { "ac_cv_func_mempcpy=no" ]; + preConfigure = '' + # need to recreate configure script due to substitutions in postPatch + ./bootstrap --gnulib-srcdir=${gnulib.src} --no-git + + # deal with autoconf 2.70 bug: https://lists.gnu.org/archive/html/bug-autoconf/2020-12/msg00036.html + # can be removed once autoconf 2.71 is merged + patch < ${./fix-configure.patch} + configureFlagsArray+=("--with-sections=1 n l 8 3 0 2 5 4 9 6 7") ''; diff --git a/pkgs/tools/misc/man-db/fix-configure.patch b/pkgs/tools/misc/man-db/fix-configure.patch new file mode 100644 index 000000000000..5c528de9f04d --- /dev/null +++ b/pkgs/tools/misc/man-db/fix-configure.patch @@ -0,0 +1,13 @@ +--- configure 2021-04-29 09:58:14.430422095 +0000 ++++ configure 2021-04-29 09:58:46.783454349 +0000 +@@ -6018,8 +6018,9 @@ + return 0; + } + _ACEOF ++ ++ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + for ac_arg in '' ac_prog_cc_stdc=c89 +- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"