lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 16.09-beta 79 lines 3.1 kB view raw
1{ stdenv, fetchurl, m4, cxx ? true, withStatic ? false }: 2 3with { inherit (stdenv.lib) optional optionalString; }; 4 5let self = stdenv.mkDerivation rec { 6 name = "gmp-6.1.1"; 7 8 src = fetchurl { # we need to use bz2, others aren't in bootstrapping stdenv 9 urls = [ "mirror://gnu/gmp/${name}.tar.bz2" "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.bz2" ]; 10 sha256 = "1mpzprdzkgfpdc1v2lf4dxlxps4x8bvmzvd8n1ri6gw9y9jrh458"; 11 }; 12 13 #outputs TODO: split $cxx due to libstdc++ dependency 14 # maybe let ghc use a version with *.so shared with rest of nixpkgs and *.a added 15 # - see #5855 for related discussion 16 outputs = [ "out" "dev" "info" ]; 17 passthru.static = self.out; 18 19 nativeBuildInputs = [ m4 ]; 20 21 configureFlags = 22 # Build a "fat binary", with routines for several sub-architectures 23 # (x86), except on Solaris where some tests crash with "Memory fault". 24 # See <http://hydra.nixos.org/build/2760931>, for instance. 25 # 26 # no darwin because gmp uses ASM that clang doesn't like 27 optional (!stdenv.isSunOS) "--enable-fat" 28 ++ (if cxx then [ "--enable-cxx" ] 29 else [ "--disable-cxx" ]) 30 ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions" 31 ++ optional stdenv.isDarwin "ABI=64" 32 ++ optional stdenv.is64bit "--with-pic" 33 ; 34 35 # The config.guess in GMP tries to runtime-detect various 36 # ARM optimization flags via /proc/cpuinfo (and is also 37 # broken on multicore CPUs). Avoid this impurity. 38 preConfigure = optionalString stdenv.isArm '' 39 configureFlagsArray+=("--build=$(./configfsf.guess)") 40 ''; 41 42 doCheck = true; 43 44 dontDisableStatic = withStatic; 45 46 enableParallelBuilding = true; 47 48 meta = with stdenv.lib; { 49 homepage = "http://gmplib.org/"; 50 description = "GNU multiple precision arithmetic library"; 51 license = licenses.gpl3Plus; 52 53 longDescription = 54 '' GMP is a free library for arbitrary precision arithmetic, operating 55 on signed integers, rational numbers, and floating point numbers. 56 There is no practical limit to the precision except the ones implied 57 by the available memory in the machine GMP runs on. GMP has a rich 58 set of functions, and the functions have a regular interface. 59 60 The main target applications for GMP are cryptography applications 61 and research, Internet security applications, algebra systems, 62 computational algebra research, etc. 63 64 GMP is carefully designed to be as fast as possible, both for small 65 operands and for huge operands. The speed is achieved by using 66 fullwords as the basic arithmetic type, by using fast algorithms, 67 with highly optimised assembly code for the most common inner loops 68 for a lot of CPUs, and by a general emphasis on speed. 69 70 GMP is faster than any other bignum library. The advantage for GMP 71 increases with the operand sizes for many operations, since GMP uses 72 asymptotically faster algorithms. 73 ''; 74 75 platforms = platforms.all; 76 maintainers = [ maintainers.peti maintainers.vrthra ]; 77 }; 78}; 79 in self