summary refs log tree commit diff
path: root/pkgs/development/libraries/gmp
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2014-07-06 13:37:46 +0200
committerPeter Simons <simons@cryp.to>2014-07-12 15:12:05 +0200
commit7c5a1b1d5178b69833f7df77ae7192df464897e4 (patch)
tree232e9ee7585a7901bafe7f7a41b10b49ae56ff28 /pkgs/development/libraries/gmp
parent38c290174185af0cbd177827aed99cc0b729777c (diff)
downloadnixlib-7c5a1b1d5178b69833f7df77ae7192df464897e4.tar
nixlib-7c5a1b1d5178b69833f7df77ae7192df464897e4.tar.gz
nixlib-7c5a1b1d5178b69833f7df77ae7192df464897e4.tar.bz2
nixlib-7c5a1b1d5178b69833f7df77ae7192df464897e4.tar.lz
nixlib-7c5a1b1d5178b69833f7df77ae7192df464897e4.tar.xz
nixlib-7c5a1b1d5178b69833f7df77ae7192df464897e4.tar.zst
nixlib-7c5a1b1d5178b69833f7df77ae7192df464897e4.zip
haskellPackages: use static-enabled 'gmp' to enable statically linked Haskell binaries
Pass '-optl-static -optl-pthread' to GHC to enable static linking.

Fixes <https://github.com/NixOS/nixpkgs/issues/3193>. Further details can be
found at <http://permalink.gmane.org/gmane.linux.distributions.nixos/13526>.
Diffstat (limited to 'pkgs/development/libraries/gmp')
-rw-r--r--pkgs/development/libraries/gmp/5.1.x.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/pkgs/development/libraries/gmp/5.1.x.nix b/pkgs/development/libraries/gmp/5.1.x.nix
index cba8d394c2ba..9e28334804bd 100644
--- a/pkgs/development/libraries/gmp/5.1.x.nix
+++ b/pkgs/development/libraries/gmp/5.1.x.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, m4, cxx ? true }:
+{ stdenv, fetchurl, m4, cxx ? true, withStatic ? false }:
 
 with { inherit (stdenv.lib) optional; };
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (rec {
   name = "gmp-5.1.3";
 
   src = fetchurl { # we need to use bz2, others aren't in bootstrapping stdenv
@@ -27,10 +27,10 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = "http://gmplib.org/";
     description = "GMP, the GNU multiple precision arithmetic library";
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = licenses.gpl3Plus;
 
     longDescription =
       '' GMP is a free library for arbitrary precision arithmetic, operating
@@ -54,7 +54,10 @@ stdenv.mkDerivation rec {
          asymptotically faster algorithms.
       '';
 
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = platforms.all;
+    maintainers = [ maintainers.simons ];
   };
 }
+  // stdenv.lib.optionalAttrs withStatic { dontDisableStatic = true; }
+)
+