nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 autoreconfHook,
6}:
7
8stdenv.mkDerivation (finalAttrs: {
9 pname = "mpdecimal";
10 version = "4.0.1";
11 outputs = [
12 "out"
13 "cxx"
14 "doc"
15 "dev"
16 ];
17
18 src = fetchurl {
19 url = "https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-${finalAttrs.version}.tar.gz";
20 hash = "sha256-ltM6u0uwBwx74P7UJGzThBYYgyX4IEaCFEcZOFRbGsg=";
21 };
22
23 nativeBuildInputs = [ autoreconfHook ];
24
25 enableParallelBuilding = true;
26
27 postInstall = ''
28 mkdir -p $cxx/lib
29 mv $out/lib/*c++* $cxx/lib
30
31 mkdir -p $dev/nix-support
32 echo -n $cxx >> $dev/nix-support/propagated-build-inputs
33 '';
34
35 meta = {
36 description = "Library for arbitrary precision decimal floating point arithmetic";
37
38 longDescription = ''
39 libmpdec is a fast C/C++ library for correctly-rounded arbitrary
40 precision decimal floating point arithmetic. It is a complete
41 implementation of Mike Cowlishaw/IBM's General Decimal Arithmetic
42 Specification. The full specification is available here:
43
44 http://speleotrove.com/decimal/
45
46 libmpdec will - with minor restrictions - also conform to the IEEE
47 754-2008 Standard for Floating-Point Arithmetic, provided that the
48 appropriate context parameters are set.
49
50 libmpdec++ is a complete implementation of the General Decimal Arithmetic
51 Specification. libmpdec++ is mostly a header library around libmpdec's C
52 functions.
53 '';
54
55 homepage = "https://www.bytereef.org/mpdecimal/index.html";
56
57 downloadPage = "https://www.bytereef.org/mpdecimal/download.html";
58
59 changelog = "https://www.bytereef.org/mpdecimal/changelog.html";
60
61 license = lib.licenses.bsd2;
62
63 maintainers = with lib.maintainers; [ kaction ];
64
65 platforms = lib.platforms.unix ++ lib.platforms.windows;
66 };
67})