1 {lib, stdenv, fetchurl, zlib, ocaml, findlib}:
7 cp META-zip META-camlzip
8 echo 'directory="../zip"' >> META-camlzip
12 if lib.versionAtLeast ocaml.version "4.07"
15 url = "https://github.com/xavierleroy/camlzip/archive/rel111.tar.gz";
16 sha256 = "sha256-/7vF3j4cE9wOWScjdtIy0u3pGzJ1UQY9R/3bdPHV7Tc=";
17 } else if lib.versionAtLeast ocaml.version "4.02"
20 url = "https://github.com/xavierleroy/camlzip/archive/rel110.tar.gz";
21 sha256 = "X0YcczaQ3lFeJEiTIgjSSZ1zi32KFMtmZsP0FFpyfbI=";
25 url = "http://forge.ocamlcore.org/frs/download.php/${param.download_id}/camlzip-${param.version}.tar.gz";
26 sha256 = "930b70c736ab5a7ed1b05220102310a0a2241564786657abe418e834a538d06b";
27 patches = [./makefile_1_05.patch];
29 substitute ${./META} META --subst-var-by VERSION "${param.version}"
35 pname = "ocaml${ocaml.version}-camlzip";
36 version = param.version;
40 inherit (param) sha256;
43 nativeBuildInputs = [ ocaml findlib ];
45 propagatedBuildInputs = [zlib];
49 inherit (param) patches;
51 createFindlibDestdir = true;
53 postPatch = param.postPatchInit + ''
54 substituteInPlace Makefile \
55 --subst-var-by ZLIB_LIBDIR "${zlib.out}/lib" \
56 --subst-var-by ZLIB_INCLUDE "${zlib.dev}/include"
59 buildFlags = [ "all" "allopt" ];
62 ln -s $out/lib/ocaml/${ocaml.version}/site-lib/{,caml}zip
66 homepage = "http://cristal.inria.fr/~xleroy/software.html#camlzip";
67 description = "A library for handling ZIP and GZIP files in OCaml";
69 This Objective Caml library provides easy access to compressed files in
70 ZIP and GZIP format, as well as to Java JAR files. It provides functions
71 for reading from and writing to compressed files in these formats.
73 license = "LGPL+linking exceptions";
74 inherit (ocaml.meta) platforms;
75 maintainers = with maintainers; [ maggesi ];