summary refs log tree commit diff
path: root/pkgs/development/libraries/gmp/5.1.x.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/gmp/5.1.x.nix')
-rw-r--r--pkgs/development/libraries/gmp/5.1.x.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/development/libraries/gmp/5.1.x.nix b/pkgs/development/libraries/gmp/5.1.x.nix
index 573b7cbe2ee..ae8ae7c0f18 100644
--- a/pkgs/development/libraries/gmp/5.1.x.nix
+++ b/pkgs/development/libraries/gmp/5.1.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4, cxx ? true, withStatic ? false }:
+{ stdenv, fetchurl, m4, cxx ? true, withStatic ? true }:
 
 with { inherit (stdenv.lib) optional; };
 
@@ -14,20 +14,26 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ m4 ];
 
+  patches = if stdenv.isDarwin then [ ./need-size-t.patch ] else null;
+
   configureFlags =
     # Build a "fat binary", with routines for several sub-architectures
     # (x86), except on Solaris where some tests crash with "Memory fault".
     # See <http://hydra.nixos.org/build/2760931>, for instance.
+    #
+    # no darwin because gmp uses ASM that clang doesn't like
     optional (!stdenv.isSunOS) "--enable-fat"
     ++ (if cxx then [ "--enable-cxx"  ]
                else [ "--disable-cxx" ])
     ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions"
+    ++ optional stdenv.isDarwin "ABI=64"
     ++ optional stdenv.is64bit "--with-pic"
     ;
-  dontDisableStatic = withStatic;
 
   doCheck = true;
 
+  dontDisableStatic = withStatic;
+
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
@@ -61,4 +67,3 @@ stdenv.mkDerivation rec {
     maintainers = [ maintainers.simons ];
   };
 }
-