nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 ocaml,
6 findlib,
7 ocamlbuild,
8 camlp4,
9}:
10
11let
12 pname = "ulex";
13 param =
14 if lib.versionAtLeast ocaml.version "4.02" then
15 {
16 version = "1.2";
17 sha256 = "08yf2x9a52l2y4savjqfjd2xy4pjd1rpla2ylrr9qrz1drpfw4ic";
18 }
19 else
20 {
21 version = "1.1";
22 sha256 = "0cmscxcmcxhlshh4jd0lzw5ffzns12x3bj7h27smbc8waxkwffhl";
23 };
24in
25stdenv.mkDerivation {
26 pname = "ocaml${ocaml.version}-${pname}";
27 inherit (param) version;
28
29 src = fetchFromGitHub {
30 owner = "ocaml-community";
31 repo = pname;
32 rev = "v${param.version}";
33 inherit (param) sha256;
34 };
35
36 createFindlibDestdir = true;
37
38 nativeBuildInputs = [
39 ocaml
40 findlib
41 ocamlbuild
42 camlp4
43 ];
44 propagatedBuildInputs = [ camlp4 ];
45
46 strictDeps = true;
47
48 buildFlags = [
49 "all"
50 "all.opt"
51 ];
52
53 meta = {
54 homepage = "https://opam.ocaml.org/packages/ulex/";
55 description = "Lexer generator for Unicode and OCaml";
56 license = lib.licenses.mit;
57 inherit (ocaml.meta) platforms;
58 maintainers = [ lib.maintainers.roconnor ];
59 broken = lib.versionAtLeast ocaml.version "5.0";
60 };
61}