git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #18541 from RamKromberg/fix/groff

groff: add missing depedencies for optional postscript and html outputs

commit642a42875f8434a5acdf70e8621ea61d09848cf2 authorPeter Simons <simons@cryp.to> dateWed 14 Sep 2016, 09:54 (10 years ago) parentee4c47614e9972
2 files changed+26−3
pkgs/tools/text/groff/default.nix+24−3 pkgs/top-level/all-packages.nix+2
pkgs/tools/text/groff/default.nix+24−3
@@ -1,4 +1,7 @@
1−{ stdenv, fetchurl, ghostscript, perl, groff }:
1+{ stdenv, fetchurl, perl, groff
2+, ghostscript #for postscript and html output
3+, psutils, netpbm #for html output
4+}:
25
36stdenv.mkDerivation rec {
47 name = "groff-1.22.3";
@@ -12,7 +15,21 @@ stdenv.mkDerivation rec {
1215
1316 enableParallelBuilding = false;
1417
15− buildInputs = [ ghostscript ];
18+ postPatch = stdenv.lib.optionalString (psutils != null) ''
19+ substituteInPlace src/preproc/html/pre-html.cpp \
20+ --replace "psselect" "${psutils}/bin/psselect"
21+ '' + stdenv.lib.optionalString (netpbm != null) ''
22+ substituteInPlace src/preproc/html/pre-html.cpp \
23+ --replace "pnmcut" "${netpbm}/bin/pnmcut" \
24+ --replace "pnmcrop" "${netpbm}/bin/pnmcrop" \
25+ --replace "pnmtopng" "${netpbm}/bin/pnmtopng"
26+ substituteInPlace tmac/www.tmac \
27+ --replace "pnmcrop" "${netpbm}/bin/pnmcrop" \
28+ --replace "pngtopnm" "${netpbm}/bin/pngtopnm" \
29+ --replace "@PNMTOPS_NOSETPAGE@" "${netpbm}/bin/pnmtops -nosetpage"
30+ '';
31+
32+ buildInputs = [ ghostscript psutils netpbm ];
1633 nativeBuildInputs = [ perl ];
1734
1835 # Builds running without a chroot environment may detect the presence
@@ -20,7 +37,11 @@ stdenv.mkDerivation rec {
2037 # package. To avoid this issue, X11 support is explicitly disabled.
2138 # Note: If we ever want to *enable* X11 support, then we'll probably
2239 # have to pass "--with-appresdir", too.
23− configureFlags = "--without-x";
40+ configureFlags = [
41+ "--without-x"
42+ ] ++ stdenv.lib.optionals (ghostscript != null) [
43+ "--with-gs=${ghostscript}/bin/gs"
44+ ];
2445
2546 doCheck = true;
2647
pkgs/top-level/all-packages.nix+2
@@ -1902,6 +1902,8 @@ in
19021902
19031903 groff = callPackage ../tools/text/groff {
19041904 ghostscript = null;
1905+ psutils = null;
1906+ netpbm = null;
19051907 };
19061908
19071909 groonga = callPackage ../servers/search/groonga { };