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
13 stdenv.mkDerivation rec {
19 "https://www.mpfr.org/${pname}-${version}/${pname}-${version}.tar.xz"
20 "mirror://gnu/mpfr/${pname}-${version}.tar.xz"
22 hash = "sha256-J3gHNTpnJpeJlpRa8T5Sgp46vXqaW3+yeTiU4Y8fy7I=";
25 outputs = [ "out" "dev" "doc" "info" ];
28 # mpfr.h requires gmp.h
29 propagatedBuildInputs = [ gmp ];
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"
39 doCheck = true; # not cross;
41 enableParallelBuilding = true;
44 updateScript = writeScript "update-mpfr" ''
45 #!/usr/bin/env nix-shell
46 #!nix-shell -i bash -p curl pcre common-updater-scripts
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"
58 homepage = "https://www.mpfr.org/";
59 description = "Library for multiple-precision floating-point arithmetic";
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.
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).
73 license = lib.licenses.lgpl2Plus;
76 platforms = lib.platforms.all;