Skip to content

Commit

Permalink
Merge pull request #391 from avsm/to-dune
Browse files Browse the repository at this point in the history
release 3.7: port to dune, switch to topkg
  • Loading branch information
avsm authored Feb 3, 2019
2 parents d24bb2f + cf3161c commit 4d8b23e
Show file tree
Hide file tree
Showing 27 changed files with 169 additions and 192 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
upstream in Lwt (ocsigen/lwt#361) (#388 by @avsm).
* Remove arpv4 and ethif sublibraries, now provided by ethernet and arp-mirage
opam packages (#380 by @hannesm).
* Upgrade from jbuilder to dune (#391 @avsm)
* Switch from topkg to dune-release (#391 @avsm)

### v3.6.0 (2019-01-04)

Expand Down
23 changes: 5 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,16 @@
.PHONY: build clean test

build:
jbuilder build @install --dev
dune build

test:
jbuilder runtest --dev
dune runtest

install:
jbuilder install
dune install

uninstall:
jbuilder uninstall
dune uninstall

clean:
jbuilder clean

REPO=../../mirage/opam-repository
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 $*

PKGS=$(basename $(wildcard *.opam))
opam-pkg:
$(MAKE) $(PKGS:%=pkg-%)
dune clean
2 changes: 2 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(lang dune 1.0)
(name tcpip)
3 changes: 3 additions & 0 deletions examples/ping/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(executables
(names ping)
(libraries cmdliner logs logs.fmt tcpip.icmpv4-socket))
4 changes: 0 additions & 4 deletions examples/ping/jbuild

This file was deleted.

3 changes: 0 additions & 3 deletions pkg/pkg.ml

This file was deleted.

3 changes: 3 additions & 0 deletions src/config/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(executable
(name discover)
(libraries base stdio configurator))
4 changes: 0 additions & 4 deletions src/config/jbuild

This file was deleted.

7 changes: 7 additions & 0 deletions src/icmp/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(library
(name tcpip_icmpv4)
(public_name tcpip.icmpv4)
(libraries mirage-protocols-lwt rresult logs tcpip mirage-profile tcpip.udp)
(preprocess
(pps ppx_cstruct))
(wrapped false))
7 changes: 0 additions & 7 deletions src/icmp/jbuild

This file was deleted.

8 changes: 8 additions & 0 deletions src/ipv4/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(library
(name tcpip_ipv4)
(public_name tcpip.ipv4)
(libraries logs io-page mirage-protocols-lwt ipaddr cstruct rresult tcpip
ethernet tcpip.udp mirage-random mirage-clock randomconv lru)
(preprocess
(pps ppx_cstruct))
(wrapped false))
8 changes: 0 additions & 8 deletions src/ipv4/jbuild

This file was deleted.

9 changes: 9 additions & 0 deletions src/ipv6/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(library
(name tcpip_ipv6)
(public_name tcpip.ipv6)
(libraries logs io-page mirage-protocols-lwt mirage-time-lwt
mirage-clock-lwt duration ipaddr cstruct rresult mirage-random tcpip
randomconv ethernet)
(preprocess
(pps ppx_cstruct))
(wrapped false))
8 changes: 0 additions & 8 deletions src/ipv6/jbuild

This file was deleted.

5 changes: 5 additions & 0 deletions src/stack-direct/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(library
(name tcpip_stack_direct)
(public_name tcpip.stack-direct)
(libraries logs ipaddr lwt result fmt mirage-time-lwt mirage-random
mirage-protocols-lwt mirage-stack-lwt mirage-net-lwt))
6 changes: 0 additions & 6 deletions src/stack-direct/jbuild

This file was deleted.

54 changes: 54 additions & 0 deletions src/stack-unix/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
(library
(name icmpv4_socket)
(public_name tcpip.icmpv4-socket)
(modules icmpv4_socket)
(wrapped false)
(libraries lwt.unix ipaddr.unix cstruct-lwt io-page-unix tcpip.icmpv4
tcpip.ipv4 tcpip.ipv6 mirage-protocols-lwt))

(library
(name udpv4_socket)
(public_name tcpip.udpv4-socket)
(modules udpv4_socket)
(wrapped false)
(libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols-lwt))

(library
(name udpv6_socket)
(public_name tcpip.udpv6-socket)
(modules udpv6_socket)
(wrapped false)
(libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols-lwt))

(library
(name tcp_socket_options)
(public_name tcpip.tcp_socket_options)
(modules tcp_socket_options)
(c_names tcp_socket_options_stubs)
(wrapped false)
(libraries lwt.unix duration))

(library
(name tcpv4_socket)
(public_name tcpip.tcpv4-socket)
(modules tcpv4_socket tcp_socket)
(wrapped false)
(libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols
mirage-protocols-lwt tcp_socket_options))

(library
(name tcpv6_socket)
(public_name tcpip.tcpv6-socket)
(modules tcpv6_socket)
(wrapped false)
(libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols
mirage-protocols-lwt tcpv4_socket tcp_socket_options))

(library
(name tcpip_stack_socket)
(public_name tcpip.stack-socket)
(modules tcpip_stack_socket ipv4_socket ipv6_socket)
(wrapped false)
(libraries lwt.unix cstruct-lwt ipaddr.unix io-page-unix logs
tcpip.tcpv4-socket tcpip.udpv4-socket tcpip.ipv4 tcpip.ipv6 tcpip.icmpv4
mirage-protocols-lwt mirage-stack-lwt))
62 changes: 0 additions & 62 deletions src/stack-unix/jbuild

This file was deleted.

8 changes: 8 additions & 0 deletions src/tcp/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(library
(name tcp)
(public_name tcpip.tcp)
(libraries logs mirage-protocols-lwt ipaddr cstruct lwt-dllist rresult
mirage-profile io-page tcpip duration randomconv fmt mirage-time-lwt
mirage-clock mirage-random)
(preprocess
(pps ppx_cstruct)))
10 changes: 0 additions & 10 deletions src/tcp/jbuild

This file was deleted.

37 changes: 37 additions & 0 deletions src/tcpip_checksum/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
(library
(name tcpip)
(public_name tcpip)
(modules tcpip_checksum)
(libraries cstruct tcpip.unix)
(wrapped false))

(library
(name tcpip_xen)
(public_name tcpip.xen)
(libraries tcpip)
(modules tcpip_xen)
(c_names checksum_stubs_xen)
(c_flags
(:include c_flags_xen.sexp))
(wrapped false))

(rule
(targets c_flags_xen.sexp)
(deps
(:< ../config/discover.exe))
(action
(run %{<} -ocamlc %{ocamlc})))

(rule
(targets checksum_stubs_xen.c)
(deps
(:< checksum_stubs.c))
(action
(copy# %{<} %{targets})))

(library
(name tcpip_unix)
(public_name tcpip.unix)
(modules tcpip_unix)
(c_names checksum_stubs)
(wrapped false))
34 changes: 0 additions & 34 deletions src/tcpip_checksum/jbuild

This file was deleted.

7 changes: 7 additions & 0 deletions src/udp/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(library
(name tcpip_udpv4)
(public_name tcpip.udp)
(libraries mirage-protocols-lwt mirage-random rresult logs tcpip randomconv)
(preprocess
(pps ppx_cstruct))
(wrapped false))
7 changes: 0 additions & 7 deletions src/udp/jbuild

This file was deleted.

8 changes: 4 additions & 4 deletions tcpip.opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ license: "ISC"
tags: ["org:mirage"]

build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["jbuilder" "runtest" "-p" name "-j" jobs] {with-test}
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]

depends: [
"jbuilder" {build & >="1.0+beta10"}
"dune" {build & >= "1.0"}
"configurator" {build}
"ocaml" {>= "4.03.0"}
"rresult" {>= "0.5.0"}
Expand Down
15 changes: 15 additions & 0 deletions test/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(executables
(names test)
(libraries alcotest mirage-random-test lwt.unix io-page-unix tcpip.unix logs
logs.fmt mirage-profile mirage-flow mirage-vnetif mirage-clock-unix
pcap-format duration mirage-random rresult mirage-protocols-lwt
mirage-stack-lwt arp arp-mirage ethernet tcpip.ipv4 tcpip.tcp tcpip.udp
tcpip.stack-direct tcpip.icmpv4 tcpip.udpv4-socket tcpip.tcpv4-socket
tcpip.icmpv4-socket tcpip.stack-socket tcpip.ipv6))

(alias
(name runtest)
(deps
(:< test.exe))
(action
(run %{<} -q -e --color=always)))
Loading

0 comments on commit 4d8b23e

Please sign in to comment.