2021-10-28 06:52:43 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild
|
2021-01-05 17:05:55 +00:00
|
|
|
, buildDunePackage
|
|
|
|
}:
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
|
|
|
pname = "cppo";
|
2021-01-05 17:05:55 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-05 17:05:55 +00: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 = "https://github.com/ocaml-community/${pname}";
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
if lib.versionAtLeast ocaml.version "4.02" then
|
2021-01-05 17:05:55 +00:00
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
inherit pname;
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "1.6.9";
|
2021-01-05 17:05:55 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
duneVersion = "3";
|
2021-01-05 17:05:55 +00:00
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocaml-community";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-NdN2QnVRfRq9hEcSAnO2Wha7icDlf2Zg4JQqoEWmErE=";
|
2021-01-05 17:05:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
doCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
inherit meta;
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
let version = "1.5.0"; in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
|
|
|
|
name = "${pname}-${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mjambon";
|
|
|
|
repo = pname;
|
2021-01-05 17:05:55 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1xqldjz9risndnabvadw41fdbi5sa2hl4fnqls7j9xfbby1izbg8";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
inherit meta;
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
|
|
|
preBuild = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
mkdir -p $out/bin
|
2021-01-05 17:05:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
}
|