2023-10-09 19:29:22 +00:00
|
|
|
{ stdenv, lib, darwin, fetchFromGitHub, buildDunePackage, ocaml, cppo
|
|
|
|
, camlp-streams, dune-site
|
|
|
|
, version ? if lib.versionAtLeast ocaml.version "4.08" then "2.0.0" else "1.0.2"
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
let params =
|
|
|
|
{
|
|
|
|
"1.0.2" = lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
|
|
|
|
"camomile 1 is not available for OCaml ${ocaml.version}" {
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "yoriyuki";
|
|
|
|
repo = "camomile";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "00i910qjv6bpk0nkafp5fg97isqas0bwjf7m6rz11rsxilpalzad";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [ cppo ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
ocaml configure.ml --share $out/share/camomile
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
echo "version = \"${version}\"" >> $out/lib/ocaml/${ocaml.version}/site-lib/camomile/META
|
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
"2.0.0" = {
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocaml-community";
|
|
|
|
repo = "camomile";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-HklX+VPD0Ta3Knv++dBT2rhsDSlDRH90k4Cj1YtWIa8=";
|
|
|
|
};
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = lib.optional stdenv.isDarwin darwin.sigtool;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
propagatedBuildInputs = [ camlp-streams dune-site ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
; in
|
|
|
|
|
|
|
|
|
|
|
|
buildDunePackage (params."${version}" // {
|
|
|
|
pname = "camomile";
|
|
|
|
inherit version;
|
2022-03-10 19:12:11 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = {
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://github.com/ocaml-community/Camomile";
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = [ lib.maintainers.vbgl ];
|
|
|
|
license = lib.licenses.lgpl21;
|
|
|
|
description = "A Unicode library for OCaml";
|
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|