-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
h2-lwt-unix: replace dune file written in OCaml with
select
form (#68)
Also remove `{build}` constraint from the dune dependency in opam files
- Loading branch information
1 parent
65402ae
commit e1ea33a
Showing
8 changed files
with
37 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,21 @@ | ||
(* -*- tuareg -*- *) | ||
(* This was inspired by `conduit-lwt-unix`'s dune file *) | ||
|
||
let v ~ssl ~tls () = | ||
let ssl, ssl_d = | ||
if ssl then "ssl_io_real", "lwt_ssl " | ||
else "ssl_io_dummy", "" | ||
in | ||
let tls, tls_d = | ||
if tls then "tls_io_real", "tls.lwt " | ||
else "tls_io_dummy", "" | ||
in | ||
Printf.sprintf {| | ||
(rule (copy %s.ml ssl_io.ml)) | ||
(rule (copy %s.ml tls_io.ml)) | ||
|
||
(library | ||
(name h2_lwt_unix) | ||
(public_name h2-lwt-unix) | ||
(libraries faraday-lwt-unix h2 h2-lwt lwt.unix %s%s) | ||
(libraries | ||
faraday-lwt-unix | ||
h2 | ||
h2-lwt | ||
lwt.unix | ||
(select | ||
ssl_io.ml | ||
from | ||
(lwt_ssl -> ssl_io_real.ml) | ||
(-> ssl_io_dummy.ml)) | ||
(select | ||
tls_io.ml | ||
from | ||
(tls.lwt -> tls_io_real.ml) | ||
(-> tls_io_dummy.ml))) | ||
(modules h2_lwt_unix tls_io ssl_io) | ||
(flags (:standard -safe-string))) | ||
|} ssl tls ssl_d tls_d | ||
|
||
let main () = | ||
let is_installed s = Printf.kprintf Sys.command "ocamlfind query %s" s = 0 in | ||
let ssl = is_installed "lwt_ssl" in | ||
let tls = is_installed "tls.lwt" in | ||
Printf.printf | ||
"Configuration\n\ | ||
\ ssl : %b\n\ | ||
\ tls : %b\n%!" | ||
ssl tls; | ||
v ~ssl ~tls () | ||
|
||
let () = Jbuild_plugin.V1.send @@ main () | ||
(flags | ||
(:standard -safe-string))) |