diff options
Diffstat (limited to 'pkgs/development/ocaml-modules/sedlex/default.nix')
-rw-r--r-- | pkgs/development/ocaml-modules/sedlex/default.nix | 64 |
1 files changed, 45 insertions, 19 deletions
diff --git a/pkgs/development/ocaml-modules/sedlex/default.nix b/pkgs/development/ocaml-modules/sedlex/default.nix index 685d4426cfc..0a18424acac 100644 --- a/pkgs/development/ocaml-modules/sedlex/default.nix +++ b/pkgs/development/ocaml-modules/sedlex/default.nix @@ -1,37 +1,63 @@ -{ stdenv, lib, fetchFromGitHub, ocaml, findlib, gen, ppx_tools_versioned, ocaml-migrate-parsetree }: - -if lib.versionOlder ocaml.version "4.02" -then throw "sedlex is not available for OCaml ${ocaml.version}" -else +{ lib +, fetchFromGitHub +, fetchurl +, buildDunePackage +, ocaml +, gen +, ppxlib +, uchar +}: + +let + unicodeVersion = "14.0.0"; + baseUrl = "https://www.unicode.org/Public/${unicodeVersion}"; + + DerivedCoreProperties = fetchurl { + url = "${baseUrl}/ucd/DerivedCoreProperties.txt"; + sha256 = "sha256:1g77s8g9443dd92f82pbkim7rk51s7xdwa3mxpzb1lcw8ryxvvg3"; + }; + DerivedGeneralCategory = fetchurl { + url = "${baseUrl}/ucd/extracted/DerivedGeneralCategory.txt"; + sha256 = "sha256:080l3bwwppm7gnyga1hzhd07b55viklimxpdsx0fsxhr8v47krnd"; + }; + PropList = fetchurl { + url = "${baseUrl}/ucd/PropList.txt"; + sha256 = "sha256:08k75jzl7ws9l3sm1ywsj24qa4qvzn895wggdpp5nyj1a2wgvpbb"; + }; +in +buildDunePackage rec { + pname = "sedlex"; + version = "2.5"; -stdenv.mkDerivation rec { - pname = "ocaml${ocaml.version}-sedlex"; - version = "1.99.5"; + minimalOCamlVersion = "4.08"; src = fetchFromGitHub { owner = "ocaml-community"; repo = "sedlex"; - rev = "fb84e1766fc4b29e79ec40029ffee5cdb37b392f"; - sha256 = "sha256-VhzlDTYBFXgKWT69PqZYLuHkiaDwzhmyX2XfaqzHFl4="; + rev = "v${version}"; + sha256 = "sha256:062a5dvrzvb81l3a9phljrhxfw9nlb61q341q0a6xn65hll3z2wy"; }; - nativeBuildInputs = [ ocaml findlib ]; - - propagatedBuildInputs = [ gen ocaml-migrate-parsetree ppx_tools_versioned ]; - - strictDeps = true; + propagatedBuildInputs = [ + gen uchar ppxlib + ]; - buildFlags = [ "all" "opt" ]; + 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 + ''; - createFindlibDestdir = true; + doCheck = true; dontStrip = true; meta = { homepage = "https://github.com/ocaml-community/sedlex"; + changelog = "https://github.com/ocaml-community/sedlex/raw/v${version}/CHANGES"; description = "An OCaml lexer generator for Unicode"; license = lib.licenses.mit; - inherit (ocaml.meta) platforms; - maintainers = [ lib.maintainers.vbgl ]; + maintainers = [ lib.maintainers.marsam ]; }; } |