Skip to content

Commit

Permalink
dev-ml/ocaml-dns: Fix build with lwt3
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.5, Repoman-2.3.2
  • Loading branch information
aballier committed Apr 12, 2017
1 parent 5e6a1e4 commit 0d1a0a8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
18 changes: 18 additions & 0 deletions dev-ml/ocaml-dns/files/lwt3.patch
Original file line number Diff line number Diff line change
@@ -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 ->
8 changes: 6 additions & 2 deletions dev-ml/ocaml-dns/ocaml-dns-0.20.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:=
Expand All @@ -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) \
Expand Down

0 comments on commit 0d1a0a8

Please sign in to comment.