Skip to content

Commit 9b701d3

Browse files
authored
Merge pull request #42 from djs55/jbuilder
Modernise build and CI
2 parents 25a889d + 07e0551 commit 9b701d3

File tree

9 files changed

+52
-34
lines changed

9 files changed

+52
-34
lines changed

.travis.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
language: c
2-
install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-opam.sh
3-
sudo: required
4-
script: sudo bash -ex .travis-opam.sh # sudo because we're going to use tuntap
2+
sudo: false
3+
services:
4+
- docker
5+
install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-docker.sh
6+
script: bash -ex ./.travis-docker.sh
57
env:
68
global:
7-
- PACKAGE=mirage-net-unix EXTRA_REMOTES="git://github.com/mirage/mirage-dev.git"
9+
- EXTRA_REMOTES="https://github.com/djs55/opam-repository.git#io-page"
10+
- PACKAGE="mirage-net-unix"
811
matrix:
9-
- OCAML_VERSION=4.02
10-
- OCAML_VERSION=4.03
12+
- DISTRO="debian-testing" OCAML_VERSION="4.03.0"
13+
- DISTRO="alpine-3.4" OCAML_VERSION="4.04.0"

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 2.4.1 (16-Jun-2017)
2+
3+
* Build with jbuilder
4+
* Update to use io-page-unix
5+
16
### 2.4.0 (02-Apr-2017)
27

38
* Expose the underlying fd (#40, from @samoht)

Makefile

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
all:
2-
ocaml pkg/pkg.ml build --tests true
3-
ocaml pkg/pkg.ml test
1+
2+
.PHONY: build clean test
3+
4+
build:
5+
jbuilder build @install --dev
6+
7+
test:
8+
jbuilder runtest --dev
9+
10+
install:
11+
jbuilder install
12+
13+
uninstall:
14+
jbuilder uninstall
415

516
clean:
6-
ocaml pkg/pkg.ml clean
17+
rm -rf _build

_tags

Lines changed: 0 additions & 7 deletions
This file was deleted.

opam renamed to mirage-net-unix.opam

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,18 @@ dev-repo: "https://github.com/mirage/mirage-net-unix.git"
1212
license: "ISC"
1313
doc: "https://mirage.github.io/mirage-net-unix/"
1414

15-
build: [ "ocaml" "pkg/pkg.ml" "build" "--pinned" "%{pinned}%" "--tests" "false" ]
16-
build-test: [
17-
[ "ocaml" "pkg/pkg.ml" "build" "--tests" "true" ]
18-
[ "ocaml" "pkg/pkg.ml" "test" ]
15+
build: [
16+
[ "jbuilder" "subst"] {pinned}
17+
[ "jbuilder" "build" "-p" name "-j" jobs ]
1918
]
19+
2020
depends: [
21+
"jbuilder" {build & >="1.0+beta9"}
2122
"cstruct" {>= "1.7.1"}
22-
"ocamlfind" {build}
23-
"ocamlbuild" {build}
24-
"topkg" {build}
23+
"cstruct-lwt"
2524
"lwt" {>= "2.4.3"}
2625
"mirage-net-lwt" {>= "1.0.0"}
27-
"io-page" {>= "1.0.1"}
26+
"io-page-unix" {>= "2.0.0"}
2827
"tuntap" {>= "1.3.0"}
2928
"result"
3029
"alcotest" {test}

pkg/pkg.ml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
#!/usr/bin/env ocaml
22
#use "topfind"
3-
#require "topkg"
4-
open Topkg
5-
6-
let () =
7-
Pkg.describe "mirage-net-unix" @@ fun c ->
8-
Ok [ Pkg.mllib "src/mirage-net-unix.mllib";
9-
Pkg.test "test/test"
10-
]
3+
#require "topkg-jbuilder.auto"

src/jbuild

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(library
2+
((name mirage_net_unix)
3+
(public_name mirage-net-unix)
4+
(libraries (io-page-unix cstruct cstruct-lwt lwt.unix mirage-net-lwt tuntap result))
5+
(wrapped false)
6+
))

src/mirage-net-unix.mllib

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/jbuild

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(executables
2+
((names (test))
3+
(libraries (alcotest mirage-net-unix))
4+
))
5+
6+
(alias
7+
((name runtest)
8+
(deps (test.exe))
9+
(action (run ${<} ))))

0 commit comments

Comments
 (0)