2014-09-22 23:24:28 +01:00
|
|
|
{stdenv, fetchurl, which, ocaml, findlib, camlzip, extlib, camlp4}:
|
2016-10-05 08:32:30 +01:00
|
|
|
|
2017-06-30 17:55:04 +01:00
|
|
|
if !stdenv.lib.versionAtLeast ocaml.version "4"
|
|
|
|
then throw "javalib not supported for ocaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2014-07-06 16:41:40 +01:00
|
|
|
let
|
|
|
|
pname = "javalib";
|
|
|
|
webpage = "http://sawja.inria.fr/";
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2017-06-30 17:55:04 +01:00
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
|
|
|
version = "2.3.3";
|
2014-07-06 16:41:40 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-06-30 17:55:04 +01:00
|
|
|
url = https://gforge.inria.fr/frs/download.php/file/36307/javalib-2.3.3.tar.bz2;
|
|
|
|
sha256 = "0427n3vfb2h51gy2p4878gdwlp0mb03asn3g9kp9v4wfxmksjj11";
|
2014-07-06 16:41:40 +01:00
|
|
|
};
|
|
|
|
|
2014-09-22 23:24:28 +01:00
|
|
|
buildInputs = [ which ocaml findlib camlp4 ];
|
2014-07-06 16:41:40 +01:00
|
|
|
|
|
|
|
patches = [ ./configure.sh.patch ./Makefile.config.example.patch ];
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2015-01-08 09:26:49 +00:00
|
|
|
preConfigure = "patchShebangs ./configure.sh";
|
|
|
|
|
2014-07-06 16:41:40 +01:00
|
|
|
configureScript = "./configure.sh";
|
|
|
|
dontAddPrefix = "true";
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
make ptrees;
|
|
|
|
make installptrees;
|
2016-10-05 08:32:30 +01:00
|
|
|
export OCAMLPATH=$out/lib/ocaml/${ocaml.version}/site-lib/:$OCAMLPATH;
|
2014-07-06 16:41:40 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ camlzip extlib ];
|
|
|
|
|
2014-09-21 11:02:55 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-07-06 16:41:40 +01:00
|
|
|
description = "A library that parses Java .class files into OCaml data structures";
|
|
|
|
homepage = "${webpage}";
|
2014-09-21 11:02:55 +01:00
|
|
|
license = licenses.lgpl3;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-07-06 16:41:40 +01:00
|
|
|
};
|
|
|
|
}
|