about summary refs log tree commit diff
path: root/pkgs/development/libraries/glib
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-10-17 15:46:27 -0400
committerWill Dietz <w@wdtz.org>2018-01-24 09:33:37 -0600
commitc68aa532d68df512a657608a02ef7400b7087873 (patch)
tree3884a1566a014e773aa1d6979a0e0bbd431fef0a /pkgs/development/libraries/glib
parent2060f547dffed412c6df38b8c4dcb4088fea0024 (diff)
downloadnixlib-c68aa532d68df512a657608a02ef7400b7087873.tar
nixlib-c68aa532d68df512a657608a02ef7400b7087873.tar.gz
nixlib-c68aa532d68df512a657608a02ef7400b7087873.tar.bz2
nixlib-c68aa532d68df512a657608a02ef7400b7087873.tar.lz
nixlib-c68aa532d68df512a657608a02ef7400b7087873.tar.xz
nixlib-c68aa532d68df512a657608a02ef7400b7087873.tar.zst
nixlib-c68aa532d68df512a657608a02ef7400b7087873.zip
glib: Allow cross compilation
tweaked to handle non-glibc along with others
Diffstat (limited to 'pkgs/development/libraries/glib')
-rw-r--r--pkgs/development/libraries/glib/default.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index c0cf864e79a0..656cdffbb4c7 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";