at 23.11-beta 78 lines 2.3 kB view raw
1{ lib 2, stdenv 3, fetchurl 4, gmp 5, writeScript 6}: 7 8# Note: this package is used for bootstrapping fetchurl, and thus 9# cannot use fetchpatch! All mutable patches (generated by GitHub or 10# cgit) that are needed here should be included directly in Nixpkgs as 11# files. 12 13stdenv.mkDerivation rec { 14 version = "4.2.1"; 15 pname = "mpfr"; 16 17 src = fetchurl { 18 urls = [ 19 "https://www.mpfr.org/${pname}-${version}/${pname}-${version}.tar.xz" 20 "mirror://gnu/mpfr/${pname}-${version}.tar.xz" 21 ]; 22 hash = "sha256-J3gHNTpnJpeJlpRa8T5Sgp46vXqaW3+yeTiU4Y8fy7I="; 23 }; 24 25 outputs = [ "out" "dev" "doc" "info" ]; 26 27 strictDeps = true; 28 # mpfr.h requires gmp.h 29 propagatedBuildInputs = [ gmp ]; 30 31 configureFlags = lib.optional stdenv.hostPlatform.isSunOS "--disable-thread-safe" 32 ++ lib.optional stdenv.hostPlatform.is64bit "--with-pic" 33 ++ lib.optionals stdenv.hostPlatform.isPower64 [ 34 # Without this, the `tget_set_d128` test experiences a link 35 # error due to missing `__dpd_trunctdkf`. 36 "--disable-decimal-float" 37 ]; 38 39 doCheck = true; # not cross; 40 41 enableParallelBuilding = true; 42 43 passthru = { 44 updateScript = writeScript "update-mpfr" '' 45 #!/usr/bin/env nix-shell 46 #!nix-shell -i bash -p curl pcre common-updater-scripts 47 48 set -eu -o pipefail 49 50 # Expect the text in format of '<title>GNU MPFR version 4.1.1</title>' 51 new_version="$(curl -s https://www.mpfr.org/mpfr-current/ | 52 pcregrep -o1 '<title>GNU MPFR version ([0-9.]+)</title>')" 53 update-source-version ${pname} "$new_version" 54 ''; 55 }; 56 57 meta = { 58 homepage = "https://www.mpfr.org/"; 59 description = "Library for multiple-precision floating-point arithmetic"; 60 61 longDescription = '' 62 The GNU MPFR library is a C library for multiple-precision 63 floating-point computations with correct rounding. MPFR is 64 based on the GMP multiple-precision library. 65 66 The main goal of MPFR is to provide a library for 67 multiple-precision floating-point computation which is both 68 efficient and has a well-defined semantics. It copies the good 69 ideas from the ANSI/IEEE-754 standard for double-precision 70 floating-point arithmetic (53-bit mantissa). 71 ''; 72 73 license = lib.licenses.lgpl2Plus; 74 75 maintainers = [ ]; 76 platforms = lib.platforms.all; 77 }; 78}