diff --git a/.gitignore b/.gitignore index 01c9cd9..0e1b1d4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ # vim: *.swp +/_build/ diff --git a/dune b/dune new file mode 100644 index 0000000..8daec20 --- /dev/null +++ b/dune @@ -0,0 +1 @@ +(env (dev (flags (:standard -warn-error -A)))) diff --git a/dune-project b/dune-project new file mode 100644 index 0000000..53dcc04 --- /dev/null +++ b/dune-project @@ -0,0 +1,5 @@ +(lang dune 2.0) +(name piqi) + +(package (name piqi)) +(package (name piqirun)) diff --git a/opam b/opam index be9411e..76403a4 100644 --- a/opam +++ b/opam @@ -4,18 +4,6 @@ authors: "Anton Lavrik " maintainer: "Anton Lavrik " homepage: "https://github.com/alavrik/piqi-ocaml" bug-reports: "https://github.com/alavrik/piqi-ocaml/issues" -build: [ - [make] - [make "test"] {with-test} -] -install: [ - [make "DESTDIR=%{prefix}%" "install"] -] -remove: [ - ["rm" "-f" "%{prefix}%/bin/piqic-ocaml"] - ["ocamlfind" "remove" "piqirun"] -] -flags: light-uninstall depends: [ "ocaml" {>= "4.02.0"} "ocamlfind" {build} @@ -24,3 +12,18 @@ depends: [ "num" {with-test} ] dev-repo: "git://github.com/alavrik/piqi-ocaml" + +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + "piqi,piqirun" + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] diff --git a/piqic-ocaml/dune b/piqic-ocaml/dune new file mode 100644 index 0000000..ce6af9b --- /dev/null +++ b/piqic-ocaml/dune @@ -0,0 +1,13 @@ +(executable + (name piqic_ocaml) + (public_name piqic-ocaml) + (package piqi) + (libraries piqilib piqirun bytes stdlib-shims)) + +(rule + (target piqic_ocaml_version.ml) + (deps + (file make_version.sh) + (file ../VERSION)) + (action (with-stdout-to %{target} + (bash ./make_version.sh)))) diff --git a/piqic-ocaml/make_version.sh b/piqic-ocaml/make_version.sh new file mode 100755 index 0000000..dfea812 --- /dev/null +++ b/piqic-ocaml/make_version.sh @@ -0,0 +1 @@ +echo "let version = \"$(head -1 ../VERSION)\"" diff --git a/piqirun/dune b/piqirun/dune new file mode 100644 index 0000000..feedf88 --- /dev/null +++ b/piqirun/dune @@ -0,0 +1,13 @@ +(library + (name piqirun) + (public_name piqirun.pb) + (wrapped false) + (libraries piqilib stdlib-shims) + (modules piqirun)) + +(library + (name piqirun_ext) + (public_name piqirun.ext) + (wrapped false) + (libraries piqilib stdlib-shims) + (modules piqirun_ext))