Skip to content

Commit

Permalink
use dune
Browse files Browse the repository at this point in the history
  • Loading branch information
samoht committed Sep 4, 2018
1 parent b66953b commit a512b74
Show file tree
Hide file tree
Showing 47 changed files with 150 additions and 313 deletions.
2 changes: 1 addition & 1 deletion META.cohttp.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# JBUILDER_GEN
# DUNE_GEN

package "top" (
description = "Deprecated. Use cohttp-top directly"
Expand Down
31 changes: 5 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,13 @@
.PHONY: build clean test install uninstall clean all-supported-ocaml-versions
.PHONY: build clean test clean all-supported-ocaml-versions

build:
jbuilder build --dev @install
dune build

test:
jbuilder runtest

install:
jbuilder install

uninstall:
jbuilder uninstall
dune runtest

clean:
rm -rf _build *.install

REPO=../../mirage/mirage-dev
PACKAGES=$(REPO)/packages
# until we have https://github.com/ocaml/opam-publish/issues/38
pkg-%:
topkg opam pkg -n $*
mkdir -p $(PACKAGES)/$*
cp -r _build/$*.* $(PACKAGES)/$*/
cd $(PACKAGES) && git add $*
dune clean

all-supported-ocaml-versions:
jbuilder build --dev @install @runtest --workspace jbuild-workspace.dev

PKGS=$(basename $(wildcard *.opam))
opam-pkg:
$(MAKE) $(PKGS:%=pkg-%)


dune build @install @runtest --workspace jbuild-workspace.dev
8 changes: 4 additions & 4 deletions cohttp-async.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ license: "ISC"
tags: ["org:mirage" "org:xapi-project"]
dev-repo: "https://github.com/mirage/ocaml-cohttp.git"
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
build-test: [["jbuilder" "runtest" "-p" name "-j" jobs]]
build-test: ["dune" "runtest" "-p" name "-j" jobs]
depends: [
"jbuilder" {build & >= "1.0+beta10"}
"dune" {build & >= "1.1.0"}
"async_kernel" {>= "v0.11.0"}
"async_unix" {>= "v0.11.0"}
"async_extra" {>= "v0.11.0"}
Expand Down
6 changes: 6 additions & 0 deletions cohttp-async/bin/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(executables
(names cohttp_curl_async cohttp_server_async)
(package cohttp-async)
(public_names cohttp-curl-async cohttp-server-async)
(libraries cohttp-async async_kernel async_extra async_unix base
cohttp cohttp_server fmt.tty))
15 changes: 0 additions & 15 deletions cohttp-async/bin/jbuild

This file was deleted.

7 changes: 7 additions & 0 deletions cohttp-async/src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(library
(name cohttp_async)
(synopsis "Async backend")
(public_name cohttp-async)
(libraries logs.fmt base fmt async_unix async_kernel async_extra uri
uri.services ipaddr.unix conduit-async magic-mime cohttp)
(preprocess (pps ppx_sexp_conv)))
20 changes: 0 additions & 20 deletions cohttp-async/src/jbuild

This file was deleted.

5 changes: 5 additions & 0 deletions cohttp-async/test/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(test
(name test_async_integration)
(package cohttp-async)
(libraries cohttp_async_test async_unix base core async_kernel oUnit
cohttp-async))
19 changes: 0 additions & 19 deletions cohttp-async/test/jbuild

This file was deleted.

8 changes: 4 additions & 4 deletions cohttp-lwt-jsoo.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ license: "ISC"
tags: ["org:mirage" "org:xapi-project"]
dev-repo: "https://github.com/mirage/ocaml-cohttp.git"
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
build-test: [["jbuilder" "runtest" "-p" name "-j" jobs]]
build-test: ["dune" "runtest" "-p" name "-j" jobs]
depends: [
"jbuilder" {build & >= "1.0+beta10"}
"dune" {build & >= "1.1.0"}
"cohttp" {>= "1.0.0"}
"cohttp-lwt" {>= "1.0.0"}
"lwt" {>="3.0.0"}
Expand Down
7 changes: 7 additions & 0 deletions cohttp-lwt-jsoo/src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(library
(name cohttp_lwt_jsoo)
(public_name cohttp-lwt-jsoo)
(synopsis "XHR/Lwt based http client")
(wrapped false)
(preprocess (pps js_of_ocaml-ppx))
(libraries js_of_ocaml cohttp-lwt))
9 changes: 0 additions & 9 deletions cohttp-lwt-jsoo/src/jbuild

This file was deleted.

8 changes: 4 additions & 4 deletions cohttp-lwt-unix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ license: "ISC"
tags: ["org:mirage" "org:xapi-project"]
dev-repo: "https://github.com/mirage/ocaml-cohttp.git"
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
build-test: [["jbuilder" "runtest" "-p" name "-j" jobs]]
build-test: ["dune" "runtest" "-p" name "-j" jobs]
depends: [
"jbuilder" {build & >= "1.0+beta10"}
"dune" {build & >= "1.1.0"}
"conduit-lwt-unix" {>="1.0.3"}
"cmdliner"
"magic-mime"
Expand Down
6 changes: 6 additions & 0 deletions cohttp-lwt-unix/bin/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(executables
(names cohttp_curl_lwt cohttp_proxy_lwt cohttp_server_lwt)
(libraries cohttp-lwt-unix cohttp_server logs logs.lwt logs.fmt logs.cli
cmdliner)
(package cohttp-lwt-unix)
(public_names cohttp-curl-lwt cohttp-proxy-lwt cohttp-server-lwt))
14 changes: 0 additions & 14 deletions cohttp-lwt-unix/bin/jbuild

This file was deleted.

7 changes: 7 additions & 0 deletions cohttp-lwt-unix/src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(library
(name cohttp_lwt_unix)
(public_name cohttp-lwt-unix)
(synopsis "Lwt/Unix backend for Cohttp")
(preprocess (pps ppx_sexp_conv))
(libraries fmt logs logs.lwt conduit-lwt-unix magic-mime lwt.unix cohttp
cohttp-lwt))
16 changes: 0 additions & 16 deletions cohttp-lwt-unix/src/jbuild

This file was deleted.

11 changes: 11 additions & 0 deletions cohttp-lwt-unix/test/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(test
(libraries cohttp-lwt-unix oUnit lwt.unix)
(package cohttp-lwt-unix)
(modules test_parser)
(name test_parser))

(test
(libraries cohttp_lwt_unix_test cohttp-lwt-unix)
(package cohttp-lwt-unix)
(modules test_sanity)
(name test_sanity))
23 changes: 0 additions & 23 deletions cohttp-lwt-unix/test/jbuild

This file was deleted.

8 changes: 4 additions & 4 deletions cohttp-lwt.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ license: "ISC"
tags: ["org:mirage" "org:xapi-project"]
dev-repo: "https://github.com/mirage/ocaml-cohttp.git"
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
build-test: [["jbuilder" "runtest" "-p" name "-j" jobs]]
build-test: ["dune" "runtest" "-p" name "-j" jobs]
depends: [
"jbuilder" {build & >= "1.0+beta10"}
"dune" {build & >= "1.1.0"}
"cohttp" {>= "1.0.0"}
"lwt"
"sexplib"
Expand Down
6 changes: 6 additions & 0 deletions cohttp-lwt/src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(library
(name cohttp_lwt)
(public_name cohttp-lwt)
(synopsis "Lwt backend")
(preprocess (pps ppx_sexp_conv))
(libraries lwt uri cohttp))
8 changes: 0 additions & 8 deletions cohttp-lwt/src/jbuild

This file was deleted.

8 changes: 4 additions & 4 deletions cohttp-mirage.opam
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ license: "ISC"
tags: ["org:mirage" "org:xapi-project"]
dev-repo: "https://github.com/mirage/ocaml-cohttp.git"
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
build-test: [["jbuilder" "runtest" "-p" name "-j" jobs]]
build-test: ["dune" "runtest" "-p" name "-j" jobs]
depends: [
"jbuilder" {build & >= "1.0+beta10"}
"dune" {build & >= "1.1.0"}
"result"
"mirage-flow-lwt" {>= "1.2.0"}
"mirage-channel-lwt" {>= "3.0.0"}
Expand Down
7 changes: 7 additions & 0 deletions cohttp-mirage/src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(library
(name cohttp_mirage)
(public_name cohttp-mirage)
(synopsis "Mirage backend for cohttp")
(wrapped false)
(libraries cohttp-lwt mirage-channel-lwt mirage-conduit sexplib
mirage-flow-lwt magic-mime astring))
15 changes: 0 additions & 15 deletions cohttp-mirage/src/jbuild

This file was deleted.

8 changes: 4 additions & 4 deletions cohttp-top.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ license: "ISC"
tags: ["org:mirage" "org:xapi-project"]
dev-repo: "https://github.com/mirage/ocaml-cohttp.git"
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
build-test: [["jbuilder" "runtest" "-p" name "-j" jobs]]
build-test: ["dune" "runtest" "-p" name "-j" jobs]
depends: [
"jbuilder" {build & >= "1.0+beta10"}
"dune" {build & >= "1.1.0"}
"cohttp"
]
available: [ocaml-version >= "4.03.0"]
4 changes: 4 additions & 0 deletions cohttp-top/src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name cohttp_top)
(public_name cohttp-top)
(libraries cohttp compiler-libs.toplevel))
6 changes: 0 additions & 6 deletions cohttp-top/src/jbuild

This file was deleted.

8 changes: 4 additions & 4 deletions cohttp.opam
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ license: "ISC"
tags: ["org:mirage" "org:xapi-project"]
dev-repo: "https://github.com/mirage/ocaml-cohttp.git"
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
build-test: [["jbuilder" "runtest" "-p" name "-j" jobs]]
build-test: ["dune" "runtest" "-p" name "-j" jobs]
depends: [
"jbuilder" {build & >= "1.0+beta10"}
"dune" {build & >= "1.1.0"}
"re" {>= "1.7.2"}
"uri" {>= "1.9.0"}
"fieldslib"
Expand Down
Loading

0 comments on commit a512b74

Please sign in to comment.