Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv, lib, fetchurl, pkg-config, which, ncurses, ocaml, findlib, ocaml_pcre, camlzip
2, gnutls, nettle
3}:
4
5lib.throwIf (lib.versionOlder ocaml.version "4.02" || lib.versionAtLeast ocaml.version "5.0")
6 "ocamlnet is not available for OCaml ${ocaml.version}"
7
8stdenv.mkDerivation rec {
9 pname = "ocaml${ocaml.version}-ocamlnet";
10 version = "4.1.9";
11
12 src = fetchurl {
13 url = "http://download.camlcity.org/download/ocamlnet-${version}.tar.gz";
14 sha256 = "1vlwxjxr946gdl61a1d7yk859cijq45f60dhn54ik3w4g6cx33pr";
15 };
16
17 nativeBuildInputs = [ pkg-config which ocaml findlib ];
18 buildInputs = [ ncurses ocaml_pcre camlzip gnutls nettle ];
19
20 strictDeps = true;
21
22 createFindlibDestdir = true;
23
24 dontAddPrefix = true;
25 dontAddStaticConfigureFlags = true;
26 configurePlatforms = [];
27
28 preConfigure = ''
29 configureFlagsArray=(
30 -bindir $out/bin
31 -enable-gnutls
32 -enable-zip
33 -enable-pcre
34 -disable-gtk2
35 -with-nethttpd
36 -datadir $out/lib/ocaml/${ocaml.version}/ocamlnet
37 )
38 '';
39
40 buildPhase = ''
41 make all
42 make opt
43 '';
44
45 meta = {
46 homepage = "http://projects.camlcity.org/projects/ocamlnet.html";
47 description = "A library implementing Internet protocols (http, cgi, email, etc.) for OCaml";
48 license = "Most Ocamlnet modules are released under the zlib/png license. The HTTP server module Nethttpd is, however, under the GPL.";
49 inherit (ocaml.meta) platforms;
50 maintainers = [
51 lib.maintainers.maggesi
52 ];
53 };
54}