Skip to content

Commit ba810e0

Browse files
authored
Merge pull request #671 from tarides/update-instructions
Update set-up instructions
2 parents d6c8f7f + fd311ff commit ba810e0

6 files changed

Lines changed: 24 additions & 15 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ocaml/opam:alpine-3.23-ocaml-4.14 AS build
22
RUN sudo ln -sf /usr/bin/opam-2.5 /usr/bin/opam && \
33
opam init --reinit -ni
4-
RUN opam repo add archive git+https://github.com/ocaml/opam-repository-archive --all
4+
RUN opam repo add archive-without-constraint git+https://github.com/tarides/moby-vpnkit-opam-repository-archive#remove-dune-upper-constraint --all
55

66
ADD . /home/opam/vpnkit
77
RUN opam pin add vpnkit /home/opam/vpnkit --kind=path -n

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ build: vpnkit.exe
22

33
.PHONY: vpnkit.exe
44
vpnkit.exe:
5-
opam exec -- dune build --profile release
5+
opam exec -- dune build --profile release @install
66

77
.PHONY: ocaml
88
ocaml:
9-
ocaml -version || opam init --compiler=4.14.0
10-
opam pin add vpnkit . -n
9+
opam switch create ./ ocaml-base-compiler.4.14.3 --no-install
10+
opam repo add archive-without-constraint git+https://github.com/tarides/moby-vpnkit-opam-repository-archive#remove-dune-upper-constraint
11+
opam pin add vpnkit . --kind=path --no-action
1112

1213
.PHONY: depends
1314
depends:
14-
opam install --deps-only -t vpnkit
15+
opam install vpnkit --deps-only --with-test
1516

1617
.PHONY: test
1718
test:

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ Building on Unix (including Mac)
2020
First install `wget`, `opam`, `pkg-config`, and `dylibbundler` using your
2121
package manager of choice.
2222

23-
If you are an existing `opam` user then you can either build against your existing `opam`
24-
package universe, or the custom universe contained in this repo. To use the custom universe,
25-
ensure that you unset your `OPAMROOT` environment variable:
26-
```
27-
unset OPAMROOT
28-
```
23+
If you are an existing `opam` user then you can either build against your
24+
existing `opam` package universe, or the custom universe contained in this
25+
repo.
2926

3027
To set up the OCaml build environment, type:
3128
```
@@ -40,7 +37,16 @@ To build:
4037
make
4138
```
4239

43-
When the build succeeds the `vpnkit.exe` binary should be available in the current directory.
40+
When the build succeeds the `vpnkit` binary should be available in
41+
`_build/install/default/bin/vpnkit`.
42+
43+
Alternatively you can run it with Dune:
44+
45+
```
46+
dune exec vpnkit
47+
```
48+
49+
which will automatically build and execute `vpnkit`.
4450

4551
Building on Windows
4652
-------------------

dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
(lang dune 2.0)
1+
(lang dune 3.23)
22
(name vpnkit)

dune-workspace

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
(lang dune 3.19)
1+
(lang dune 3.23)
22

33
(repository
44
(name archive-without-constraint)
55
(url git+https://github.com/tarides/moby-vpnkit-opam-repository-archive#remove-dune-upper-constraint))
66

77
(lock_dir
88
(repositories upstream overlay archive-without-constraint))
9+
10+
(pkg disabled)

vpnkit.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ build: [
2525

2626
depends: [
2727
"ocaml" {>="4.08.0"}
28-
"dune" {>= "3.19"}
28+
"dune" {>= "3.23"}
2929
"alcotest" {with-test}
3030
"ounit" {with-test}
3131
"tar" {>= "1.0.1"}

0 commit comments

Comments
 (0)