summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/bz2/default.nix
blob: 617715fc6edcd3228b21198b6b35c36e993fc401 (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
{ lib, stdenv, fetchFromGitLab, ocaml, findlib, bzip2, autoreconfHook }:

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

stdenv.mkDerivation rec {
  pname = "ocaml${ocaml.version}-bz2";
  version = "0.7.0";

  src = fetchFromGitLab {
    owner = "irill";
    repo = "camlbz2";
    rev = version;
    sha256 = "sha256-jBFEkLN2fbC3LxTu7C0iuhvNg64duuckBHWZoBxrV/U=";
  };

  autoreconfFlags = "-I .";

  nativeBuildInputs = [
    autoreconfHook
  ];

  buildInputs = [
    ocaml
    findlib
  ];

  propagatedBuildInputs = [
    bzip2
  ];

  preInstall = "mkdir -p $OCAMLFIND_DESTDIR/stublibs";

  meta = with lib; {
    description = "OCaml bindings for the libbz2 (AKA, bzip2) (de)compression library";
    downloadPage = "https://gitlab.com/irill/camlbz2";
    license = licenses.lgpl21;
    maintainers = with maintainers; [ ];
  };
}