2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchzip, which, ocaml, findlib
|
2019-08-20 04:45:46 +00:00
|
|
|
, camlzip, extlib
|
2018-08-14 12:53:30 +00:00
|
|
|
}:
|
2016-10-05 07:32:30 +00:00
|
|
|
|
2021-01-11 12:49:15 +00:00
|
|
|
if !lib.versionAtLeast ocaml.version "4.04"
|
2019-08-20 04:45:46 +00:00
|
|
|
then throw "javalib is not available for OCaml ${ocaml.version}"
|
2017-06-30 16:55:04 +00:00
|
|
|
else
|
|
|
|
|
2014-07-06 15:41:40 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-20 04:45:46 +00:00
|
|
|
name = "ocaml${ocaml.version}-javalib-${version}";
|
2020-02-21 08:18:51 +00:00
|
|
|
version = "3.2.1";
|
2014-07-06 15:41:40 +00:00
|
|
|
|
2018-11-30 02:24:54 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/javalib-team/javalib/archive/v${version}.tar.gz";
|
2020-02-21 08:18:51 +00:00
|
|
|
sha256 = "1fkdaiiza145yv0r1cm0n2hsrr0rbn6b27vs66njgv405zwn3vbn";
|
2014-07-06 15:41:40 +00:00
|
|
|
};
|
|
|
|
|
2019-08-20 04:45:46 +00:00
|
|
|
buildInputs = [ which ocaml findlib ];
|
2014-07-06 15:41:40 +00: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 15:41:40 +00:00
|
|
|
configureScript = "./configure.sh";
|
|
|
|
dontAddPrefix = "true";
|
|
|
|
|
2019-08-20 04:45:46 +00:00
|
|
|
propagatedBuildInputs = [ camlzip extlib ];
|
2014-07-06 15:41:40 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-07-06 15:41:40 +00:00
|
|
|
description = "A library that parses Java .class files into OCaml data structures";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://javalib-team.github.io/javalib/";
|
2014-09-21 10:02:55 +00:00
|
|
|
license = licenses.lgpl3;
|
|
|
|
maintainers = [ maintainers.vbgl ];
|
2019-08-20 04:45:46 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
2014-07-06 15:41:40 +00:00
|
|
|
};
|
|
|
|
}
|