depot/third_party/nixpkgs/pkgs/development/ocaml-modules/javalib/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

38 lines
1 KiB
Nix

{ stdenv, fetchzip, which, ocaml, findlib
, camlzip, extlib
}:
if !stdenv.lib.versionAtLeast ocaml.version "4.04"
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";
propagatedBuildInputs = [ camlzip extlib ];
meta = with stdenv.lib; {
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;
};
}