Skip to content

Commit

Permalink
adds the dune build system (#68)
Browse files Browse the repository at this point in the history
Add support for dune and use it from opam (Fixes #66)

The existing build system based on OCamlMake files left untouched. We
build only essentials with dune, so right now tests, booting, and code
generation is not implemented.

Co-authored-by: Anton Lavrik <[email protected]>
  • Loading branch information
ivg and alavrik authored Aug 2, 2022
1 parent bcea4d4 commit eee553b
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@

# generated by ./configure
/Makefile.config
/_build/
5 changes: 5 additions & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -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))))
4 changes: 4 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(lang dune 2.0)
(name piqilib)

(package (name piqilib))
31 changes: 15 additions & 16 deletions opam
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,6 @@ authors: "Anton Lavrik <[email protected]>"
maintainer: "Anton Lavrik <[email protected]>"
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}
Expand All @@ -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}
]
]
82 changes: 82 additions & 0 deletions piqilib/dune
Original file line number Diff line number Diff line change
@@ -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))))
1 change: 1 addition & 0 deletions piqilib/make_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo "let version = \"$(head -1 ../VERSION)\""
4 changes: 4 additions & 0 deletions src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executable
(name run)
(public_name piqi)
(libraries unix piqilib))

0 comments on commit eee553b

Please sign in to comment.