about summary refs log tree commit diff
path: root/pkgs/tools/misc/man-db
diff options
context:
space:
mode:
authorDavHau <hsngrmpf+github@gmail.com>2021-04-29 16:06:52 +0700
committerYt <raphael@megzari.com>2022-04-17 13:22:08 -0400
commit6f6daf3a6a5be74b70ba2bd270ff19824824c3a5 (patch)
treee178ffa469ae3c665bf40d9f60532675cb994167 /pkgs/tools/misc/man-db
parent7408ce3c7074ac10ce4daf4870c0389de97a31e5 (diff)
man-db: add support for zstd
Diffstat (limited to 'pkgs/tools/misc/man-db')
-rw-r--r--pkgs/tools/misc/man-db/default.nix16
-rw-r--r--pkgs/tools/misc/man-db/fix-configure.patch13
2 files changed, 28 insertions, 1 deletions
diff --git a/pkgs/tools/misc/man-db/default.nix b/pkgs/tools/misc/man-db/default.nix
index 6a3bca4047124..e5364ab4f5760 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 0000000000000..5c528de9f04d5
--- /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"