about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/ocsigen-server
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2022-06-30 06:29:12 +0100
committerVincent Laporte <vbgl@users.noreply.github.com>2022-07-07 20:29:09 +0200
commita8406971c3ef3438cf2511c5d59a7579f601d6b9 (patch)
treee0d484a964be204c7745132601a7e5d94ece7113 /pkgs/development/ocaml-modules/ocsigen-server
parent26a6c659f0b239048f8e33a8a8a8b70c6e95e123 (diff)
ocamlPackages.dns: 5.0.1 → 6.1.4
ocamlPackages.conduit: 4.0.2 → 5.1.0

ocamlPackages.cohttp: 4.0.0 → 5.0.0

ocamlPackages.ocsigen_server: fix compatibility with cohttp-5.0.0
Diffstat (limited to 'pkgs/development/ocaml-modules/ocsigen-server')
-rw-r--r--pkgs/development/ocaml-modules/ocsigen-server/cohttp-5.patch31
-rw-r--r--pkgs/development/ocaml-modules/ocsigen-server/default.nix2
2 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/development/ocaml-modules/ocsigen-server/cohttp-5.patch b/pkgs/development/ocaml-modules/ocsigen-server/cohttp-5.patch
new file mode 100644
index 0000000000000..44ade8da9296e
--- /dev/null
+++ b/pkgs/development/ocaml-modules/ocsigen-server/cohttp-5.patch
@@ -0,0 +1,31 @@
+diff --git a/src/server/ocsigen_cohttp.ml b/src/server/ocsigen_cohttp.ml
+index 4363cff7..b0cc0c53 100644
+--- a/src/server/ocsigen_cohttp.ml
++++ b/src/server/ocsigen_cohttp.ml
+@@ -14,25 +14,13 @@ exception Ext_http_error of
+ 
+ let _print_request fmt request =
+ 
+-  let print_list print_data out_ch lst =
+-    let rec aux = function
+-      | [] -> ()
+-      | [ x ] -> print_data out_ch x
+-      | x :: r -> print_data out_ch x; aux r
+-    in aux lst
+-  in
+-
+   Format.fprintf fmt "%s [%s/%s]:\n"
+     (Uri.to_string (Cohttp.Request.uri request))
+     Cohttp.(Code.string_of_version (Request.version request))
+     Cohttp.(Code.string_of_method (Request.meth request));
+ 
+   Cohttp.Header.iter
+-    (fun key values ->
+-       (print_list
+-          (fun fmt value -> Format.fprintf fmt "\t%s = %s\n" key value)
+-          fmt
+-          values))
++    (Format.fprintf fmt "\t%s = %s\n")
+     (Cohttp.Request.headers request)
+ 
+ let connections = Hashtbl.create 256
diff --git a/pkgs/development/ocaml-modules/ocsigen-server/default.nix b/pkgs/development/ocaml-modules/ocsigen-server/default.nix
index 704354202d102..6097194d27560 100644
--- a/pkgs/development/ocaml-modules/ocsigen-server/default.nix
+++ b/pkgs/development/ocaml-modules/ocsigen-server/default.nix
@@ -37,6 +37,8 @@ buildDunePackage rec {
     ocaml_pcre xml-light
   ];
 
+  patches = [ ./cohttp-5.patch ];
+
   configureFlags = [ "--root $(out)" "--prefix /" "--temproot ''" ];
 
   dontAddPrefix = true;