7 updateAutotoolsGnuConfigScriptsHook,
10 # Note: this package is used for bootstrapping fetchurl, and thus
11 # cannot use fetchpatch! All mutable patches (generated by GitHub or
12 # cgit) that are needed here should be included directly in Nixpkgs as
15 stdenv.mkDerivation rec {
21 "https://www.mpfr.org/${pname}-${version}/${pname}-${version}.tar.xz"
22 "mirror://gnu/mpfr/${pname}-${version}.tar.xz"
24 hash = "sha256-J3gHNTpnJpeJlpRa8T5Sgp46vXqaW3+yeTiU4Y8fy7I=";
35 # necessary to build on FreeBSD native pending inclusion of
36 # https://git.savannah.gnu.org/cgit/config.git/commit/?id=e4786449e1c26716e3f9ea182caf472e4dbc96e0
37 nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
38 # mpfr.h requires gmp.h
39 propagatedBuildInputs = [ gmp ];
42 lib.optional stdenv.hostPlatform.isSunOS "--disable-thread-safe"
43 ++ lib.optional stdenv.hostPlatform.is64bit "--with-pic"
44 ++ lib.optionals stdenv.hostPlatform.isPower64 [
45 # Without this, the `tget_set_d128` test experiences a link
46 # error due to missing `__dpd_trunctdkf`.
47 "--disable-decimal-float"
50 doCheck = true; # not cross;
52 enableParallelBuilding = true;
55 updateScript = writeScript "update-mpfr" ''
56 #!/usr/bin/env nix-shell
57 #!nix-shell -i bash -p curl pcre common-updater-scripts
61 # Expect the text in format of '<title>GNU MPFR version 4.1.1</title>'
62 new_version="$(curl -s https://www.mpfr.org/mpfr-current/ |
63 pcregrep -o1 '<title>GNU MPFR version ([0-9.]+)</title>')"
64 update-source-version ${pname} "$new_version"
69 homepage = "https://www.mpfr.org/";
70 description = "Library for multiple-precision floating-point arithmetic";
73 The GNU MPFR library is a C library for multiple-precision
74 floating-point computations with correct rounding. MPFR is
75 based on the GMP multiple-precision library.
77 The main goal of MPFR is to provide a library for
78 multiple-precision floating-point computation which is both
79 efficient and has a well-defined semantics. It copies the good
80 ideas from the ANSI/IEEE-754 standard for double-precision
81 floating-point arithmetic (53-bit mantissa).
84 license = lib.licenses.lgpl2Plus;
87 platforms = lib.platforms.all;