summary refs log tree commit diff
path: root/pkgs/development/libraries/gmp
diff options
context:
space:
mode:
authorEric Seidel <gridaphobe@gmail.com>2015-02-03 14:58:42 -0800
committerEric Seidel <gridaphobe@gmail.com>2015-02-03 15:18:28 -0800
commitcbd446d46585908f596e2375a26ae15d1bdfd8a2 (patch)
treed87dc96617ab33a3d378b2654861a763d9705c96 /pkgs/development/libraries/gmp
parent4a467ec02bedf5ba811fc086e11cf41a51d45957 (diff)
downloadnixpkgs-cbd446d46585908f596e2375a26ae15d1bdfd8a2.tar
nixpkgs-cbd446d46585908f596e2375a26ae15d1bdfd8a2.tar.gz
nixpkgs-cbd446d46585908f596e2375a26ae15d1bdfd8a2.tar.bz2
nixpkgs-cbd446d46585908f596e2375a26ae15d1bdfd8a2.tar.lz
nixpkgs-cbd446d46585908f596e2375a26ae15d1bdfd8a2.tar.xz
nixpkgs-cbd446d46585908f596e2375a26ae15d1bdfd8a2.tar.zst
nixpkgs-cbd446d46585908f596e2375a26ae15d1bdfd8a2.zip
fix gmp on darwin
Diffstat (limited to 'pkgs/development/libraries/gmp')
-rw-r--r--pkgs/development/libraries/gmp/5.1.x.nix2
-rw-r--r--pkgs/development/libraries/gmp/need-size-t.patch18
2 files changed, 20 insertions, 0 deletions
diff --git a/pkgs/development/libraries/gmp/5.1.x.nix b/pkgs/development/libraries/gmp/5.1.x.nix
index e9495b796dd..5e1282c1d50 100644
--- a/pkgs/development/libraries/gmp/5.1.x.nix
+++ b/pkgs/development/libraries/gmp/5.1.x.nix
@@ -12,6 +12,8 @@ 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".
diff --git a/pkgs/development/libraries/gmp/need-size-t.patch b/pkgs/development/libraries/gmp/need-size-t.patch
new file mode 100644
index 00000000000..c4ba086182a
--- /dev/null
+++ b/pkgs/development/libraries/gmp/need-size-t.patch
@@ -0,0 +1,18 @@
+diff --git a/gmp-h.in b/gmp-h.in
+index 7deb67a..240d663 100644
+--- a/gmp-h.in
++++ b/gmp-h.in
+@@ -46,13 +46,11 @@ along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.  */
+ #ifndef __GNU_MP__
+ #define __GNU_MP__ 5
+ 
+-#define __need_size_t  /* tell gcc stddef.h we only want size_t */
+ #if defined (__cplusplus)
+ #include <cstddef>     /* for size_t */
+ #else
+ #include <stddef.h>    /* for size_t */
+ #endif
+-#undef __need_size_t
+ 
+ /* Instantiated by configure. */
+ #if ! defined (__GMP_WITHIN_CONFIGURE)