1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 20:21:14 +00:00
nixpkgs/pkgs/development/ocaml-modules/mtime/default.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

2017-12-14 07:36:29 +00:00
{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, js_of_ocaml
, jsooSupport ? lib.versionAtLeast ocaml.version "4.03"
}:
2017-04-11 17:08:51 +01:00
with lib;
let param =
if versionAtLeast ocaml.version "4.03"
then {
2019-08-19 16:43:08 +01:00
version = "1.2.0";
sha256 = "0zm1jvqkz3ghznfsm3bbv9q2zinp9grggdf7k9phjazjvny68xb8";
} else {
version = "0.8.4";
sha256 = "1adm8sc3lkjly99hyi5gqnxas748k7h62ljgn8x423nkn8gyp8dh";
};
in
stdenv.mkDerivation {
name = "ocaml${ocaml.version}-mtime-${param.version}";
src = fetchurl {
url = "https://erratique.ch/software/mtime/releases/mtime-${param.version}.tbz";
inherit (param) sha256;
};
nativeBuildInputs = [ ocaml findlib ocamlbuild ];
buildInputs = [ findlib topkg ]
++ optional jsooSupport js_of_ocaml;
buildPhase = "${topkg.buildPhase} --with-js_of_ocaml ${boolToString jsooSupport}";
inherit (topkg) installPhase;
meta = {
description = "Monotonic wall-clock time for OCaml";
homepage = "https://erratique.ch/software/mtime";
inherit (ocaml.meta) platforms;
2017-04-11 17:08:51 +01:00
maintainers = [ maintainers.vbgl ];
license = licenses.bsd3;
};
}