diff --git a/pkgs/development/ocaml-modules/ocsigen-server/default.nix b/pkgs/development/ocaml-modules/ocsigen-server/default.nix index 081f9edbecf9..efbb12304970 100644 --- a/pkgs/development/ocaml-modules/ocsigen-server/default.nix +++ b/pkgs/development/ocaml-modules/ocsigen-server/default.nix @@ -1,7 +1,7 @@ -{ stdenv, fetchurl, ocaml, findlib, which, react, ssl, -lwt, ocamlnet, ocaml_pcre, cryptokit, tyxml, ipaddr, zlib, +{ stdenv, fetchurl, ocaml, findlib, which, react, ssl +, ocamlnet, ocaml_pcre, cryptokit, tyxml, ipaddr, zlib, libev, openssl, ocaml_sqlite3, tree, uutf, makeWrapper, camlp4 -, camlzip, pgocaml +, camlzip, pgocaml, lwt2, lwt_react, lwt_ssl }: let mkpath = p: n: @@ -9,17 +9,32 @@ let mkpath = p: n: "${p}/lib/ocaml/${v}/site-lib/${n}"; in +let param = + if stdenv.lib.versionAtLeast ocaml.version "4.03" then { + version = "2.9"; + sha256 = "0na3qa4h89f2wv31li63nfpg4151d0g8fply0bq59j3bhpyc85nd"; + buildInputs = [ lwt_react lwt_ssl ]; + ldpath = ""; + } else { + version = "2.8"; + sha256 = "1v44qv2ixd7i1qinyhlzzqiffawsdl7xhhh6ysd7lf93kh46d5sy"; + buildInputs = [ lwt2 ]; + ldpath = "${mkpath lwt2 "lwt"}"; + } +; in + stdenv.mkDerivation { - name = "ocsigenserver-2.8"; + name = "ocsigenserver-${param.version}"; src = fetchurl { - url = https://github.com/ocsigen/ocsigenserver/archive/2.8.tar.gz; - sha256 = "1v44qv2ixd7i1qinyhlzzqiffawsdl7xhhh6ysd7lf93kh46d5sy"; + url = "https://github.com/ocsigen/ocsigenserver/archive/${param.version}.tar.gz"; + inherit (param) sha256; }; - buildInputs = [ocaml which findlib react ssl lwt + buildInputs = [ocaml which findlib react ssl ocamlnet ocaml_pcre cryptokit tyxml ipaddr zlib libev openssl - ocaml_sqlite3 tree uutf makeWrapper camlp4 pgocaml camlzip ]; + ocaml_sqlite3 tree uutf makeWrapper camlp4 pgocaml camlzip ] + ++ (param.buildInputs or []); configureFlags = "--root $(out) --prefix /"; @@ -31,7 +46,7 @@ stdenv.mkDerivation { '' rm -rf $out/var/run wrapProgram $out/bin/ocsigenserver \ - --prefix CAML_LD_LIBRARY_PATH : "${mkpath ssl "ssl"}:${mkpath lwt "lwt"}:${mkpath ocamlnet "netsys"}:${mkpath ocamlnet "netstring"}:${mkpath ocaml_pcre "pcre"}:${mkpath cryptokit "cryptokit"}:${mkpath ocaml_sqlite3 "sqlite3"}" + --prefix CAML_LD_LIBRARY_PATH : "${mkpath ssl "ssl"}:${param.ldpath}:${mkpath ocamlnet "netsys"}:${mkpath ocamlnet "netstring"}:${mkpath ocaml_pcre "pcre"}:${mkpath cryptokit "cryptokit"}:${mkpath ocaml_sqlite3 "sqlite3"}" ''; dontPatchShebangs = true; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 741a58ce588a..22efb8a8a353 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -504,7 +504,7 @@ let ocplib-simplex = callPackage ../development/ocaml-modules/ocplib-simplex { }; - ocsigen_server = callPackage ../development/ocaml-modules/ocsigen-server { lwt = lwt2; }; + ocsigen_server = callPackage ../development/ocaml-modules/ocsigen-server { }; ocsigen-start = callPackage ../development/ocaml-modules/ocsigen-start { };