2021-12-19 01:06:50 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, which
|
|
|
|
, ocaml
|
|
|
|
, findlib
|
|
|
|
, camlzip
|
|
|
|
, extlib
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
if lib.versionOlder 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 {
|
2021-12-19 01:06:50 +00:00
|
|
|
pname = "ocaml${ocaml.version}-javalib";
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "3.2.1";
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "javalib-team";
|
|
|
|
repo = "javalib";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-du1h+S+A7CetMXofsYxdGeSsobCgspDB9oUE9WNUbbo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ which ocaml findlib ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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;
|
2021-12-19 01:06:50 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|