diff options
21 files changed, 231 insertions, 271 deletions
diff --git a/www/ocsigen/Makefile b/www/ocsigen/Makefile index f0e8903fdbc..1245ff700b4 100644 --- a/www/ocsigen/Makefile +++ b/www/ocsigen/Makefile @@ -1,9 +1,8 @@ -# $NetBSD: Makefile,v 1.29 2018/01/28 20:11:07 wiz Exp $ +# $NetBSD: Makefile,v 1.30 2018/04/13 13:15:00 jaapb Exp $ # -VERSION= 2.8 +VERSION= 2.9 GITHUB_PROJECT= ocsigenserver -PKGREVISION= 5 PKGNAME= ocsigen-${VERSION} DISTNAME= ${GITHUB_PROJECT}-${VERSION} CATEGORIES= www @@ -68,10 +67,10 @@ CONFIGURE_ARGS+= --disable-natdynlink .include "options.mk" .include "../../mk/pthread.buildlink3.mk" +.include "../../devel/ocaml-lwt_log/buildlink3.mk" .include "../../devel/ocaml-lwt_react/buildlink3.mk" .include "../../devel/ocaml-lwt_ssl/buildlink3.mk" .include "../../devel/pcre-ocaml/buildlink3.mk" -.include "../../lang/camlp4/buildlink3.mk" .include "../../net/ocaml-ipaddr/buildlink3.mk" .include "../../net/ocamlnet/buildlink3.mk" .include "../../security/ocaml-cryptokit/buildlink3.mk" diff --git a/www/ocsigen/PLIST b/www/ocsigen/PLIST index c4142965bb9..14b0a343868 100644 --- a/www/ocsigen/PLIST +++ b/www/ocsigen/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.9 2017/01/04 13:06:18 jaapb Exp $ +@comment $NetBSD: PLIST,v 1.10 2018/04/13 13:15:00 jaapb Exp $ bin/ocsigenserver ${PLIST.ocaml-opt}bin/ocsigenserver.opt share/examples/ocsigen/ocsigenserver.conf @@ -58,10 +58,10 @@ ${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsigen_comet.cmx ${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsigen_comet.cmxs ${OCAML_SITELIB}/ocsigenserver/extensions/ocsigen_comet.mli ${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsigen_comet.o -${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsipersist-dbm.a -${OCAML_SITELIB}/ocsigenserver/extensions/ocsipersist-dbm.cma -${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsipersist-dbm.cmxa -${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsipersist-dbm.cmxs +${PLIST.dbm}${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsipersist-dbm.a +${PLIST.dbm}${OCAML_SITELIB}/ocsigenserver/extensions/ocsipersist-dbm.cma +${PLIST.dbm}${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsipersist-dbm.cmxa +${PLIST.dbm}${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsipersist-dbm.cmxs ${PLIST.pgsql}${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsipersist-pgsql.a ${PLIST.pgsql}${OCAML_SITELIB}/ocsigenserver/extensions/ocsipersist-pgsql.cma ${PLIST.pgsql}${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsipersist-pgsql.cmxa @@ -177,8 +177,8 @@ ${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/userconf.cmx ${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/userconf.cmxs ${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/userconf.o @comment ${OCAML_SITELIB}/ocsigenserver/dllocsigenserver.so -${OCAML_SITELIB}/ocsigenserver/extensions/ocsidbm -${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsidbm.opt +${PLIST.dbm}${OCAML_SITELIB}/ocsigenserver/extensions/ocsidbm +${PLIST.dbm}${PLIST.ocaml-opt}${OCAML_SITELIB}/ocsigenserver/extensions/ocsidbm.opt man/man1/ocsigenserver.1 share/examples/ocsigen/mime.types share/ocsigen/www/index.html diff --git a/www/ocsigen/distinfo b/www/ocsigen/distinfo index ccb675e25d6..5691593f752 100644 --- a/www/ocsigen/distinfo +++ b/www/ocsigen/distinfo @@ -1,17 +1,19 @@ -$NetBSD: distinfo,v 1.10 2017/09/08 17:10:46 jaapb Exp $ +$NetBSD: distinfo,v 1.11 2018/04/13 13:15:00 jaapb Exp $ -SHA1 (ocsigenserver-2.8.tar.gz) = 1043cd33b3e356a29957b95005edff0930c11be4 -RMD160 (ocsigenserver-2.8.tar.gz) = 729596c04091ed471b51ff7139359461ef883de9 -SHA512 (ocsigenserver-2.8.tar.gz) = 80d5125a93239c73756b03a0f50d83e691810f93a15525daef2f7ccd69279e348f03486c26319a9511c1a746f375317082a89ba37ce0ba22872d6db7d3fddf1b -Size (ocsigenserver-2.8.tar.gz) = 1265240 bytes +SHA1 (ocsigenserver-2.9.tar.gz) = 1b4d50c9b6fff3ab78c8aef3ebbde1f8ddcc594e +RMD160 (ocsigenserver-2.9.tar.gz) = f5114a7bda3327e279f57f40336a7c23e19b66ce +SHA512 (ocsigenserver-2.9.tar.gz) = b3c5a86785feac18bac677ebb3736705f5d015a8692d2811bf22009dc319636e8b7bbb54dfd0223b2040a8f8bdef5ca3336d903b5ecd7eb260e8c0d48946ee46 +Size (ocsigenserver-2.9.tar.gz) = 1265175 bytes SHA1 (patch-Makefile) = 637a45aacd7c8afaeb73be624eb7732b21e78b4d -SHA1 (patch-Makefile.options) = 2a4e171d7be05411e28ada231b819901eb6c0fad -SHA1 (patch-configure) = f7c97a277a30f828ccd41fdd00e0fa5d1d403022 -SHA1 (patch-src_extensions_Makefile) = 9715d890e08688023a98b596b72917ca08734b7c -SHA1 (patch-src_extensions_ocsipersist-dbm_ocsidbm.ml) = cabdf3b511703186887108580697e7427a89658a -SHA1 (patch-src_extensions_ocsipersist-pgsql_Makefile) = 9490a9d580142bbf9114d65396d54ac991b4ca7d -SHA1 (patch-src_files_META.in) = bc90fa2f55e35e56922b741a94c1e1414571a9bc -SHA1 (patch-src_http_Makefile) = 19f5620a710abffa479e364b1b48cbdc7cae7f5a -SHA1 (patch-src_server_ocsigen_server.ml) = 0218d0878cd6c4654f6fccb4911889cb3bfe2e40 -SHA1 (patch-src_server_ocsigen_socket.ml) = a2f108c8355966f422f68541270d612e640a41b3 -SHA1 (patch-src_server_ocsigen_socket.mli) = 45a9d13b802322ccc3ce52eef0e6c5f704a9a62f +SHA1 (patch-Makefile.options) = 6b59e2d20cc0a47c56a9b11cba56cd70d7dc9beb +SHA1 (patch-configure) = 9b1c5c373e36169eb1b86daba0f9214845513082 +SHA1 (patch-src_baselib_Makefile) = e2fd5e5bd933d4ec844713c8f574efd5fa8426cf +SHA1 (patch-src_baselib_ocsigen__stream.ml) = 6907fd8f7e0295f5147a0f2322cb1bec28f73953 +SHA1 (patch-src_extensions_Makefile) = 5f3af59550f5b576e39323b7cd1252ee70fd282b +SHA1 (patch-src_extensions_cgimod.ml) = 6f5093a1a93a5797ce47c33b9704e45f8aa6c2c5 +SHA1 (patch-src_extensions_ocsipersist-pgsql_Makefile) = 223b8f652ccd4144fbe3c0f67c6fdd3cdf6fa0aa +SHA1 (patch-src_extensions_ocsipersist-sqlite_Makefile) = 916733e0732ec58f502aeee5769fde1ed7060a9f +SHA1 (patch-src_http_Makefile) = 1bcfe69470fe53a8fc9b197fd95d21889646909d +SHA1 (patch-src_http_ocsigen__http__com.mli) = f1760bf423e8aae763992e57c13408aa01c6316f +SHA1 (patch-src_server_Makefile) = 0f315fb0533d3d0b8f8cf1f3a61e11b013571b05 +SHA1 (patch-src_server_ocsigen__server.ml) = 17b9fc720d01e27a49576864a9d91c87deda85e3 diff --git a/www/ocsigen/options.mk b/www/ocsigen/options.mk index 7b21413f138..2409b574fe3 100644 --- a/www/ocsigen/options.mk +++ b/www/ocsigen/options.mk @@ -1,9 +1,9 @@ -# $NetBSD: options.mk,v 1.5 2017/01/04 13:06:18 jaapb Exp $ +# $NetBSD: options.mk,v 1.6 2018/04/13 13:15:00 jaapb Exp $ PKG_OPTIONS_VAR= PKG_OPTIONS.ocsigen -PKG_SUPPORTED_OPTIONS= camlzip pgsql +PKG_SUPPORTED_OPTIONS= camlzip PKG_OPTIONS_NONEMPTY_SETS= database -PKG_OPTIONS_SET.database= sqlite gdbm +PKG_OPTIONS_SET.database= sqlite gdbm pgsql PKG_SUGGESTED_OPTIONS= gdbm camlzip .include "../../mk/bsd.options.mk" diff --git a/www/ocsigen/patches/patch-Makefile.options b/www/ocsigen/patches/patch-Makefile.options index a3a8cfe0b89..aa9a4f0bcb9 100644 --- a/www/ocsigen/patches/patch-Makefile.options +++ b/www/ocsigen/patches/patch-Makefile.options @@ -1,14 +1,14 @@ -$NetBSD: patch-Makefile.options,v 1.3 2017/09/08 17:10:46 jaapb Exp $ +$NetBSD: patch-Makefile.options,v 1.4 2018/04/13 13:15:00 jaapb Exp $ -lwt_ssl for lwt 3.1 ---- Makefile.options.orig 2016-11-24 13:31:34.000000000 +0000 +Support for preemptive threads is in lwt.unix now +--- Makefile.options.orig 2018-02-01 12:55:17.000000000 +0000 +++ Makefile.options -@@ -30,7 +30,7 @@ endif +@@ -25,7 +25,7 @@ endif + ## but also to generate src/baselib/ocsigen_config.ml and src/files/META - BASE_PACKAGE := lwt ipaddr bytes + ifeq "$(PREEMPTIVE)" "YES" +-LWT_PREEMPTIVE_PACKAGE:=lwt.preemptive ++LWT_PREEMPTIVE_PACKAGE:=lwt.unix + endif --SERVER_PACKAGE := lwt.ssl \ -+SERVER_PACKAGE := lwt_ssl \ - bytes \ - ${LWT_PREEMPTIVE_PACKAGE} \ - ipaddr \ + BASE_PACKAGE := lwt ipaddr bytes diff --git a/www/ocsigen/patches/patch-configure b/www/ocsigen/patches/patch-configure index 4e90a99e625..6aeb03e49d1 100644 --- a/www/ocsigen/patches/patch-configure +++ b/www/ocsigen/patches/patch-configure @@ -1,16 +1,27 @@ -$NetBSD: patch-configure,v 1.1 2017/09/08 17:10:46 jaapb Exp $ +$NetBSD: patch-configure,v 1.2 2018/04/13 13:15:00 jaapb Exp $ -lwt_ssl for lwt 3.1 ---- configure.orig 2016-11-24 13:31:34.000000000 +0000 +Support for preemptive threads is in lwt.unix now +--- configure.orig 2018-02-01 12:55:17.000000000 +0000 +++ configure -@@ -410,8 +410,8 @@ check_library ssl "See: http://sourcefor - - check_library lwt "See: http://ocsigen.org/lwt" +@@ -412,7 +412,7 @@ check_library lwt "See: http://ocsigen.o check_library lwt.unix "Missing support for 'unix' in lwt." --check_library lwt.react "Missing support for 'react' in lwt." --check_library lwt.ssl "Missing support for 'ssl' in lwt." -+check_library lwt_react "Missing support for 'react' in lwt." -+check_library lwt_ssl "Missing support for 'ssl' in lwt." - check_library lwt.preemptive "Missing support for 'preemptive' in lwt." + check_library lwt_react "See: http://ocsigen.org/lwt" + check_library lwt_ssl "See: http://ocsigen.org/lwt" +-check_library lwt.preemptive "Missing support for 'preemptive' in lwt." ++#check_library lwt.preemptive "Missing support for 'preemptive' in lwt." check_library netstring \ + "See ocamlnet: http://projects.camlcity.org/projects/ocamlnet.html" +@@ -464,10 +464,10 @@ fi + + # Check Lwt.preemptive + if [ "$with_preempt" -gt 0 ]; then +- if test_library lwt.preemptive; then ++ if test_library lwt.unix; then + echo -n + elif [ "$with_preempt" -gt 1 ]; then +- fail_library lwt.preemptive "Missing support for 'preemptive' in lwt." ++ fail_library lwt.unix "Missing support for 'preemptive' in lwt." + else + with_preempt=0 + fi diff --git a/www/ocsigen/patches/patch-src_baselib_Makefile b/www/ocsigen/patches/patch-src_baselib_Makefile new file mode 100644 index 00000000000..b9a620f5505 --- /dev/null +++ b/www/ocsigen/patches/patch-src_baselib_Makefile @@ -0,0 +1,15 @@ +$NetBSD: patch-src_baselib_Makefile,v 1.3 2018/04/13 13:15:00 jaapb Exp $ + +The lwt_log package has been separated from lwt +--- src/baselib/Makefile.orig 2018-02-01 12:55:17.000000000 +0000 ++++ src/baselib/Makefile +@@ -9,7 +9,8 @@ PACKAGE := \ + findlib \ + tyxml \ + ${LWT_PREEMPTIVE_PACKAGE} \ +- ipaddr ++ ipaddr \ ++ lwt_log + + LIBS := ${addprefix -package ,${PACKAGE}} + # -no-keep-locs is needed since OCaml 4.06. If we don't compile with diff --git a/www/ocsigen/patches/patch-src_baselib_ocsigen__stream.ml b/www/ocsigen/patches/patch-src_baselib_ocsigen__stream.ml new file mode 100644 index 00000000000..e2468ccc7ca --- /dev/null +++ b/www/ocsigen/patches/patch-src_baselib_ocsigen__stream.ml @@ -0,0 +1,18 @@ +$NetBSD: patch-src_baselib_ocsigen__stream.ml,v 1.1 2018/04/13 13:15:00 jaapb Exp $ + +Lwt_chan no longer exists in Lwt 4, replaced by Lwt_io +--- src/baselib/ocsigen_stream.ml.orig 2018-02-01 12:55:17.000000000 +0000 ++++ src/baselib/ocsigen_stream.ml +@@ -229,10 +229,10 @@ let of_file filename = + let fd = Lwt_unix.of_unix_file_descr + (Unix.openfile filename [Unix.O_RDONLY;Unix.O_NONBLOCK] 0o666) + in +- let ch = Lwt_chan.in_channel_of_descr fd in ++ let ch = Lwt_io.of_fd ~mode:Input fd in + let buf = Bytes.create 1024 in + let rec aux () = +- Lwt_chan.input ch buf 0 1024 >>= fun n -> ++ Lwt_io.read_into ch buf 0 1024 >>= fun n -> + if n = 0 then empty None else + (* Streams should be immutable, thus we always make a copy + of the buffer *) diff --git a/www/ocsigen/patches/patch-src_extensions_Makefile b/www/ocsigen/patches/patch-src_extensions_Makefile index 48ac7e451d8..fee62955573 100644 --- a/www/ocsigen/patches/patch-src_extensions_Makefile +++ b/www/ocsigen/patches/patch-src_extensions_Makefile @@ -1,16 +1,15 @@ -$NetBSD: patch-src_extensions_Makefile,v 1.3 2017/09/08 17:10:46 jaapb Exp $ +$NetBSD: patch-src_extensions_Makefile,v 1.4 2018/04/13 13:15:00 jaapb Exp $ -lwt_react and lwt_ssl for lwt 3.1 ---- src/extensions/Makefile.orig 2016-11-24 13:31:34.000000000 +0000 +The lwt_log package has been separated from lwt +--- src/extensions/Makefile.orig 2018-02-01 12:55:17.000000000 +0000 +++ src/extensions/Makefile -@@ -4,8 +4,8 @@ PACKAGE := \ - bytes \ - lwt.unix \ - ipaddr \ -- lwt.ssl \ -- lwt.react \ -+ lwt_ssl \ -+ lwt_react \ +@@ -8,7 +8,8 @@ PACKAGE := \ + lwt_react \ netstring \ netstring-pcre \ - tyxml.parser +- tyxml.parser ++ tyxml.parser \ ++ lwt_log + + LIBS := -I ../baselib -I ../http -I ../server ${addprefix -package ,${PACKAGE}} + OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} diff --git a/www/ocsigen/patches/patch-src_extensions_cgimod.ml b/www/ocsigen/patches/patch-src_extensions_cgimod.ml new file mode 100644 index 00000000000..7bd83902415 --- /dev/null +++ b/www/ocsigen/patches/patch-src_extensions_cgimod.ml @@ -0,0 +1,46 @@ +$NetBSD: patch-src_extensions_cgimod.ml,v 1.1 2018/04/13 13:15:00 jaapb Exp $ + +Write correct request URI +Lwt_chan no longer exists in Lwt 4, replaced by Lwt_io +--- src/extensions/cgimod.ml.orig 2018-02-01 12:55:17.000000000 +0000 ++++ src/extensions/cgimod.ml +@@ -271,7 +271,8 @@ let array_environment filename re doc_ro + + (* Neither in the CGI's spec nor in the HTTP headers but used, e.g., by PHP *) + Printf.sprintf "REMOTE_PORT=%d" (Ocsigen_request_info.remote_port ri); +- Printf.sprintf "REQUEST_URI=%s" (Ocsigen_request_info.url_string ri); ++ Printf.sprintf "REQUEST_URI=%s" (string_conform0 (Ocsigen_request_info.url_string ri)); ++ + (* FIXME: URI instead of URL ? *) + Printf.sprintf "SCRIPT_FILENAME=%s" filename ] ; + additionnal_headers +@@ -368,7 +369,7 @@ let recupere_cgi head re doc_root filena + Lwt_timeout.start timeout; + + (* A thread giving POST data to the CGI script: *) +- let post_in_ch = Lwt_chan.out_channel_of_descr post_in in ++ let post_in_ch = Lwt_io.of_fd ~mode:Output post_in in + ignore + (catch + (fun () -> +@@ -376,7 +377,7 @@ let recupere_cgi head re doc_root filena + | None -> Lwt_unix.close post_in + | Some content_post -> + Ocsigen_http_com.write_stream post_in_ch content_post >>= fun () -> +- Lwt_chan.flush post_in_ch >>= fun () -> ++ Lwt_io.flush post_in_ch >>= fun () -> + Lwt_unix.close post_in + )) + (*XXX Check possible errors! *) +@@ -391,9 +392,9 @@ let recupere_cgi head re doc_root filena + + (* A thread listening the error output of the CGI script + and writing them in warnings.log *) +- let err_channel = Lwt_chan.in_channel_of_descr err_out in ++ let err_channel = Lwt_io.of_fd ~mode:Input err_out in + let rec get_errors () = +- Lwt_chan.input_line err_channel >>= fun err -> ++ Lwt_io.read_line err_channel >>= fun err -> + Lwt_log.ign_warning ~section err; + get_errors () + in ignore diff --git a/www/ocsigen/patches/patch-src_extensions_ocsipersist-dbm_ocsidbm.ml b/www/ocsigen/patches/patch-src_extensions_ocsipersist-dbm_ocsidbm.ml deleted file mode 100644 index 40deea6b38d..00000000000 --- a/www/ocsigen/patches/patch-src_extensions_ocsipersist-dbm_ocsidbm.ml +++ /dev/null @@ -1,21 +0,0 @@ -$NetBSD: patch-src_extensions_ocsipersist-dbm_ocsidbm.ml,v 1.1 2017/09/08 17:10:46 jaapb Exp $ - -Changes to deal with lwt 3.1 ---- src/extensions/ocsipersist-dbm/ocsidbm.ml.orig 2016-11-24 13:31:34.000000000 +0000 -+++ src/extensions/ocsipersist-dbm/ocsidbm.ml -@@ -272,9 +272,12 @@ let rec loop socket = - - let _ = Lwt_main.run - (let socket = Lwt_unix.socket Unix.PF_UNIX Unix.SOCK_STREAM 0 in -- (try -- Lwt_unix.bind socket (Unix.ADDR_UNIX (directory^"/"^socketname)) -- with _ -> errlog ("Please make sure that the directory "^directory^" exists, writable for ocsidbm, and no other ocsidbm process is running on the same directory. If not, remove the file "^(directory^"/"^socketname)); the_end 1); -+ Lwt.catch -+ (fun () -> -+ Lwt_unix.bind socket (Unix.ADDR_UNIX (directory^"/"^socketname))) -+ (fun exn -> -+ errlog ("Please make sure that the directory "^directory^" exists, writable for ocsidbm, and no other ocsidbm process is running on the same directory. If not, remove the file "^(directory^"/"^socketname)); -+ the_end 1) >>= fun () -> - Lwt_unix.listen socket 20; - (* Done in ocsipersist.ml - let devnull = Unix.openfile "/dev/null" [Unix.O_WRONLY] 0 in diff --git a/www/ocsigen/patches/patch-src_extensions_ocsipersist-pgsql_Makefile b/www/ocsigen/patches/patch-src_extensions_ocsipersist-pgsql_Makefile index e0a294c24e1..9a11fa153ae 100644 --- a/www/ocsigen/patches/patch-src_extensions_ocsipersist-pgsql_Makefile +++ b/www/ocsigen/patches/patch-src_extensions_ocsipersist-pgsql_Makefile @@ -1,13 +1,13 @@ -$NetBSD: patch-src_extensions_ocsipersist-pgsql_Makefile,v 1.1 2017/09/08 17:10:46 jaapb Exp $ +$NetBSD: patch-src_extensions_ocsipersist-pgsql_Makefile,v 1.2 2018/04/13 13:15:00 jaapb Exp $ -Changes to deal with lwt 3.1 ---- src/extensions/ocsipersist-pgsql/Makefile.orig 2016-11-24 13:31:34.000000000 +0000 +The lwt_log package has been separated from lwt +--- src/extensions/ocsipersist-pgsql/Makefile.orig 2018-02-01 12:55:17.000000000 +0000 +++ src/extensions/ocsipersist-pgsql/Makefile @@ -1,6 +1,6 @@ include ../../../Makefile.config --PACKAGE := tyxml.parser pgocaml.syntax lwt.syntax -+PACKAGE := tyxml.parser pgocaml.syntax lwt.syntax lwt.unix +-PACKAGE := tyxml.parser pgocaml lwt ++PACKAGE := tyxml.parser pgocaml lwt lwt_log LIBS := -I ../../baselib -I ../../http -I ../../server \ ${addprefix -package ,${PACKAGE}} diff --git a/www/ocsigen/patches/patch-src_extensions_ocsipersist-sqlite_Makefile b/www/ocsigen/patches/patch-src_extensions_ocsipersist-sqlite_Makefile new file mode 100644 index 00000000000..60b7dbe0691 --- /dev/null +++ b/www/ocsigen/patches/patch-src_extensions_ocsipersist-sqlite_Makefile @@ -0,0 +1,16 @@ +$NetBSD: patch-src_extensions_ocsipersist-sqlite_Makefile,v 1.1 2018/04/13 13:15:00 jaapb Exp $ + +The lwt_log package has been separated from lwt +--- src/extensions/ocsipersist-sqlite/Makefile.orig 2018-02-01 12:55:17.000000000 +0000 ++++ src/extensions/ocsipersist-sqlite/Makefile +@@ -1,8 +1,9 @@ + include ../../../Makefile.config + +-PACKAGE := lwt.preemptive \ ++PACKAGE := lwt.unix \ + tyxml.parser \ + sqlite3 \ ++ lwt_log + + LIBS := -I ../../baselib -I ../../http -I ../../server \ + ${addprefix -package ,${PACKAGE}} diff --git a/www/ocsigen/patches/patch-src_files_META.in b/www/ocsigen/patches/patch-src_files_META.in deleted file mode 100644 index 71000fcff58..00000000000 --- a/www/ocsigen/patches/patch-src_files_META.in +++ /dev/null @@ -1,23 +0,0 @@ -$NetBSD: patch-src_files_META.in,v 1.1 2017/09/08 17:10:46 jaapb Exp $ - -lwt_ssl and lwt_react for lwt 3.1 ---- src/files/META.in.orig 2016-11-24 13:31:34.000000000 +0000 -+++ src/files/META.in -@@ -37,7 +37,7 @@ package "baselib" ( - ) - - package "http" ( -- requires = "%%NAME%%.baselib,lwt.ssl,tyxml" -+ requires = "%%NAME%%.baselib,lwt_ssl,tyxml" - version = "[distributed with Ocsigen server]" - description = "HTTP library for Ocsigen server" - archive(byte) = "http.cma" -@@ -188,7 +188,7 @@ package "ext" ( - - package "comet" ( - exists_if = "ocsigen_comet.cmo,ocsigen_comet.cmx" -- requires = "ocsigenserver,lwt.react" -+ requires = "ocsigenserver,lwt_react" - version = "[distributed with Ocsigen server]" - description = "Comet server-to-client communication" - archive(byte) = "ocsigen_comet.cmo" diff --git a/www/ocsigen/patches/patch-src_http_Makefile b/www/ocsigen/patches/patch-src_http_Makefile index 703bb6552b1..3d0170ca978 100644 --- a/www/ocsigen/patches/patch-src_http_Makefile +++ b/www/ocsigen/patches/patch-src_http_Makefile @@ -1,14 +1,15 @@ -$NetBSD: patch-src_http_Makefile,v 1.3 2017/09/08 17:10:46 jaapb Exp $ +$NetBSD: patch-src_http_Makefile,v 1.4 2018/04/13 13:15:00 jaapb Exp $ -lwt_ssl for lwt 3.1 ---- src/http/Makefile.orig 2016-11-24 13:31:34.000000000 +0000 +The lwt_log package has been separated from lwt +--- src/http/Makefile.orig 2018-02-01 12:55:17.000000000 +0000 +++ src/http/Makefile -@@ -3,7 +3,7 @@ PACKAGE := \ - bytes \ +@@ -4,7 +4,8 @@ PACKAGE := \ netstring \ netstring-pcre \ -- lwt.ssl \ -+ lwt_ssl \ - tyxml + lwt_ssl \ +- tyxml ++ tyxml \ ++ lwt_log LIBS := -I ../baselib ${addprefix -package ,${PACKAGE}} + OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} diff --git a/www/ocsigen/patches/patch-src_http_ocsigen__http__com.mli b/www/ocsigen/patches/patch-src_http_ocsigen__http__com.mli new file mode 100644 index 00000000000..c28d56fb1f8 --- /dev/null +++ b/www/ocsigen/patches/patch-src_http_ocsigen__http__com.mli @@ -0,0 +1,14 @@ +$NetBSD: patch-src_http_ocsigen__http__com.mli,v 1.1 2018/04/13 13:15:00 jaapb Exp $ + +Lwt_chan no longer exists in Lwt 4, replaced by Lwt_io +--- src/http/ocsigen_http_com.mli.orig 2018-02-01 12:55:17.000000000 +0000 ++++ src/http/ocsigen_http_com.mli +@@ -69,7 +69,7 @@ val wait_all_senders : connection -> uni + interrupted stream exception. + *) + val write_stream : +- ?chunked:bool -> Lwt_chan.out_channel -> string Ocsigen_stream.t -> unit Lwt.t ++ ?chunked:bool -> Lwt_io.output_channel -> string Ocsigen_stream.t -> unit Lwt.t + + (****) + diff --git a/www/ocsigen/patches/patch-src_server_Makefile b/www/ocsigen/patches/patch-src_server_Makefile new file mode 100644 index 00000000000..244beca2507 --- /dev/null +++ b/www/ocsigen/patches/patch-src_server_Makefile @@ -0,0 +1,14 @@ +$NetBSD: patch-src_server_Makefile,v 1.1 2018/04/13 13:15:00 jaapb Exp $ + +The lwt_log package has been separated from lwt +--- src/server/Makefile.orig 2018-02-01 12:55:17.000000000 +0000 ++++ src/server/Makefile +@@ -2,7 +2,7 @@ include ../../Makefile.config + + all: byte opt + +-PACKAGE := ${SERVER_PACKAGE} ## See ../../Makefile.options ++PACKAGE := ${SERVER_PACKAGE} lwt_log ## See ../../Makefile.options + LIBS := -I ../baselib -I ../http ${addprefix -package ,${PACKAGE}} -I . + OCAMLC := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD} + OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD} diff --git a/www/ocsigen/patches/patch-src_server_ocsigen__server.ml b/www/ocsigen/patches/patch-src_server_ocsigen__server.ml new file mode 100644 index 00000000000..ada450e974e --- /dev/null +++ b/www/ocsigen/patches/patch-src_server_ocsigen__server.ml @@ -0,0 +1,21 @@ +$NetBSD: patch-src_server_ocsigen__server.ml,v 1.1 2018/04/13 13:15:00 jaapb Exp $ + +Lwt_chan no longer exists in Lwt 4, replaced by Lwt_io +--- src/server/ocsigen_server.ml.orig 2018-02-01 12:55:17.000000000 +0000 ++++ src/server/ocsigen_server.ml +@@ -1317,13 +1317,13 @@ let start_server () = + + Ocsigen_extensions.end_initialisation (); + +- let pipe = Lwt_chan.in_channel_of_descr ++ let pipe = Lwt_io.of_fd ~mode:Input + (Lwt_unix.of_unix_file_descr + (Unix.openfile commandpipe + [Unix.O_RDWR; Unix.O_NONBLOCK; Unix.O_APPEND] 0o660)) in + + let rec f () = +- Lwt_chan.input_line pipe >>= fun s -> ++ Lwt_io.read_line pipe >>= fun s -> + Lwt_log.ign_notice ~section ("Command received: "^s); + (Lwt.catch + (fun () -> diff --git a/www/ocsigen/patches/patch-src_server_ocsigen_server.ml b/www/ocsigen/patches/patch-src_server_ocsigen_server.ml deleted file mode 100644 index ad8bec8c363..00000000000 --- a/www/ocsigen/patches/patch-src_server_ocsigen_server.ml +++ /dev/null @@ -1,74 +0,0 @@ -$NetBSD: patch-src_server_ocsigen_server.ml,v 1.1 2017/09/08 17:10:46 jaapb Exp $ - -Changes to deal with lwt 3.1 ---- src/server/ocsigen_server.ml.orig 2016-11-24 13:31:34.000000000 +0000 -+++ src/server/ocsigen_server.ml -@@ -1134,23 +1134,26 @@ let start_server () = - let stop n fmt = Printf.ksprintf (fun s -> raise (Stop (n, s))) fmt in - (** Thread waiting for events on a the listening port *) - let listen use_ssl (addr, port) wait_end_init = -- let listening_sockets = -- try -- let sockets = make_sockets addr port in -- List.iter (fun x -> Lwt_unix.listen x 1024) sockets; -- sockets -- with -- | Unix.Unix_error (Unix.EACCES, _, _) -> -- stop 7 "Fatal - You are not allowed to use port %d." port -- | Unix.Unix_error (Unix.EADDRINUSE, _, _) -> -- stop 8 "Fatal - The port %d is already in use." port -- | exn -> -- stop 100 "Fatal - Uncaught exception: %s" (Printexc.to_string exn) -- in -- List.iter (fun x -> -- ignore (wait_end_init >>= fun () -> -- wait_connection use_ssl port x)) listening_sockets; -- listening_sockets -+ Lwt.catch -+ (fun () -> -+ make_sockets addr port >>= fun sockets -> -+ Lwt_list.iter_s -+ (fun x -> Lwt_unix.listen x 1024; Lwt.return ()) -+ sockets >>= fun () -> -+ Lwt.return sockets) -+ (function -+ | Unix.Unix_error (Unix.EACCES, _, _) -> -+ stop 7 "Fatal - You are not allowed to use port %d." port -+ | Unix.Unix_error (Unix.EADDRINUSE, _, _) -> -+ stop 8 "Fatal - The port %d is already in use." port -+ | exn -> -+ stop 100 "Fatal - Uncaught exception: %s" -+ (Printexc.to_string exn)) >>= fun listening_sockets -> -+ List.iter -+ (fun x -> -+ ignore (wait_end_init >>= fun () -> -+ wait_connection use_ssl port x)) listening_sockets; -+ Lwt.return listening_sockets - in - try - -@@ -1192,10 +1195,20 @@ let start_server () = - - let wait_end_init, wait_end_init_awakener = wait () in - (* Listening on all ports: *) -- sockets := List.fold_left -- (fun a i -> (listen false i wait_end_init) @ a) [] ports; -- sslsockets := List.fold_left -- (fun a i -> (listen true i wait_end_init) @ a) [] sslports; -+ -+ Lwt_list.fold_left_s -+ (fun a i -> -+ listen false i wait_end_init >>= fun l -> -+ Lwt.return (l @ a)) -+ [] ports >>= fun l -> -+ sockets := l; -+ -+ Lwt_list.fold_left_s -+ (fun a i -> -+ listen true i wait_end_init >>= fun l -> -+ Lwt.return (l @ a)) -+ [] sslports >>= fun l -> -+ sslsockets := l; - - begin match ports with - | (_, p)::_ -> Ocsigen_config.set_default_port p diff --git a/www/ocsigen/patches/patch-src_server_ocsigen_socket.ml b/www/ocsigen/patches/patch-src_server_ocsigen_socket.ml deleted file mode 100644 index 87441e20b6a..00000000000 --- a/www/ocsigen/patches/patch-src_server_ocsigen_socket.ml +++ /dev/null @@ -1,64 +0,0 @@ -$NetBSD: patch-src_server_ocsigen_socket.ml,v 1.1 2017/09/08 17:10:46 jaapb Exp $ - -Changes to deal with lwt 3.1 ---- src/server/ocsigen_socket.ml.orig 2016-11-24 13:31:34.000000000 +0000 -+++ src/server/ocsigen_socket.ml -@@ -16,8 +16,8 @@ let make_ipv6_socket addr port = - * to why set REUSEADDR on socket *) - Lwt_unix.setsockopt socket Unix.SO_REUSEADDR true; - Lwt_unix.setsockopt socket Unix.IPV6_ONLY true; -- Lwt_unix.bind socket (Unix.ADDR_INET (addr, port)); -- socket -+ Lwt_unix.bind socket (Unix.ADDR_INET (addr, port)) >>= fun () -> -+ Lwt.return socket - - (** make_ipv4_socket create a socket on an ipv4 address - * @param addr address of socket -@@ -27,8 +27,8 @@ let make_ipv4_socket addr port = - let socket = Lwt_unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in - Lwt_unix.set_close_on_exec socket; - Lwt_unix.setsockopt socket Unix.SO_REUSEADDR true; -- Lwt_unix.bind socket (Unix.ADDR_INET (addr, port)); -- socket -+ Lwt_unix.bind socket (Unix.ADDR_INET (addr, port)) >>= fun () -> -+ Lwt.return socket - - let make_sockets addr port = - match addr with -@@ -39,19 +39,25 @@ let make_sockets addr port = - corresponds to the net.ipv6.bindv6only=0 behaviour on Linux, - but is portable and should work with - net.ipv6.bindv6only=1 as well. *) -- let ipv6_socket = -- try [make_ipv6_socket Unix.inet6_addr_any port] -- with Unix.Unix_error -- ((Unix.EAFNOSUPPORT -- | Unix.EPROTONOSUPPORT -- | Unix.EADDRINUSE (* GH issue #104 *) -- ), _, _) -> [] -- in -- (make_ipv4_socket Unix.inet_addr_any port)::ipv6_socket -+ Lwt.catch -+ (fun () -> -+ make_ipv6_socket Unix.inet6_addr_any port >>= fun s -> -+ Lwt.return [s]) -+ (function -+ | Unix.Unix_error -+ ((Unix.EAFNOSUPPORT -+ | Unix.EPROTONOSUPPORT -+ | Unix.EADDRINUSE (* GH issue #104 *) -+ ), _, _) -> -+ Lwt.return [] -+ | e -> -+ Lwt.fail e) >>= fun ipv6_sockets -> -+ make_ipv4_socket Unix.inet_addr_any port >>= fun ipv4_socket -> -+ Lwt.return (ipv4_socket :: ipv6_sockets) - | IPv4 addr -> -- [make_ipv4_socket addr port] -+ make_ipv4_socket addr port >>= fun s -> Lwt.return [s] - | IPv6 addr -> -- [make_ipv6_socket addr port] -+ make_ipv6_socket addr port >>= fun s -> Lwt.return [s] - - - let ip_of_sockaddr = function diff --git a/www/ocsigen/patches/patch-src_server_ocsigen_socket.mli b/www/ocsigen/patches/patch-src_server_ocsigen_socket.mli deleted file mode 100644 index 0fabe0e0625..00000000000 --- a/www/ocsigen/patches/patch-src_server_ocsigen_socket.mli +++ /dev/null @@ -1,14 +0,0 @@ -$NetBSD: patch-src_server_ocsigen_socket.mli,v 1.1 2017/09/08 17:10:46 jaapb Exp $ - -Changes to deal with lwt 3.1 ---- src/server/ocsigen_socket.mli.orig 2016-11-24 13:31:34.000000000 +0000 -+++ src/server/ocsigen_socket.mli -@@ -10,7 +10,7 @@ type socket_type = - @param addr type of addresss (All | IPv4 | IPv6) - @param port port of socket - *) --val make_sockets : socket_type -> int -> Lwt_unix.file_descr list -+val make_sockets : socket_type -> int -> Lwt_unix.file_descr list Lwt.t - - (** ip_of_sockaddr accessor for ip - @param A Unix.ADDR_INET value or raise error |