nixpkgs/pkgs/development/ocaml-modules/dtoa/default.nix

33 lines
973 B
Nix
Raw Normal View History

2018-09-05 17:11:47 +01:00
{ stdenv, fetchurl, ocaml, findlib, dune }:
2018-01-01 09:43:27 +00:00
assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.01";
stdenv.mkDerivation rec {
pname = "dtoa";
name = "ocaml-${pname}-${version}";
version = "0.3.1";
src = fetchurl {
url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
sha256 = "0rzysj07z2q6gk0yhjxnjnba01vmdb9x32wwna10qk3rrb8r2pnn";
};
unpackCmd = "tar xjf $src";
2018-09-05 17:11:47 +01:00
buildInputs = [ ocaml findlib dune ];
2018-01-01 09:43:27 +00:00
2018-09-05 17:11:47 +01:00
buildPhase = "dune build -p dtoa";
2018-01-01 09:43:27 +00:00
2018-09-05 17:11:47 +01:00
inherit (dune) installPhase;
2018-01-01 09:43:27 +00:00
hardeningDisable = stdenv.lib.optional stdenv.isDarwin "strictoverflow";
2018-01-01 09:43:27 +00:00
meta = with stdenv.lib; {
homepage = https://github.com/flowtype/ocaml-dtoa;
description = "Converts OCaml floats into strings (doubles to ascii, \"d to a\"), using the efficient Grisu3 algorithm.";
license = licenses.mit;
platforms = ocaml.meta.platforms or [];
maintainers = [ maintainers.eqyiel ];
};
}