diff --git a/Makefile b/Makefile index 6fe09425..fe0f7ad4 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ .PHONY : build build : - @dune build -p dream-pure,dream --no-print-directory @install + @dune build -p dream-pure,dream-httpaf,dream --no-print-directory @install .PHONY : watch watch : - @dune build -p dream-pure,dream --no-print-directory -w + @dune build -p dream-pure,dream-httpaf,dream --no-print-directory -w TEST ?= test diff --git a/dream-httpaf.opam b/dream-httpaf.opam new file mode 100644 index 00000000..c3ebf5a9 --- /dev/null +++ b/dream-httpaf.opam @@ -0,0 +1,44 @@ +opam-version: "2.0" + +synopsis: "Internal: shared http/af stack for Dream (server) and Hyper (client)" + +license: "MIT" +homepage: "https://github.com/aantron/dream" +doc: "https://aantron.github.io/dream" +bug-reports: "https://github.com/aantron/dream/issues" +dev-repo: "git+https://github.com/aantron/dream.git" + +author: "Anton Bachin " +maintainer: "Anton Bachin " + +depends: [ + "dune" {>= "2.7.0"} # --instrument-with. + "lwt" + "lwt_ssl" + "ocaml" {>= "4.08.0"} + "ssl" {>= "0.5.8"} # Ssl.get_negotiated_alpn_protocol. + + # Currently vendored. + # "gluten" + # "gluten-lwt-unix" + # "httpaf" + # "httpaf-lwt-unix" + # "h2" + # "h2-lwt-unix" + # "hpack" + # "websocketaf" + + # Dependencies of vendored packages. + "angstrom" {>= "0.14.0"} + "base64" {>= "3.0.0"} + "bigstringaf" {>= "0.5.0"} # h2. + "digestif" {>= "0.7.2"} # websocket/af, sha1, default implementation. + "faraday" {>= "0.6.1"} + "faraday-lwt-unix" + "psq" # h2. + "result" # http/af, websocket/af. +] + +build: [ + ["dune" "build" "-p" name "-j" jobs] +] diff --git a/dream.opam b/dream.opam index 7d0bf5e9..f1d3f0f5 100644 --- a/dream.opam +++ b/dream.opam @@ -54,6 +54,7 @@ depends: [ "conf-libev" {os != "win32"} "cstruct" {>= "6.0.0"} "dream-pure" + "dream-httpaf" "dune" {>= "2.7.0"} # --instrument-with. "fmt" {>= "0.8.7"} # `Italic. "graphql_parser" @@ -73,25 +74,6 @@ depends: [ "uri" {>= "4.2.0"} "yojson" # ... - # Currently vendored. - # "gluten" - # "gluten-lwt-unix" - # "httpaf" - # "httpaf-lwt-unix" - # "h2" - # "h2-lwt-unix" - # "hpack" - # "websocketaf" - - # Dependencies of vendored packages. - "angstrom" {>= "0.14.0"} - "bigstringaf" {>= "0.5.0"} # h2. - "digestif" {>= "0.7.2"} # websocket/af, sha1, default implementation. - "faraday" {>= "0.6.1"} - "faraday-lwt-unix" - "psq" # h2. - "result" # http/af, websocket/af. - # Testing, development. "bisect_ppx" {with-test & >= "2.5.0"} # --instrument-with. "caqti-driver-postgresql" {with-test} diff --git a/src/http/dune b/src/http/dune index f0ee185b..78693aca 100644 --- a/src/http/dune +++ b/src/http/dune @@ -9,17 +9,17 @@ dream.localhost dream.middleware dream-pure - dream.gluten - dream.gluten-lwt-unix - dream.h2 - dream.h2-lwt-unix - dream.httpaf - dream.httpaf-lwt-unix + dream-httpaf.gluten + dream-httpaf.gluten-lwt-unix + dream-httpaf.h2 + dream-httpaf.h2-lwt-unix + dream-httpaf.httpaf + dream-httpaf.httpaf-lwt-unix lwt lwt.unix lwt_ssl ssl - dream.websocketaf + dream-httpaf.websocketaf ) (preprocess (pps lwt_ppx)) (instrumentation (backend bisect_ppx))) diff --git a/src/vendor/dune b/src/vendor/dune index 9bd5fba3..ac440a8b 100644 --- a/src/vendor/dune +++ b/src/vendor/dune @@ -1,5 +1,7 @@ (data_only_dirs *) + + (subdir paf/lib (library (name paf) @@ -12,7 +14,7 @@ (name alpn) (public_name dream-mirage.paf.alpn) (modules alpn) - (libraries dream-mirage.paf dream.httpaf dream.h2))) + (libraries dream-mirage.paf dream-httpaf.httpaf dream-httpaf.h2))) (subdir paf/lib (library @@ -27,13 +29,15 @@ (wrapped false) (public_name dream-mirage.paf.le) (modules lE) - (libraries dream.httpaf dream-mirage.paf mirage-time mirage-stack duration tls-mirage emile + (libraries dream-httpaf.httpaf dream-mirage.paf mirage-time mirage-stack duration tls-mirage emile letsencrypt))) + + (subdir gluten/lib (library (name gluten) - (public_name dream.gluten) + (public_name dream-httpaf.gluten) (libraries bigstringaf faraday))) @@ -41,18 +45,18 @@ (subdir gluten/lwt (library (name gluten_lwt) - (public_name dream.gluten-lwt) + (public_name dream-httpaf.gluten-lwt) (libraries - dream.gluten + dream-httpaf.gluten lwt))) (subdir gluten/lwt-unix (library (name gluten_lwt_unix) - (public_name dream.gluten-lwt-unix) + (public_name dream-httpaf.gluten-lwt-unix) (libraries faraday-lwt-unix - dream.gluten-lwt + dream-httpaf.gluten-lwt lwt.unix (select ssl_io.ml @@ -71,43 +75,43 @@ (subdir websocketaf/lib (library (name websocketaf) - (public_name dream.websocketaf) + (public_name dream-httpaf.websocketaf) (libraries angstrom base64 bigstringaf faraday - dream.gluten + dream-httpaf.gluten httpaf result))) (subdir websocketaf/lwt (library (name websocketaf_lwt) - (public_name dream.websocketaf-lwt) + (public_name dream-httpaf.websocketaf-lwt) (libraries base64 digestif.ocaml - dream.gluten-lwt + dream-httpaf.gluten-lwt lwt - dream.websocketaf))) + dream-httpaf.websocketaf))) (subdir websocketaf/lwt-unix (library (name websocketaf_lwt_unix) - (public_name dream.websocketaf-lwt-unix) + (public_name dream-httpaf.websocketaf-lwt-unix) (libraries faraday-lwt-unix - dream.gluten-lwt-unix + dream-httpaf.gluten-lwt-unix lwt.unix - dream.websocketaf-lwt))) + dream-httpaf.websocketaf-lwt))) (subdir httpaf/lib (library (name httpaf) - (public_name dream.httpaf) + (public_name dream-httpaf.httpaf) (libraries angstrom bigstringaf @@ -117,22 +121,22 @@ (subdir httpaf/lwt (library (name httpaf_lwt) - (public_name dream.httpaf-lwt) + (public_name dream-httpaf.httpaf-lwt) (libraries - dream.gluten - dream.gluten-lwt - dream.httpaf + dream-httpaf.gluten + dream-httpaf.gluten-lwt + dream-httpaf.httpaf lwt))) (subdir httpaf/lwt-unix (library (name httpaf_lwt_unix) - (public_name dream.httpaf-lwt-unix) + (public_name dream-httpaf.httpaf-lwt-unix) (libraries faraday-lwt-unix - dream.gluten-lwt-unix - dream.httpaf - dream.httpaf-lwt + dream-httpaf.gluten-lwt-unix + dream-httpaf.httpaf + dream-httpaf.httpaf-lwt lwt.unix))) @@ -146,7 +150,7 @@ (subdir h2/hpack/src (library (name hpack) - (public_name dream.hpack) + (public_name dream-httpaf.hpack) (libraries angstrom faraday)) @@ -161,34 +165,34 @@ (subdir h2/lib (library (name h2) - (public_name dream.h2) + (public_name dream-httpaf.h2) (libraries angstrom base64 bigstringaf faraday - dream.hpack - dream.httpaf + dream-httpaf.hpack + dream-httpaf.httpaf psq result))) (subdir h2/lwt (library (name h2_lwt) - (public_name dream.h2-lwt) + (public_name dream-httpaf.h2-lwt) (libraries - dream.gluten - dream.gluten-lwt + dream-httpaf.gluten + dream-httpaf.gluten-lwt lwt - dream.h2))) + dream-httpaf.h2))) (subdir h2/lwt-unix (library (name h2_lwt_unix) - (public_name dream.h2-lwt-unix) + (public_name dream-httpaf.h2-lwt-unix) (libraries faraday-lwt-unix - dream.gluten-lwt-unix - dream.h2 - dream.h2-lwt + dream-httpaf.gluten-lwt-unix + dream-httpaf.h2 + dream-httpaf.h2-lwt lwt.unix)))