2019-08-20 05:45:46 +01:00
|
|
|
{ stdenv, fetchzip, which, ocaml, findlib
|
|
|
|
, camlzip, extlib
|
2018-08-14 13:53:30 +01:00
|
|
|
}:
|
2016-10-05 08:32:30 +01:00
|
|
|
|
2019-08-20 05:45:46 +01:00
|
|
|
if !stdenv.lib.versionAtLeast ocaml.version "4.04"
|
|
|
|
then throw "javalib is not available for OCaml ${ocaml.version}"
|
2017-06-30 17:55:04 +01:00
|
|
|
else
|
|
|
|
|
2014-07-06 16:41:40 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-20 05:45:46 +01:00
|
|
|
name = "ocaml${ocaml.version}-javalib-${version}";
|
|
|
|
version = "3.1.1";
|
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";
|
2019-08-20 05:45:46 +01:00
|
|
|
sha256 = "1myrf7kw7pi04pmp0bi4747nj4h4vfxlla05sz2hp4w8k76iscld";
|
2014-07-06 16:41:40 +01:00
|
|
|
};
|
|
|
|
|
2019-08-20 05:45:46 +01:00
|
|
|
buildInputs = [ which ocaml findlib ];
|
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";
|
|
|
|
|
2019-08-20 05:45:46 +01:00
|
|
|
propagatedBuildInputs = [ camlzip 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 ];
|
2019-08-20 05:45:46 +01:00
|
|
|
inherit (ocaml.meta) platforms;
|
2014-07-06 16:41:40 +01:00
|
|
|
};
|
|
|
|
}
|