dev-ml/ocaml-dns: Fix build with lwt3
authorAlexis Ballier <aballier@gentoo.org>
Wed, 12 Apr 2017 18:27:36 +0000 (20:27 +0200)
committerAlexis Ballier <aballier@gentoo.org>
Wed, 12 Apr 2017 19:20:25 +0000 (21:20 +0200)
Package-Manager: Portage-2.3.5, Repoman-2.3.2

dev-ml/ocaml-dns/files/lwt3.patch [new file with mode: 0644]
dev-ml/ocaml-dns/ocaml-dns-0.20.0.ebuild

diff --git a/dev-ml/ocaml-dns/files/lwt3.patch b/dev-ml/ocaml-dns/files/lwt3.patch
new file mode 100644 (file)
index 0000000..a158d8f
--- /dev/null
@@ -0,0 +1,18 @@
+Index: ocaml-dns-0.20.0/lwt/dns_server_unix.ml
+===================================================================
+--- ocaml-dns-0.20.0.orig/lwt/dns_server_unix.ml
++++ ocaml-dns-0.20.0/lwt/dns_server_unix.ml
+@@ -31,10 +31,10 @@ let bind_fd ~address ~port =
+          let err = sp "cannot resolve %s: %s" address (Printexc.to_string exn) in
+          Lwt.fail (Failure err))
+   in
+-  src >|= fun src ->
++  src >>= fun src ->
+   let fd = Lwt_unix.(socket PF_INET SOCK_DGRAM 0) in
+-  let () = Lwt_unix.bind fd src in
+-  (fd, src)
++  Lwt_unix.bind fd src >>= fun () ->
++  Lwt.return (fd, src)
+ 
+ let eventual_process_of_zonefiles zonefiles =
+   Lwt_list.map_s (fun zonefile ->
index ccfefee54eb436982d2b795cf726a9d585e2b2a1..7f438c62e281b7ce8534bd854ff66d6183ae4e52 100644 (file)
@@ -3,7 +3,7 @@
 
 EAPI=5
 
-inherit findlib
+inherit findlib eutils
 
 DESCRIPTION="A pure OCaml implementation of the DNS protocol"
 HOMEPAGE="https://github.com/mirage/ocaml-dns https://mirage.io"
@@ -16,7 +16,7 @@ IUSE="async +lwt +ocamlopt test"
 
 RDEPEND="
        async? ( dev-ml/async:= )
-       lwt? ( >=dev-ml/lwt-2.4.7:=
+       lwt? ( >=dev-ml/lwt-3:=
                dev-ml/ocaml-cstruct:=[lwt(-)] )
        >=dev-lang/ocaml-4:=
        dev-ml/cmdliner:=
@@ -43,6 +43,10 @@ DEPEND="
 # Missing mirage deps
 RESTRICT="test"
 
+src_prepare() {
+       epatch "${FILESDIR}/lwt3.patch"
+}
+
 src_compile() {
        ocaml pkg/pkg.ml build \
                --tests $(usex test true false) \