diff --git a/CHANGES.md b/CHANGES.md index dbb53ae..6dccc3b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +### 4.4.1 (2018-10-25) + + * Switched to dune, dune-release, and OPAM 2.0 + + ### 4.4.0 (2018-04-26) * Support for new open flags: diff --git a/Makefile b/Makefile index a3d7ae9..8a5fb07 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ .PHONY: all clean doc all: - jbuilder build @install --dev + dune build @install clean: - jbuilder clean + dune clean doc: - jbuilder build --dev @doc + dune build @doc diff --git a/dune b/dune new file mode 100644 index 0000000..66984ad --- /dev/null +++ b/dune @@ -0,0 +1,4 @@ +(env + (dev (flags (:standard -w -9 -principal))) + (release (ocamlopt_flags (:standard -O3))) +) diff --git a/dune-project b/dune-project new file mode 100644 index 0000000..d0734ad --- /dev/null +++ b/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.1) +(name sqlite3) diff --git a/jbuild-workspace b/jbuild-workspace deleted file mode 100644 index 9b5f577..0000000 --- a/jbuild-workspace +++ /dev/null @@ -1 +0,0 @@ -(context default) diff --git a/sqlite3.descr b/sqlite3.descr deleted file mode 100644 index b85f4ce..0000000 --- a/sqlite3.descr +++ /dev/null @@ -1,5 +0,0 @@ -sqlite3-ocaml - SQLite3 bindings for OCaml - -sqlite3-ocaml is an OCaml library with bindings to the SQLite3 client API. -Sqlite3 is a self-contained, serverless, zero-configuration, transactional SQL -database engine with outstanding performance for many use cases. diff --git a/sqlite3.opam b/sqlite3.opam index 3ed957b..b37f4d5 100644 --- a/sqlite3.opam +++ b/sqlite3.opam @@ -1,4 +1,4 @@ -opam-version: "1.2" +opam-version: "2.0" maintainer: "Markus Mottl " authors: [ "Markus Mottl " @@ -7,21 +7,26 @@ authors: [ license: "Expat" homepage: "http://mmottl.github.io/sqlite3-ocaml" doc: "https://mmottl.github.io/sqlite3-ocaml/api" -dev-repo: "https://github.com/mmottl/sqlite3-ocaml.git" +dev-repo: "git+https://github.com/mmottl/sqlite3-ocaml.git" bug-reports: "https://github.com/mmottl/sqlite3-ocaml/issues" tags: [ "clib:sqlite3" "clib:pthread" ] build: [ - ["jbuilder" "subst" "-p" name] {pinned} - ["jbuilder" "build" "-p" name "-j" jobs] + ["dune" "subst"] {pinned} + ["dune" "build" "-p" name "-j" jobs] ] depends: [ + "ocaml" {>= "4.05"} + "dune" {build & >= "1.4.0"} "base" {build} - "conf-sqlite3" {build} "stdio" {build} - "configurator" {build} - "jbuilder" {build & >= "1.0+beta10"} + "conf-sqlite3" {build} ] -available: [ ocaml-version >= "4.05" ] +synopsis: "SQLite3 bindings for OCaml" + +description: """ +sqlite3-ocaml is an OCaml library with bindings to the SQLite3 client API. +Sqlite3 is a self-contained, serverless, zero-configuration, transactional SQL +database engine with outstanding performance for many use cases.""" diff --git a/src/Makefile b/src/Makefile index c0e3924..e45058b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,7 +3,7 @@ TARGETS = sqlite3.cma libsqlite3_stubs.a .PHONY: all clean all: - @jbuilder build --dev $(TARGETS) + @dune build $(TARGETS) clean: - @jbuilder clean + @dune clean diff --git a/src/config/Makefile b/src/config/Makefile index fdca388..a3e607d 100644 --- a/src/config/Makefile +++ b/src/config/Makefile @@ -1,10 +1,9 @@ TARGETS = discover.bc -JBUILDER_ROOT = ../.. .PHONY: all clean all: - @jbuilder build --dev $(TARGETS) + @dune build $(TARGETS) clean: - @jbuilder clean + @dune clean diff --git a/src/config/discover.ml b/src/config/discover.ml index da9bbb0..55793b3 100644 --- a/src/config/discover.ml +++ b/src/config/discover.ml @@ -38,7 +38,7 @@ let pkg_export = let split_ws str = List.filter (String.split ~on:' ' str) ~f:(String.(<>) "") let () = - let module C = Configurator in + let module C = Configurator.V1 in C.main ~name:"sqlite3" (fun c -> let is_macosx = Option.value_map (C.ocaml_config_var c "system") ~default:false @@ -64,8 +64,5 @@ let () = | _ -> failwith "pkg-config failed to return libs" in let conf = { C.Pkg_config.cflags; libs } in - let write_sexp file sexp = - Out_channel.write_all file ~data:(Sexp.to_string sexp) - in - write_sexp "c_flags.sexp" (sexp_of_list sexp_of_string conf.cflags); - write_sexp "c_library_flags.sexp" (sexp_of_list sexp_of_string conf.libs)) + C.Flags.write_sexp "c_flags.sexp" conf.cflags; + C.Flags.write_sexp "c_library_flags.sexp" conf.libs) diff --git a/src/config/dune b/src/config/dune new file mode 100644 index 0000000..c64a73d --- /dev/null +++ b/src/config/dune @@ -0,0 +1,4 @@ +(executables + (names discover) + (libraries base stdio dune.configurator) +) diff --git a/src/config/jbuild b/src/config/jbuild deleted file mode 100644 index 40d3d20..0000000 --- a/src/config/jbuild +++ /dev/null @@ -1,10 +0,0 @@ -(jbuild_version 1) - -(executables ( - (names (discover)) - (flags ( - :standard - -w -9 -strict-sequence -principal -short-paths - )) - (libraries (base stdio configurator)) -)) diff --git a/src/dune b/src/dune new file mode 100644 index 0000000..01bf123 --- /dev/null +++ b/src/dune @@ -0,0 +1,16 @@ +(library + (public_name sqlite3) + (c_names sqlite3_stubs) + (c_flags ( + (:include c_flags.sexp) -g -O2 -fPIC -DPIC + ; NOTE: for debugging before releases + ; -Wall -pedantic -Wextra -Wunused -Wno-long-long -Wno-keyword-macro + )) + (c_library_flags (:include c_library_flags.sexp) -lpthread) +) + +(rule + (targets c_flags.sexp c_library_flags.sexp) + (deps (:discover config/discover.exe)) + (action (run %{discover})) +) diff --git a/src/jbuild b/src/jbuild deleted file mode 100644 index 68e70a7..0000000 --- a/src/jbuild +++ /dev/null @@ -1,23 +0,0 @@ -(jbuild_version 1) - -(library ( - (name sqlite3) - (public_name sqlite3) - (flags ( - :standard - -w -9 -strict-sequence -principal -short-paths - )) - (c_names (sqlite3_stubs)) - (c_flags ( - (:include c_flags.sexp) -g -O2 -fPIC -DPIC - ; NOTE: for debugging before releases - ; -Wall -pedantic -Wextra -Wunused -Wno-long-long -Wno-keyword-macro - )) - (c_library_flags ((:include c_library_flags.sexp) -lpthread)) -)) - -(rule ( - (targets (c_flags.sexp c_library_flags.sexp)) - (deps (config/discover.exe)) - (action (run ${<} -ocamlc ${OCAMLC})) -)) diff --git a/test/Makefile b/test/Makefile index 0cf8b81..35f2dd3 100644 --- a/test/Makefile +++ b/test/Makefile @@ -4,7 +4,7 @@ TARGETS = \ .PHONY: all clean all: - @jbuilder build --dev $(TARGETS) + @dune build $(TARGETS) clean: - @jbuilder clean + @dune clean diff --git a/test/dune b/test/dune new file mode 100644 index 0000000..2ab6943 --- /dev/null +++ b/test/dune @@ -0,0 +1,4 @@ +(executables + (names test_agg test_db test_error test_exec test_fun test_stmt) + (libraries str sqlite3) +) diff --git a/test/jbuild b/test/jbuild deleted file mode 100644 index 5178c98..0000000 --- a/test/jbuild +++ /dev/null @@ -1,10 +0,0 @@ -(jbuild_version 1) - -(executables ( - (names (test_agg test_db test_error test_exec test_fun test_stmt)) - (flags ( - :standard - -w -9 -strict-sequence -principal -short-paths - )) - (libraries (str sqlite3)) -))