Skip to content

Commit

Permalink
Factor out dream-httpaf
Browse files Browse the repository at this point in the history
  • Loading branch information
aantron committed Dec 16, 2021
1 parent 7aa5e7b commit 110575d
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 64 deletions.
4 changes: 2 additions & 2 deletions 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

Expand Down
44 changes: 44 additions & 0 deletions 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 <antonbachin@yahoo.com>"
maintainer: "Anton Bachin <antonbachin@yahoo.com>"

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]
]
20 changes: 1 addition & 19 deletions dream.opam
Expand Up @@ -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"
Expand All @@ -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}
Expand Down
14 changes: 7 additions & 7 deletions src/http/dune
Expand Up @@ -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)))
76 changes: 40 additions & 36 deletions src/vendor/dune
@@ -1,5 +1,7 @@
(data_only_dirs *)



(subdir paf/lib
(library
(name paf)
Expand All @@ -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
Expand All @@ -27,32 +29,34 @@
(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)))

(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
Expand All @@ -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
Expand All @@ -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)))


Expand All @@ -146,7 +150,7 @@
(subdir h2/hpack/src
(library
(name hpack)
(public_name dream.hpack)
(public_name dream-httpaf.hpack)
(libraries
angstrom
faraday))
Expand All @@ -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)))

0 comments on commit 110575d

Please sign in to comment.