summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorRam Kromberg <ramkromberg@mail.com>2016-09-12 18:26:28 +0300
committerRam Kromberg <ramkromberg@mail.com>2016-09-13 23:38:05 +0300
commit14e9972e497a07f83e97d91bb18d126d63e68ee5 (patch)
tree8bf8769b074a38fcab4959f3d2458969bf76e0a2 /pkgs/tools
parent77b9abf78c01d79320353d5f9c1d6d6ed3ef000b (diff)
downloadnixlib-14e9972e497a07f83e97d91bb18d126d63e68ee5.tar
nixlib-14e9972e497a07f83e97d91bb18d126d63e68ee5.tar.gz
nixlib-14e9972e497a07f83e97d91bb18d126d63e68ee5.tar.bz2
nixlib-14e9972e497a07f83e97d91bb18d126d63e68ee5.tar.lz
nixlib-14e9972e497a07f83e97d91bb18d126d63e68ee5.tar.xz
nixlib-14e9972e497a07f83e97d91bb18d126d63e68ee5.tar.zst
nixlib-14e9972e497a07f83e97d91bb18d126d63e68ee5.zip
groff: add missing depedencies for optional postscript and html outputs
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/text/groff/default.nix27
1 files changed, 24 insertions, 3 deletions
diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix
index 728e9de8b488..df6a1119800e 100644
--- a/pkgs/tools/text/groff/default.nix
+++ b/pkgs/tools/text/groff/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchurl, ghostscript, perl, groff }:
+{ stdenv, fetchurl, perl, groff
+, ghostscript #for postscript and html output
+, psutils, netpbm #for html output
+}:
 
 stdenv.mkDerivation rec {
   name = "groff-1.22.3";
@@ -12,7 +15,21 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = false;
 
-  buildInputs = [ ghostscript ];
+  postPatch = stdenv.lib.optionalString (psutils != null) ''
+    substituteInPlace src/preproc/html/pre-html.cpp \
+      --replace "psselect" "${psutils}/bin/psselect"
+  '' + stdenv.lib.optionalString (netpbm != null) ''
+    substituteInPlace src/preproc/html/pre-html.cpp \
+      --replace "pnmcut" "${netpbm}/bin/pnmcut" \
+      --replace "pnmcrop" "${netpbm}/bin/pnmcrop" \
+      --replace "pnmtopng" "${netpbm}/bin/pnmtopng"
+    substituteInPlace tmac/www.tmac \
+      --replace "pnmcrop" "${netpbm}/bin/pnmcrop" \
+      --replace "pngtopnm" "${netpbm}/bin/pngtopnm" \
+      --replace "@PNMTOPS_NOSETPAGE@" "${netpbm}/bin/pnmtops -nosetpage"
+  '';
+
+  buildInputs = [ ghostscript psutils netpbm ];
   nativeBuildInputs = [ perl ];
 
   # Builds running without a chroot environment may detect the presence
@@ -20,7 +37,11 @@ stdenv.mkDerivation rec {
   # package. To avoid this issue, X11 support is explicitly disabled.
   # Note: If we ever want to *enable* X11 support, then we'll probably
   # have to pass "--with-appresdir", too.
-  configureFlags = "--without-x";
+  configureFlags = [
+    "--without-x"
+  ] ++ stdenv.lib.optionals (ghostscript != null) [
+    "--with-gs=${ghostscript}/bin/gs"
+  ];
 
   doCheck = true;