2021-04-08 16:26:57 +00:00
|
|
|
{ stdenv, lib, fetchurl, pkg-config, which, ncurses, ocaml, findlib, ocaml_pcre, camlzip
|
2020-04-24 23:36:52 +00:00
|
|
|
, gnutls, nettle
|
|
|
|
}:
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
lib.throwIf (lib.versionOlder ocaml.version "4.02" || lib.versionAtLeast ocaml.version "5.0")
|
|
|
|
"ocamlnet is not available for OCaml ${ocaml.version}"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-02-10 20:34:41 +00:00
|
|
|
pname = "ocaml${ocaml.version}-ocamlnet";
|
2021-04-08 16:26:57 +00:00
|
|
|
version = "4.1.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://download.camlcity.org/download/ocamlnet-${version}.tar.gz";
|
2021-04-08 16:26:57 +00:00
|
|
|
sha256 = "1vlwxjxr946gdl61a1d7yk859cijq45f60dhn54ik3w4g6cx33pr";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ pkg-config which ocaml findlib ];
|
|
|
|
buildInputs = [ ncurses ocaml_pcre camlzip gnutls nettle ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
dontAddPrefix = true;
|
2021-09-18 10:52:07 +00:00
|
|
|
dontAddStaticConfigureFlags = true;
|
|
|
|
configurePlatforms = [];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
configureFlagsArray=(
|
|
|
|
-bindir $out/bin
|
|
|
|
-enable-gnutls
|
|
|
|
-enable-zip
|
|
|
|
-enable-pcre
|
|
|
|
-disable-gtk2
|
|
|
|
-with-nethttpd
|
|
|
|
-datadir $out/lib/ocaml/${ocaml.version}/ocamlnet
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make all
|
|
|
|
make opt
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://projects.camlcity.org/projects/ocamlnet.html";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Library implementing Internet protocols (http, cgi, email, etc.) for OCaml";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = "Most Ocamlnet modules are released under the zlib/png license. The HTTP server module Nethttpd is, however, under the GPL.";
|
2022-05-18 14:49:53 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [
|
2021-01-15 22:18:51 +00:00
|
|
|
lib.maintainers.maggesi
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|