diff options
author | Ben Gamari <ben@smart-cactus.org> | 2017-12-10 00:17:26 -0500 |
---|---|---|
committer | Will Dietz <w@wdtz.org> | 2018-02-13 09:44:28 -0600 |
commit | 4f3c8178b8e5eef920c31b030cd89591deb2417d (patch) | |
tree | 8d8bae8952d1a589e2b5b4f9dca85f835f2e45e2 /pkgs/tools/text/groff | |
parent | 46c2e619e856ad679ae41005e8ba2a9dac39ff77 (diff) |
groff: Enable cross-compilation
Diffstat (limited to 'pkgs/tools/text/groff')
-rw-r--r-- | pkgs/tools/text/groff/default.nix | 6 | ||||
-rw-r--r-- | pkgs/tools/text/groff/look-for-ar.patch | 39 |
2 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix index b11f3cb4b8cd..6d01c42f93d1 100644 --- a/pkgs/tools/text/groff/default.nix +++ b/pkgs/tools/text/groff/default.nix @@ -2,6 +2,7 @@ , ghostscript #for postscript and html output , psutils, netpbm #for html output , buildPackages +, autoreconfHook }: stdenv.mkDerivation rec { @@ -17,6 +18,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = false; + patches = [ ./look-for-ar.patch ]; + postPatch = stdenv.lib.optionalString (psutils != null) '' substituteInPlace src/preproc/html/pre-html.cpp \ --replace "psselect" "${psutils}/bin/psselect" @@ -32,6 +35,7 @@ stdenv.mkDerivation rec { ''; buildInputs = [ ghostscript psutils netpbm perl ]; + nativeBuildInputs = [ autoreconfHook ]; # Builds running without a chroot environment may detect the presence # of /usr/X11 in the host system, leading to an impure build of the @@ -42,6 +46,8 @@ stdenv.mkDerivation rec { "--without-x" ] ++ stdenv.lib.optionals (ghostscript != null) [ "--with-gs=${ghostscript}/bin/gs" + ] ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + "ac_cv_path_PERL=${perl}/bin/perl" ]; doCheck = true; diff --git a/pkgs/tools/text/groff/look-for-ar.patch b/pkgs/tools/text/groff/look-for-ar.patch new file mode 100644 index 000000000000..3b4d09c260fa --- /dev/null +++ b/pkgs/tools/text/groff/look-for-ar.patch @@ -0,0 +1,39 @@ +commit 988a001f969262089579958827652da00fda096f +Author: Ben Gamari <ben@smart-cactus.org> +Date: Tue Oct 17 16:15:20 2017 -0400 + + Look for AR + +diff --git a/Makefile.in b/Makefile.in +index bc156ce..cc02126 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -464,7 +464,7 @@ INSTALL_SCRIPT=@INSTALL_SCRIPT@ + INSTALL_DATA=@INSTALL_DATA@ + INSTALL_INFO=@INSTALL_INFO@ + LN_S=@LN_S@ +-AR=ar ++AR=@AR@ + ETAGS=etags + ETAGSFLAGS= + # Flag that tells etags to assume C++. +diff --git a/configure.ac b/configure.ac +index c779165..6d53f5e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -45,6 +45,7 @@ AC_PREREQ([2.62]) + + AC_CONFIG_HEADERS([src/include/config.h:src/include/config.hin]) + AC_CONFIG_SRCDIR([src/roff/groff/groff.cpp]) ++AC_CONFIG_MACRO_DIR([m4]) + + AC_USE_SYSTEM_EXTENSIONS + +@@ -73,6 +74,7 @@ GROFF_PROG_YACC + GROFF_DOC_CHECK + GROFF_MAKEINFO + AC_PROG_RANLIB ++AC_CHECK_TOOL([AR], [ar], [ar]) + GROFF_INSTALL_SH + GROFF_INSTALL_INFO + AC_PROG_INSTALL |