2018-11-30 02:24:54 +00:00
|
|
|
{ stdenv, fetchzip, which, ocaml, findlib, camlp4
|
2018-08-14 13:53:30 +01:00
|
|
|
, camlzip, camomile, extlib
|
|
|
|
}:
|
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";
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2017-06-30 17:55:04 +01:00
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
2018-11-30 02:24:54 +00:00
|
|
|
version = "3.0";
|
2014-07-06 16:41:40 +01:00
|
|
|
|
2018-11-30 02:24:54 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/javalib-team/javalib/archive/v${version}.tar.gz";
|
|
|
|
sha256 = "02zgn1z1wj3rbg9xqmbagys91bnsy27iwrngkivzhlykyaw9vf6n";
|
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";
|
|
|
|
|
2018-08-14 13:53:30 +01:00
|
|
|
propagatedBuildInputs = [ camlzip camomile extlib ];
|
2014-07-06 16:41:40 +01:00
|
|
|
|
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";
|
2018-11-30 02:24:54 +00:00
|
|
|
homepage = https://javalib-team.github.io/javalib/;
|
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
|
|
|
};
|
|
|
|
}
|