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