summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/sawja/default.nix
blob: ec1b59c04077de575809dd17c11c6e7b3ecd1c0a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib, stdenv, fetchFromGitHub, which, ocaml, findlib, javalib }:

let
  pname = "sawja";
  version = "1.5.11";
in

if !lib.versionAtLeast ocaml.version "4.07"
then throw "${pname} is not available for OCaml ${ocaml.version}"
else

stdenv.mkDerivation {

  pname = "ocaml${ocaml.version}-${pname}";

  inherit version;

  src = fetchFromGitHub {
    owner = "javalib-team";
    repo = pname;
    rev = version;
    sha256 = "sha256-1aKkRZDuLJLmDhUC1FXnn4QrgXaTyAbnXfTOAdnKgs8=";
  };

  nativeBuildInputs = [ which ocaml findlib ];

  strictDeps = true;

  patches = [ ./configure.sh.patch ./Makefile.config.example.patch ];

  createFindlibDestdir = true;

  preConfigure = "patchShebangs ./configure.sh";

  configureScript = "./configure.sh";
  dontAddPrefix = "true";
  dontAddStaticConfigureFlags = true;
  configurePlatforms = [];

  propagatedBuildInputs = [ javalib ];

  meta = with lib; {
    description = "A library written in OCaml, relying on Javalib to provide a high level representation of Java bytecode programs";
    homepage = "http://sawja.inria.fr/";
    license = licenses.gpl3Plus;
    maintainers = [ maintainers.vbgl ];
    platforms = ocaml.meta.platforms or [];
  };
}