From 2870c99cef39d8eecd17d01acb00479cf579b2c9 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Wed, 25 Oct 2017 15:44:19 -0400 Subject: [PATCH] autogen: Enable cross-compilation --- .../tools/misc/autogen/default.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/autogen/default.nix b/pkgs/development/tools/misc/autogen/default.nix index 28034f9d5492..77944297a972 100644 --- a/pkgs/development/tools/misc/autogen/default.nix +++ b/pkgs/development/tools/misc/autogen/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, which, pkgconfig, perl, guile, libxml2 }: +{ stdenv, buildPackages, fetchurl, which, pkgconfig, texinfo, perl, guile, libxml2 }: stdenv.mkDerivation rec { name = "autogen-${version}"; @@ -11,8 +11,21 @@ stdenv.mkDerivation rec { outputs = [ "bin" "dev" "lib" "out" "man" "info" ]; - nativeBuildInputs = [ which pkgconfig perl ]; - buildInputs = [ guile libxml2 ]; + nativeBuildInputs = [ which pkgconfig perl ] + # autogen needs a build autogen when cross-compiling + ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + buildPackages.autogen buildPackages.texinfo ]; + buildInputs = [ + guile libxml2 + ]; + + configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--with-libxml2=${libxml2.dev}" + "--with-libxml2-cflags=-I${libxml2.dev}/include/libxml2" + # the configure check for regcomp wants to run a host program + "libopts_cv_with_libregex=yes" + #"MAKEINFO=${buildPackages.texinfo}/bin/makeinfo" + ]; postPatch = '' # Fix a broken sed expression used for detecting the minor