tmuxPlugins.catppucin: unstable-2024-05-16 -> 2.1.2 (#379030)
[NixPkgs.git] / pkgs / by-name / mp / mpfr / package.nix
blob79de1ab9de9011cfad8692d09fabe341a778f3cd
2   lib,
3   stdenv,
4   fetchurl,
5   gmp,
6   writeScript,
7   updateAutotoolsGnuConfigScriptsHook,
8 }:
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
13 # files.
15 stdenv.mkDerivation rec {
16   version = "4.2.1";
17   pname = "mpfr";
19   src = fetchurl {
20     urls = [
21       "https://www.mpfr.org/${pname}-${version}/${pname}-${version}.tar.xz"
22       "mirror://gnu/mpfr/${pname}-${version}.tar.xz"
23     ];
24     hash = "sha256-J3gHNTpnJpeJlpRa8T5Sgp46vXqaW3+yeTiU4Y8fy7I=";
25   };
27   outputs = [
28     "out"
29     "dev"
30     "doc"
31     "info"
32   ];
34   strictDeps = true;
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 ];
41   configureFlags =
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"
48     ];
50   doCheck = true; # not cross;
52   enableParallelBuilding = true;
54   passthru = {
55     updateScript = writeScript "update-mpfr" ''
56       #!/usr/bin/env nix-shell
57       #!nix-shell -i bash -p curl pcre common-updater-scripts
59       set -eu -o pipefail
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"
65     '';
66   };
68   meta = {
69     homepage = "https://www.mpfr.org/";
70     description = "Library for multiple-precision floating-point arithmetic";
72     longDescription = ''
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).
82     '';
84     license = lib.licenses.lgpl2Plus;
86     maintainers = [ ];
87     platforms = lib.platforms.all;
88   };