forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / ocaml-modules / ocamlnet / default.nix
blob7fb262a91ac44a9b2d3830ab4e19d6693dec92ac
1 { stdenv, lib, fetchurl, pkg-config, which, ncurses, ocaml, findlib, ocaml_pcre, camlzip
2 , gnutls, nettle
3 }:
5 lib.throwIf (lib.versionOlder ocaml.version "4.02" || lib.versionAtLeast ocaml.version "5.0")
6   "ocamlnet is not available for OCaml ${ocaml.version}"
8 stdenv.mkDerivation rec {
9   pname = "ocaml${ocaml.version}-ocamlnet";
10   version = "4.1.9";
12   src = fetchurl {
13     url = "http://download.camlcity.org/download/ocamlnet-${version}.tar.gz";
14     sha256 = "1vlwxjxr946gdl61a1d7yk859cijq45f60dhn54ik3w4g6cx33pr";
15   };
17   nativeBuildInputs = [ pkg-config which ocaml findlib ];
18   buildInputs = [ ncurses ocaml_pcre camlzip gnutls nettle ];
20   strictDeps = true;
22   createFindlibDestdir = true;
24   dontAddPrefix = true;
25   dontAddStaticConfigureFlags = true;
26   configurePlatforms = [];
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   '';
40   buildPhase = ''
41     make all
42     make opt
43   '';
45   meta = {
46     homepage = "http://projects.camlcity.org/projects/ocamlnet.html";
47     description = "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   };