diff --git a/.gitignore b/.gitignore index 109edff2..a81c60c8 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ # generated by ./configure /Makefile.config +/_build/ diff --git a/dune b/dune new file mode 100644 index 00000000..3fe73c17 --- /dev/null +++ b/dune @@ -0,0 +1,5 @@ +(env (dev (flags (:standard + -warn-error -A))) + (release (flags (:standard + -warn-error -A + -w -6-9-27-32..34-37-50-58)))) diff --git a/dune-project b/dune-project new file mode 100644 index 00000000..4b5b640f --- /dev/null +++ b/dune-project @@ -0,0 +1,4 @@ +(lang dune 2.0) +(name piqilib) + +(package (name piqilib)) diff --git a/opam b/opam index afc107e1..8d062be5 100644 --- a/opam +++ b/opam @@ -5,21 +5,6 @@ authors: "Anton Lavrik " maintainer: "Anton Lavrik " homepage: "http://piqi.org" bug-reports: "https://github.com/alavrik/piqi/issues" -build: [ - ["./configure" "--prefix" prefix] - [make] - [make "ocaml"] - [make "test"] {with-test} -] -install: [ - [make "install"] - [make "ocaml-install"] -] -remove: [ - ["rm" "-f" "%{prefix}%/bin/piqi"] - ["ocamlfind" "remove" "piqilib"] -] -flags: light-uninstall depends: [ "ocaml" {>= "4.03"} "ocamlfind" {build} @@ -28,4 +13,18 @@ depends: [ "xmlm" "base64" {>="3.1.0"} ] -dev-repo: "git://github.com/alavrik/piqi" +dev-repo: "git+https://github.com/alavrik/piqi" +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + "piqilib" + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] diff --git a/piqilib/dune b/piqilib/dune new file mode 100644 index 00000000..e2e7146d --- /dev/null +++ b/piqilib/dune @@ -0,0 +1,82 @@ +(library + (name piqilib) + (public_name piqilib) + (wrapped false) + (libraries easy-format xmlm base64 sedlex) + (preprocess (pps sedlex.ppx)) + (modules_without_implementation piqi_json_type piqi_xml_type) + (foreign_stubs (language c) (names piqi_c_impl)) + (modules + piqi_version + + piqi_piqirun + piqi_piqi + + piqi_util + piqloc + + piq_piqi + piq_ast + + piqi_impl_piqi + piqi_boot + + piqi_c + + piqi_config + piqi_iolist + piqi_name + piqi_common + piqi_file + piqi_command + piqi_protobuf + piqi_db + + piqi_utf8 + piq_lexer + piq_parser + piq_gen + + piqi_json_type + piqi_xml_type + + piqi_objstore + piqobj + piqobj_common + piqobj_to_protobuf + piqobj_of_protobuf + piqobj_to_piq + piqobj_of_piq + + piq + piqi + + piqi_pp + + piqi_json_parser + piqi_json_gen + piqi_json + + piqi_base64 + piqobj_to_json + piqobj_of_json + + piqi_xml + piqobj_to_xml + piqobj_of_xml + + piqi_convert + piqi_compile + + piqi_light + piqi_getopt)) + +(ocamllex piqi_json_parser) + +(rule + (target piqi_version.ml) + (deps + (file make_version.sh) + (file ../VERSION)) + (action (with-stdout-to %{target} + (bash ./make_version.sh)))) diff --git a/piqilib/make_version.sh b/piqilib/make_version.sh new file mode 100755 index 00000000..dfea8126 --- /dev/null +++ b/piqilib/make_version.sh @@ -0,0 +1 @@ +echo "let version = \"$(head -1 ../VERSION)\"" diff --git a/src/dune b/src/dune new file mode 100644 index 00000000..d6a1f2e3 --- /dev/null +++ b/src/dune @@ -0,0 +1,4 @@ +(executable + (name run) + (public_name piqi) + (libraries unix piqilib))