1{stdenv, fetchurl, which, ocaml, findlib, camlzip, extlib, camlp4}:
2let
3 pname = "javalib";
4 version = "2.3";
5 webpage = "http://sawja.inria.fr/";
6 ocaml_version = (builtins.parseDrvName ocaml.name).version;
7in
8stdenv.mkDerivation rec {
9
10 name = "ocaml-${pname}-${version}";
11
12 src = fetchurl {
13 url = "https://gforge.inria.fr/frs/download.php/33090/${pname}-${version}.tar.bz2";
14 sha256 = "1i8djcanzm250mwilm3jfy37cz0k0x7jbnrz8a5vvdi91kyzh52j";
15 };
16
17 buildInputs = [ which ocaml findlib camlp4 ];
18
19 patches = [ ./configure.sh.patch ./Makefile.config.example.patch ];
20
21 createFindlibDestdir = true;
22
23 preConfigure = "patchShebangs ./configure.sh";
24
25 configureScript = "./configure.sh";
26 dontAddPrefix = "true";
27
28 preBuild = ''
29 make ptrees;
30 make installptrees;
31 export OCAMLPATH=$out/lib/ocaml/${ocaml_version}/site-lib/:$OCAMLPATH;
32 '';
33
34 propagatedBuildInputs = [ camlzip extlib ];
35
36 meta = with stdenv.lib; {
37 description = "A library that parses Java .class files into OCaml data structures";
38 homepage = "${webpage}";
39 license = licenses.lgpl3;
40 maintainers = [ maintainers.vbgl ];
41 platforms = ocaml.meta.platforms or [];
42 };
43}