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