autogen: Enable cross-compilation

authored by Ben Gamari and committed by Will Dietz 2870c99c f5e96d3e

+16 -3
+16 -3
pkgs/development/tools/misc/autogen/default.nix
··· 1 - { stdenv, fetchurl, which, pkgconfig, perl, guile, libxml2 }: 1 + { stdenv, buildPackages, fetchurl, which, pkgconfig, texinfo, perl, guile, libxml2 }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 name = "autogen-${version}"; ··· 11 11 12 12 outputs = [ "bin" "dev" "lib" "out" "man" "info" ]; 13 13 14 - nativeBuildInputs = [ which pkgconfig perl ]; 15 - buildInputs = [ guile libxml2 ]; 14 + nativeBuildInputs = [ which pkgconfig perl ] 15 + # autogen needs a build autogen when cross-compiling 16 + ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 17 + buildPackages.autogen buildPackages.texinfo ]; 18 + buildInputs = [ 19 + guile libxml2 20 + ]; 21 + 22 + configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 23 + "--with-libxml2=${libxml2.dev}" 24 + "--with-libxml2-cflags=-I${libxml2.dev}/include/libxml2" 25 + # the configure check for regcomp wants to run a host program 26 + "libopts_cv_with_libregex=yes" 27 + #"MAKEINFO=${buildPackages.texinfo}/bin/makeinfo" 28 + ]; 16 29 17 30 postPatch = '' 18 31 # Fix a broken sed expression used for detecting the minor