Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ml/ocaml-conduit/files/, dev-ml/ocaml-conduit/
Date: Wed, 12 Apr 2017 19:21:05
Message-Id: 1492024826.484e623c7cf83d45191e0d22f14cb5e86faf70c9.aballier@gentoo
1 commit: 484e623c7cf83d45191e0d22f14cb5e86faf70c9
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 12 19:09:49 2017 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 12 19:20:26 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=484e623c
7
8 dev-ml/ocaml-conduit: Fix build with lwt3.
9
10 Package-Manager: Portage-2.3.5, Repoman-2.3.2
11
12 dev-ml/ocaml-conduit/files/lwt3.patch | 58 ++++++++++++++++++++++++
13 dev-ml/ocaml-conduit/ocaml-conduit-0.15.0.ebuild | 8 +++-
14 2 files changed, 64 insertions(+), 2 deletions(-)
15
16 diff --git a/dev-ml/ocaml-conduit/files/lwt3.patch b/dev-ml/ocaml-conduit/files/lwt3.patch
17 new file mode 100644
18 index 00000000000..de849e60d79
19 --- /dev/null
20 +++ b/dev-ml/ocaml-conduit/files/lwt3.patch
21 @@ -0,0 +1,58 @@
22 +Index: ocaml-conduit-0.15.0/lib/conduit_lwt_server.ml
23 +===================================================================
24 +--- ocaml-conduit-0.15.0.orig/lib/conduit_lwt_server.ml
25 ++++ ocaml-conduit-0.15.0/lib/conduit_lwt_server.ml
26 +@@ -15,10 +15,10 @@ let close (ic, oc) =
27 + let listen ?(backlog=128) sa =
28 + let fd = Lwt_unix.socket (Unix.domain_of_sockaddr sa) Unix.SOCK_STREAM 0 in
29 + Lwt_unix.(setsockopt fd SO_REUSEADDR true);
30 +- Lwt_unix.bind fd sa;
31 ++ Lwt_unix.bind fd sa >>= fun _ ->
32 + Lwt_unix.listen fd backlog;
33 + Lwt_unix.set_close_on_exec fd;
34 +- fd
35 ++ Lwt.return fd
36 +
37 + let with_socket sockaddr f =
38 + let fd =
39 +Index: ocaml-conduit-0.15.0/lib/conduit_lwt_server.mli
40 +===================================================================
41 +--- ocaml-conduit-0.15.0.orig/lib/conduit_lwt_server.mli
42 ++++ ocaml-conduit-0.15.0/lib/conduit_lwt_server.mli
43 +@@ -3,7 +3,7 @@ val close : 'a Lwt_io.channel * 'b Lwt_i
44 +
45 + val set_max_active : int -> unit
46 +
47 +-val listen : ?backlog:int -> Unix.sockaddr -> Lwt_unix.file_descr
48 ++val listen : ?backlog:int -> Unix.sockaddr -> Lwt_unix.file_descr Lwt.t
49 +
50 + val with_socket
51 + : Unix.sockaddr
52 +Index: ocaml-conduit-0.15.0/lib/conduit_lwt_unix.ml
53 +===================================================================
54 +--- ocaml-conduit-0.15.0.orig/lib/conduit_lwt_unix.ml
55 ++++ ocaml-conduit-0.15.0/lib/conduit_lwt_unix.ml
56 +@@ -167,11 +167,12 @@ let init ?src ?(tls_server_key=`None) ()
57 + module Sockaddr_client = struct
58 + let connect ?src sa =
59 + Conduit_lwt_server.with_socket sa (fun fd ->
60 +- let () =
61 ++ let tx () =
62 + match src with
63 +- | None -> ()
64 ++ | None -> Lwt.return ()
65 + | Some src_sa -> Lwt_unix.bind fd src_sa
66 +- in
67 ++ in
68 ++ tx () >>= fun () ->
69 + Lwt_unix.connect fd sa >>= fun () ->
70 + let ic = Lwt_io.of_fd ~mode:Lwt_io.input fd in
71 + let oc = Lwt_io.of_fd ~mode:Lwt_io.output fd in
72 +@@ -199,6 +200,7 @@ module Sockaddr_server = struct
73 + match on with
74 + | `Socket s -> s
75 + | `Sockaddr sockaddr -> Conduit_lwt_server.listen ?backlog sockaddr in
76 ++ s >>= fun s ->
77 + Conduit_lwt_server.init ?stop (process_accept ?timeout callback) s
78 + end
79 +
80
81 diff --git a/dev-ml/ocaml-conduit/ocaml-conduit-0.15.0.ebuild b/dev-ml/ocaml-conduit/ocaml-conduit-0.15.0.ebuild
82 index 8e5f0e39101..cd8c6a3b6cc 100644
83 --- a/dev-ml/ocaml-conduit/ocaml-conduit-0.15.0.ebuild
84 +++ b/dev-ml/ocaml-conduit/ocaml-conduit-0.15.0.ebuild
85 @@ -3,7 +3,7 @@
86
87 EAPI=5
88
89 -inherit findlib
90 +inherit findlib eutils
91
92 DESCRIPTION="Dereference URIs into communication channels for Async or Lwt"
93 HOMEPAGE="https://github.com/mirage/ocaml-conduit"
94 @@ -23,7 +23,7 @@ DEPEND="
95 dev-ml/ocaml-cstruct:=
96 dev-ml/ocaml-ipaddr:=
97
98 - dev-ml/lwt:=
99 + >=dev-ml/lwt-3:=
100 dev-ml/async:=
101 dev-ml/ocaml-dns:=
102 dev-ml/ocaml-ssl:=
103 @@ -39,6 +39,10 @@ DEPEND="${DEPEND}
104
105 DOCS=( TODO.md README.md CHANGES )
106
107 +src_prepare() {
108 + epatch "${FILESDIR}/lwt3.patch"
109 +}
110 +
111 src_install() {
112 findlib_src_preinst
113 default