1 {lib, stdenv, fetchurl, zlib, ocaml, findlib}:
5 if lib.versionAtLeast ocaml.version "4.02"
8 url = "https://github.com/xavierleroy/camlzip/archive/rel110.tar.gz";
9 sha256 = "X0YcczaQ3lFeJEiTIgjSSZ1zi32KFMtmZsP0FFpyfbI=";
12 cp META-zip META-camlzip
13 echo 'directory="../zip"' >> META-camlzip
18 url = "http://forge.ocamlcore.org/frs/download.php/${param.download_id}/camlzip-${param.version}.tar.gz";
19 sha256 = "930b70c736ab5a7ed1b05220102310a0a2241564786657abe418e834a538d06b";
20 patches = [./makefile_1_05.patch];
22 substitute ${./META} META --subst-var-by VERSION "${param.version}"
29 version = param.version;
33 inherit (param) sha256;
36 nativeBuildInputs = [ ocaml findlib ];
38 propagatedBuildInputs = [zlib];
42 inherit (param) patches;
44 createFindlibDestdir = true;
46 postPatch = param.postPatchInit + ''
47 substituteInPlace Makefile \
48 --subst-var-by ZLIB_LIBDIR "${zlib.out}/lib" \
49 --subst-var-by ZLIB_INCLUDE "${zlib.dev}/include"
52 buildFlags = [ "all" "allopt" ];
55 ln -s $out/lib/ocaml/${ocaml.version}/site-lib/{,caml}zip
59 homepage = "http://cristal.inria.fr/~xleroy/software.html#camlzip";
60 description = "A library for handling ZIP and GZIP files in OCaml";
62 This Objective Caml library provides easy access to compressed files in
63 ZIP and GZIP format, as well as to Java JAR files. It provides functions
64 for reading from and writing to compressed files in these formats.
66 license = "LGPL+linking exceptions";
67 inherit (ocaml.meta) platforms;
68 maintainers = with maintainers; [ maggesi ];