From c68aa532d68df512a657608a02ef7400b7087873 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 17 Oct 2017 15:46:27 -0400 Subject: [PATCH] glib: Allow cross compilation tweaked to handle non-glibc along with others --- pkgs/development/libraries/glib/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index c0cf864e79a..656cdffbb4c 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -75,8 +75,13 @@ stdenv.mkDerivation rec { # internal pcre would only add <200kB, but it's relatively common configureFlags = [ "--with-pcre=system" ] ++ optional stdenv.isDarwin "--disable-compile-warnings" - ++ optional (stdenv.isFreeBSD || stdenv.isSunOS) "--with-libiconv=gnu" - ++ optional stdenv.isSunOS "--disable-dtrace"; + ++ optional (stdenv.hostPlatform.libc != "glibc") "--with-libiconv=gnu" + ++ optional stdenv.isSunOS "--disable-dtrace" + # Can't run this test when cross-compiling + ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) + [ "glib_cv_stack_grows=no" "glib_cv_uscore=no" ] + # GElf only supports elf64 hosts + ++ optional (!stdenv.hostPlatform.is64bit) "--disable-libelf"; NIX_CFLAGS_COMPILE = optional stdenv.isDarwin "-lintl" ++ optional stdenv.isSunOS "-DBSD_COMP";