diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix index 100c2b439075..a38251557c09 100644 --- a/pkgs/tools/text/groff/default.nix +++ b/pkgs/tools/text/groff/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchurl, fetchpatch, perl -, ghostscript #for postscript and html output -, psutils, netpbm #for html output +, enableGhostscript ? false, ghostscript # for postscript and html output +, enableHtml ? false, psutils, netpbm # for html output , buildPackages , autoreconfHook , pkg-config @@ -38,11 +38,9 @@ stdenv.mkDerivation rec { # BASH_PROG gets replaced with a path to the build bash which doesn't get automatically patched by patchShebangs substituteInPlace contrib/gdiffmk/gdiffmk.sh \ --replace "@BASH_PROG@" "/bin/sh" - '' + lib.optionalString (psutils != null) '' - substituteInPlace src/preproc/html/pre-html.cpp \ - --replace "psselect" "${psutils}/bin/psselect" - '' + lib.optionalString (netpbm != null) '' + '' + lib.optionalString enableHtml '' substituteInPlace src/preproc/html/pre-html.cpp \ + --replace "psselect" "${psutils}/bin/psselect" \ --replace "pnmcut" "${lib.getBin netpbm}/bin/pnmcut" \ --replace "pnmcrop" "${lib.getBin netpbm}/bin/pnmcrop" \ --replace "pnmtopng" "${lib.getBin netpbm}/bin/pnmtopng" @@ -53,8 +51,10 @@ stdenv.mkDerivation rec { ''; strictDeps = true; - buildInputs = [ ghostscript psutils netpbm perl bash ]; nativeBuildInputs = [ autoreconfHook pkg-config texinfo ]; + buildInputs = [ perl bash ] + ++ lib.optionals enableGhostscript [ ghostscript ] + ++ lib.optionals enableHtml [ psutils netpbm ]; # Builds running without a chroot environment may detect the presence # of /usr/X11 in the host system, leading to an impure build of the @@ -64,7 +64,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--without-x" "ac_cv_path_PERL=${buildPackages.perl}/bin/perl" - ] ++ lib.optionals (ghostscript != null) [ + ] ++ lib.optionals enableGhostscript [ "--with-gs=${ghostscript}/bin/gs" ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "gl_cv_func_signbit=yes" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a978d6810c52..c8a522f808b0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6979,11 +6979,7 @@ with pkgs; grive2 = callPackage ../tools/filesystems/grive2 { }; - groff = callPackage ../tools/text/groff { - ghostscript = null; - psutils = null; - netpbm = null; - }; + groff = callPackage ../tools/text/groff { }; gromit-mpx = callPackage ../tools/graphics/gromit-mpx { gtk = gtk3;