1{
2 lib,
3 stdenv,
4 fetchurl,
5 gmp,
6 mpfr,
7 updateAutotoolsGnuConfigScriptsHook,
8}:
9
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.
14
15stdenv.mkDerivation rec {
16 pname = "libmpc";
17 version = "1.3.1"; # to avoid clash with the MPD client
18
19 src = fetchurl {
20 url = "mirror://gnu/mpc/mpc-${version}.tar.gz";
21 sha256 = "sha256-q2QkkvXPiCt0qgy3MM1BCoHtzb7IlRg86TDnBsHHWbg=";
22 };
23
24 strictDeps = true;
25 enableParallelBuilding = true;
26
27 buildInputs = [
28 gmp
29 mpfr
30 ];
31 nativeBuildInputs = [
32 # needed until config scripts are updated to not use /usr/bin/uname on FreeBSD native
33 updateAutotoolsGnuConfigScriptsHook
34 ];
35
36 doCheck = true; # not cross;
37
38 meta = {
39 description = "Library for multiprecision complex arithmetic with exact rounding";
40
41 longDescription = ''
42 GNU MPC is a C library for the arithmetic of complex numbers with
43 arbitrarily high precision and correct rounding of the result. It is
44 built upon and follows the same principles as GNU MPFR.
45 '';
46
47 homepage = "https://www.multiprecision.org/mpc/";
48 license = lib.licenses.lgpl2Plus;
49
50 platforms = lib.platforms.all;
51 maintainers = [ ];
52 };
53}