lol
1{ stdenv, fetchurl, pkgconfig, ncurses, ocaml, findlib, ocaml_pcre, camlzip
2, gnutls, nettle
3}:
4
5let version = "4.1.6"; in
6
7stdenv.mkDerivation {
8 name = "ocaml${ocaml.version}-ocamlnet-${version}";
9
10 src = fetchurl {
11 url = "http://download.camlcity.org/download/ocamlnet-${version}.tar.gz";
12 sha256 = "1j0k0drybcjpysvs8xpq3cnpg3wqk6d5sy7y1h5rq8jk7hrirf0k";
13 };
14
15 nativeBuildInputs = [ pkgconfig ];
16 buildInputs = [ ncurses ocaml findlib ocaml_pcre camlzip gnutls nettle ];
17
18 createFindlibDestdir = true;
19
20 dontAddPrefix = true;
21
22 preConfigure = ''
23 configureFlagsArray=(
24 -bindir $out/bin
25 -enable-gnutls
26 -enable-zip
27 -enable-pcre
28 -disable-gtk2
29 -with-nethttpd
30 -datadir $out/lib/ocaml/${ocaml.version}/ocamlnet
31 )
32 '';
33
34 buildPhase = ''
35 make all
36 make opt
37 '';
38
39 meta = {
40 homepage = http://projects.camlcity.org/projects/ocamlnet.html;
41 description = "A library implementing Internet protocols (http, cgi, email, etc.) for OCaml";
42 license = "Most Ocamlnet modules are released under the zlib/png license. The HTTP server module Nethttpd is, however, under the GPL.";
43 platforms = ocaml.meta.platforms or [];
44 maintainers = [
45 stdenv.lib.maintainers.z77z
46 ];
47 };
48}