Skip to content

Commit

Permalink
Switched to dune, dune-release, and OPAM 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mmottl committed Oct 25, 2018
1 parent fd4fb5c commit 4884c40
Show file tree
Hide file tree
Showing 17 changed files with 60 additions and 73 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(env
(dev (flags (:standard -w -9 -principal)))
(release (ocamlopt_flags (:standard -O3)))
)
2 changes: 2 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(lang dune 1.1)
(name sqlite3)
1 change: 0 additions & 1 deletion jbuild-workspace

This file was deleted.

5 changes: 0 additions & 5 deletions sqlite3.descr

This file was deleted.

21 changes: 13 additions & 8 deletions sqlite3.opam
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
opam-version: "1.2"
opam-version: "2.0"
maintainer: "Markus Mottl <[email protected]>"
authors: [
"Markus Mottl <[email protected]>"
Expand All @@ -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."""
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 2 additions & 3 deletions src/config/Makefile
Original file line number Diff line number Diff line change
@@ -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
9 changes: 3 additions & 6 deletions src/config/discover.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
4 changes: 4 additions & 0 deletions src/config/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executables
(names discover)
(libraries base stdio dune.configurator)
)
10 changes: 0 additions & 10 deletions src/config/jbuild

This file was deleted.

16 changes: 16 additions & 0 deletions src/dune
Original file line number Diff line number Diff line change
@@ -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}))
)
23 changes: 0 additions & 23 deletions src/jbuild

This file was deleted.

4 changes: 2 additions & 2 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TARGETS = \
.PHONY: all clean

all:
@jbuilder build --dev $(TARGETS)
@dune build $(TARGETS)

clean:
@jbuilder clean
@dune clean
4 changes: 4 additions & 0 deletions test/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executables
(names test_agg test_db test_error test_exec test_fun test_stmt)
(libraries str sqlite3)
)
10 changes: 0 additions & 10 deletions test/jbuild

This file was deleted.

0 comments on commit 4884c40

Please sign in to comment.