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