about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/mpdecimal/default.nix
blob: 3a2e4b1fe7d096a6fa21f4b08d689d4be341682b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ lib, stdenv, fetchurl }:

stdenv.mkDerivation rec {
  pname = "mpdecimal";
  version = "2.5.1";
  outputs = [ "out" "cxx" "doc" "dev" ];

  src = fetchurl {
    url = "https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-${version}.tar.gz";
    hash = "sha256-n5zUwEH5m1xJ/7e1nZ8S2VtoPYhYVgiqVqYwdmeysh8=";
  };

  configureFlags = [ "LD=${stdenv.cc.targetPrefix}cc" ];

  postInstall = ''
    mkdir -p $cxx/lib
    mv $out/lib/*c++* $cxx/lib

    mkdir -p $dev/nix-support
    echo -n $cxx >> $dev/nix-support/propagated-build-inputs
  '';

  meta = {
    description = "Library for arbitrary precision decimal floating point arithmetic";

    longDescription =  ''
      libmpdec is a fast C/C++ library for correctly-rounded arbitrary
      precision decimal floating point arithmetic.  It is a complete
      implementation of Mike Cowlishaw/IBM's General Decimal Arithmetic
      Specification. The full specification is available here:

      http://speleotrove.com/decimal/

      libmpdec will - with minor restrictions - also conform to the IEEE
      754-2008 Standard for Floating-Point Arithmetic, provided that the
      appropriate context parameters are set.

      libmpdec++ is a complete implementation of the General Decimal Arithmetic
      Specification.  libmpdec++ is mostly a header library around libmpdec's C
      functions.
    '';

    homepage = "https://www.bytereef.org/mpdecimal/index.html";

    downloadPage = "https://www.bytereef.org/mpdecimal/download.html";

    changelog = "https://www.bytereef.org/mpdecimal/changelog.html";

    license = lib.licenses.bsd2;

    maintainers = with lib.maintainers; [ kaction ];

    platforms = lib.platforms.unix;
  };
}