1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 which,
6 ocaml,
7 findlib,
8 camlzip,
9 extlib,
10}:
11
12lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
13 "javalib is not available for OCaml ${ocaml.version}"
14
15 stdenv.mkDerivation
16 rec {
17 pname = "ocaml${ocaml.version}-javalib";
18 version = "3.2.2";
19
20 src = fetchFromGitHub {
21 owner = "javalib-team";
22 repo = "javalib";
23 rev = version;
24 hash = "sha256-XaI7GTU/O5UEWuYX4yqaIRmEoH7FuvCg/+gtKbE/P1s=";
25 };
26
27 nativeBuildInputs = [
28 which
29 ocaml
30 findlib
31 ];
32
33 strictDeps = true;
34
35 patches = [
36 ./configure.sh.patch
37 ./Makefile.config.example.patch
38 ];
39
40 createFindlibDestdir = true;
41
42 configureScript = "./configure.sh";
43 dontAddPrefix = "true";
44 dontAddStaticConfigureFlags = true;
45 configurePlatforms = [ ];
46
47 propagatedBuildInputs = [
48 camlzip
49 extlib
50 ];
51
52 meta = with lib; {
53 description = "Library that parses Java .class files into OCaml data structures";
54 homepage = "https://javalib-team.github.io/javalib/";
55 license = licenses.lgpl3;
56 maintainers = [ maintainers.vbgl ];
57 inherit (ocaml.meta) platforms;
58 };
59 }