2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, buildDunePackage
|
|
|
|
, ocaml
|
|
|
|
, gen
|
|
|
|
, ppxlib
|
|
|
|
, uchar
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-09-22 12:36:57 +00:00
|
|
|
unicodeVersion = "15.0.0";
|
2022-06-16 17:23:12 +00:00
|
|
|
baseUrl = "https://www.unicode.org/Public/${unicodeVersion}";
|
|
|
|
|
|
|
|
DerivedCoreProperties = fetchurl {
|
|
|
|
url = "${baseUrl}/ucd/DerivedCoreProperties.txt";
|
2022-09-22 12:36:57 +00:00
|
|
|
sha256 = "sha256-02cpC8CGfmtITGg3BTC90aCLazJARgG4x6zK+D4FYo0=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
DerivedGeneralCategory = fetchurl {
|
|
|
|
url = "${baseUrl}/ucd/extracted/DerivedGeneralCategory.txt";
|
2022-09-22 12:36:57 +00:00
|
|
|
sha256 = "sha256-/imkXAiCUA5ZEUCqpcT1Bn5qXXRoBhSK80QAxIucBvk=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
PropList = fetchurl {
|
|
|
|
url = "${baseUrl}/ucd/PropList.txt";
|
2022-09-22 12:36:57 +00:00
|
|
|
sha256 = "sha256-4FwKKBHRE9rkq9gyiEGZo+qNGH7huHLYJAp4ipZUC/0=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "sedlex";
|
|
|
|
version = "2.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
minimalOCamlVersion = "4.08";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ocaml-community";
|
|
|
|
repo = "sedlex";
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256:062a5dvrzvb81l3a9phljrhxfw9nlb61q341q0a6xn65hll3z2wy";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
gen uchar ppxlib
|
|
|
|
];
|
2022-03-05 16:20:37 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
preBuild = ''
|
|
|
|
rm src/generator/data/dune
|
|
|
|
ln -s ${DerivedCoreProperties} src/generator/data/DerivedCoreProperties.txt
|
|
|
|
ln -s ${DerivedGeneralCategory} src/generator/data/DerivedGeneralCategory.txt
|
|
|
|
ln -s ${PropList} src/generator/data/PropList.txt
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
doCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/ocaml-community/sedlex";
|
2022-06-16 17:23:12 +00:00
|
|
|
changelog = "https://github.com/ocaml-community/sedlex/raw/v${version}/CHANGES";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An OCaml lexer generator for Unicode";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.mit;
|
2022-06-16 17:23:12 +00:00
|
|
|
maintainers = [ lib.maintainers.marsam ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|