2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchzip, which, ocaml, findlib
|
2020-04-24 23:36:52 +00:00
|
|
|
, camlzip, extlib
|
|
|
|
}:
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.04"
|
2020-04-24 23:36:52 +00:00
|
|
|
then throw "javalib is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ocaml${ocaml.version}-javalib-${version}";
|
|
|
|
version = "3.2.1";
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/javalib-team/javalib/archive/v${version}.tar.gz";
|
|
|
|
sha256 = "1fkdaiiza145yv0r1cm0n2hsrr0rbn6b27vs66njgv405zwn3vbn";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ which ocaml findlib ];
|
|
|
|
|
|
|
|
patches = [ ./configure.sh.patch ./Makefile.config.example.patch ];
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
preConfigure = "patchShebangs ./configure.sh";
|
|
|
|
|
|
|
|
configureScript = "./configure.sh";
|
|
|
|
dontAddPrefix = "true";
|
2021-09-18 10:52:07 +00:00
|
|
|
dontAddStaticConfigureFlags = true;
|
|
|
|
configurePlatforms = [];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ camlzip extlib ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A library that parses Java .class files into OCaml data structures";
|
|
|
|
homepage = "https://javalib-team.github.io/javalib/";
|
|
|
|
license = licenses.lgpl3;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
};
|
|
|
|
}
|