2018-09-05 17:11:47 +01:00
|
|
|
{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, dune }:
|
2014-06-25 09:25:14 +01:00
|
|
|
let
|
|
|
|
pname = "cppo";
|
2019-11-16 00:41:23 +00:00
|
|
|
webpage = "https://github.com/ocaml-community/${pname}";
|
2014-06-25 09:25:14 +01:00
|
|
|
in
|
2017-04-28 17:10:41 +01:00
|
|
|
assert stdenv.lib.versionAtLeast ocaml.version "3.12";
|
2014-06-25 09:25:14 +01:00
|
|
|
|
2018-06-24 23:47:53 +01:00
|
|
|
let param =
|
2020-04-02 05:55:38 +01:00
|
|
|
if stdenv.lib.versionAtLeast ocaml.version "4.02" then
|
|
|
|
(if stdenv.lib.versionAtLeast ocaml.version "4.03" then {
|
|
|
|
version = "1.6.6";
|
|
|
|
sha256 = "1smcc0l6fh2n0y6bp96c69j5nw755jja99w0b206wx3yb2m4w2hs";
|
|
|
|
} else {
|
2020-01-04 14:00:00 +00:00
|
|
|
version = "1.6.5";
|
|
|
|
sha256 = "03c0amszy28shinvz61hm340jz446zz5763a1pdqlza36kwcj0p0";
|
2020-04-02 05:55:38 +01:00
|
|
|
}) // {
|
2018-09-05 17:11:47 +01:00
|
|
|
buildInputs = [ dune ];
|
2018-06-24 23:47:53 +01:00
|
|
|
extra = {
|
2018-09-05 17:11:47 +01:00
|
|
|
inherit (dune) installPhase;
|
2018-06-24 23:47:53 +01:00
|
|
|
};
|
|
|
|
} else {
|
|
|
|
version = "1.5.0";
|
|
|
|
sha256 = "1xqldjz9risndnabvadw41fdbi5sa2hl4fnqls7j9xfbby1izbg8";
|
|
|
|
extra = {
|
|
|
|
createFindlibDestdir = true;
|
2019-10-27 13:03:25 +00:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
2018-06-24 23:47:53 +01:00
|
|
|
preBuild = ''
|
|
|
|
mkdir $out/bin
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|
|
|
|
; in
|
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation ({
|
2018-06-24 23:47:53 +01:00
|
|
|
|
|
|
|
name = "${pname}-${param.version}";
|
2014-06-25 09:25:14 +01:00
|
|
|
|
2016-05-22 16:22:25 +01:00
|
|
|
src = fetchFromGitHub {
|
2020-01-04 14:00:00 +00:00
|
|
|
owner = "mjambon";
|
2016-05-22 16:22:25 +01:00
|
|
|
repo = pname;
|
2018-06-24 23:47:53 +01:00
|
|
|
rev = "v${param.version}";
|
|
|
|
inherit (param) sha256;
|
2014-06-25 09:25:14 +01:00
|
|
|
};
|
|
|
|
|
2018-06-24 23:47:53 +01:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ] ++ (param.buildInputs or []);
|
2014-06-25 09:25:14 +01:00
|
|
|
|
2014-09-21 11:02:55 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-06-25 09:25:14 +01:00
|
|
|
description = "The C preprocessor for OCaml";
|
|
|
|
longDescription = ''
|
|
|
|
Cppo is an equivalent of the C preprocessor targeted at the OCaml language and its variants.
|
|
|
|
'';
|
2019-09-09 00:38:31 +01:00
|
|
|
homepage = webpage;
|
2014-09-21 11:02:55 +01:00
|
|
|
maintainers = [ maintainers.vbgl ];
|
|
|
|
license = licenses.bsd3;
|
2014-06-25 09:25:14 +01:00
|
|
|
};
|
2018-06-24 23:47:53 +01:00
|
|
|
} // param.extra)
|