groff: Enable cross-compilation

authored by Ben Gamari and committed by Will Dietz 4f3c8178 46c2e619

+45
+6
pkgs/tools/text/groff/default.nix
··· 2 2 , ghostscript #for postscript and html output 3 3 , psutils, netpbm #for html output 4 4 , buildPackages 5 + , autoreconfHook 5 6 }: 6 7 7 8 stdenv.mkDerivation rec { ··· 16 17 outputs = [ "out" "man" "doc" "info" "perl" ]; 17 18 18 19 enableParallelBuilding = false; 20 + 21 + patches = [ ./look-for-ar.patch ]; 19 22 20 23 postPatch = stdenv.lib.optionalString (psutils != null) '' 21 24 substituteInPlace src/preproc/html/pre-html.cpp \ ··· 32 35 ''; 33 36 34 37 buildInputs = [ ghostscript psutils netpbm perl ]; 38 + nativeBuildInputs = [ autoreconfHook ]; 35 39 36 40 # Builds running without a chroot environment may detect the presence 37 41 # of /usr/X11 in the host system, leading to an impure build of the ··· 42 46 "--without-x" 43 47 ] ++ stdenv.lib.optionals (ghostscript != null) [ 44 48 "--with-gs=${ghostscript}/bin/gs" 49 + ] ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ 50 + "ac_cv_path_PERL=${perl}/bin/perl" 45 51 ]; 46 52 47 53 doCheck = true;
+39
pkgs/tools/text/groff/look-for-ar.patch
··· 1 + commit 988a001f969262089579958827652da00fda096f 2 + Author: Ben Gamari <ben@smart-cactus.org> 3 + Date: Tue Oct 17 16:15:20 2017 -0400 4 + 5 + Look for AR 6 + 7 + diff --git a/Makefile.in b/Makefile.in 8 + index bc156ce..cc02126 100644 9 + --- a/Makefile.in 10 + +++ b/Makefile.in 11 + @@ -464,7 +464,7 @@ INSTALL_SCRIPT=@INSTALL_SCRIPT@ 12 + INSTALL_DATA=@INSTALL_DATA@ 13 + INSTALL_INFO=@INSTALL_INFO@ 14 + LN_S=@LN_S@ 15 + -AR=ar 16 + +AR=@AR@ 17 + ETAGS=etags 18 + ETAGSFLAGS= 19 + # Flag that tells etags to assume C++. 20 + diff --git a/configure.ac b/configure.ac 21 + index c779165..6d53f5e 100644 22 + --- a/configure.ac 23 + +++ b/configure.ac 24 + @@ -45,6 +45,7 @@ AC_PREREQ([2.62]) 25 + 26 + AC_CONFIG_HEADERS([src/include/config.h:src/include/config.hin]) 27 + AC_CONFIG_SRCDIR([src/roff/groff/groff.cpp]) 28 + +AC_CONFIG_MACRO_DIR([m4]) 29 + 30 + AC_USE_SYSTEM_EXTENSIONS 31 + 32 + @@ -73,6 +74,7 @@ GROFF_PROG_YACC 33 + GROFF_DOC_CHECK 34 + GROFF_MAKEINFO 35 + AC_PROG_RANLIB 36 + +AC_CHECK_TOOL([AR], [ar], [ar]) 37 + GROFF_INSTALL_SH 38 + GROFF_INSTALL_INFO 39 + AC_PROG_INSTALL