groff: Enable cross-compilation

This commit is contained in:
Ben Gamari 2017-12-10 00:17:26 -05:00 committed by Will Dietz
parent 46c2e619e8
commit 4f3c8178b8
2 changed files with 45 additions and 0 deletions

View File

@ -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;

View File

@ -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