2021-10-30 20:50:11 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, which
|
|
|
|
, ocaml
|
|
|
|
, findlib
|
|
|
|
, camlzip
|
|
|
|
, extlib
|
2018-08-14 12:53:30 +00:00
|
|
|
}:
|
2016-10-05 07:32:30 +00:00
|
|
|
|
2022-04-25 20:35:24 +00:00
|
|
|
if lib.versionOlder 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 {
|
2021-10-30 20:50:11 +00:00
|
|
|
pname = "ocaml${ocaml.version}-javalib";
|
2020-02-21 08:18:51 +00:00
|
|
|
version = "3.2.1";
|
2014-07-06 15:41:40 +00:00
|
|
|
|
2021-10-30 20:50:11 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "javalib-team";
|
|
|
|
repo = "javalib";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-du1h+S+A7CetMXofsYxdGeSsobCgspDB9oUE9WNUbbo=";
|
2014-07-06 15:41:40 +00:00
|
|
|
};
|
|
|
|
|
2022-02-22 09:59:04 +00:00
|
|
|
nativeBuildInputs = [ which ocaml findlib ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
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";
|
2021-08-14 12:00:00 +00:00
|
|
|
dontAddStaticConfigureFlags = true;
|
2021-10-30 20:50:11 +00:00
|
|
|
configurePlatforms = [ ];
|
2014-07-06 15:41:40 +00:00
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|