Skip to content

Commit 4884c40

Browse files
committed
Switched to dune, dune-release, and OPAM 2.0
1 parent fd4fb5c commit 4884c40

17 files changed

+60
-73
lines changed

CHANGES.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 4.4.1 (2018-10-25)
2+
3+
* Switched to dune, dune-release, and OPAM 2.0
4+
5+
16
### 4.4.0 (2018-04-26)
27

38
* Support for new open flags:

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.PHONY: all clean doc
22

33
all:
4-
jbuilder build @install --dev
4+
dune build @install
55

66
clean:
7-
jbuilder clean
7+
dune clean
88

99
doc:
10-
jbuilder build --dev @doc
10+
dune build @doc

dune

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(env
2+
(dev (flags (:standard -w -9 -principal)))
3+
(release (ocamlopt_flags (:standard -O3)))
4+
)

dune-project

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(lang dune 1.1)
2+
(name sqlite3)

jbuild-workspace

-1
This file was deleted.

sqlite3.descr

-5
This file was deleted.

sqlite3.opam

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
opam-version: "1.2"
1+
opam-version: "2.0"
22
maintainer: "Markus Mottl <[email protected]>"
33
authors: [
44
"Markus Mottl <[email protected]>"
@@ -7,21 +7,26 @@ authors: [
77
license: "Expat"
88
homepage: "http://mmottl.github.io/sqlite3-ocaml"
99
doc: "https://mmottl.github.io/sqlite3-ocaml/api"
10-
dev-repo: "https://github.com/mmottl/sqlite3-ocaml.git"
10+
dev-repo: "git+https://github.com/mmottl/sqlite3-ocaml.git"
1111
bug-reports: "https://github.com/mmottl/sqlite3-ocaml/issues"
1212
tags: [ "clib:sqlite3" "clib:pthread" ]
1313

1414
build: [
15-
["jbuilder" "subst" "-p" name] {pinned}
16-
["jbuilder" "build" "-p" name "-j" jobs]
15+
["dune" "subst"] {pinned}
16+
["dune" "build" "-p" name "-j" jobs]
1717
]
1818

1919
depends: [
20+
"ocaml" {>= "4.05"}
21+
"dune" {build & >= "1.4.0"}
2022
"base" {build}
21-
"conf-sqlite3" {build}
2223
"stdio" {build}
23-
"configurator" {build}
24-
"jbuilder" {build & >= "1.0+beta10"}
24+
"conf-sqlite3" {build}
2525
]
2626

27-
available: [ ocaml-version >= "4.05" ]
27+
synopsis: "SQLite3 bindings for OCaml"
28+
29+
description: """
30+
sqlite3-ocaml is an OCaml library with bindings to the SQLite3 client API.
31+
Sqlite3 is a self-contained, serverless, zero-configuration, transactional SQL
32+
database engine with outstanding performance for many use cases."""

src/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ TARGETS = sqlite3.cma libsqlite3_stubs.a
33
.PHONY: all clean
44

55
all:
6-
@jbuilder build --dev $(TARGETS)
6+
@dune build $(TARGETS)
77

88
clean:
9-
@jbuilder clean
9+
@dune clean

src/config/Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
TARGETS = discover.bc
2-
JBUILDER_ROOT = ../..
32

43
.PHONY: all clean
54

65
all:
7-
@jbuilder build --dev $(TARGETS)
6+
@dune build $(TARGETS)
87

98
clean:
10-
@jbuilder clean
9+
@dune clean

src/config/discover.ml

+3-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let pkg_export =
3838
let split_ws str = List.filter (String.split ~on:' ' str) ~f:(String.(<>) "")
3939

4040
let () =
41-
let module C = Configurator in
41+
let module C = Configurator.V1 in
4242
C.main ~name:"sqlite3" (fun c ->
4343
let is_macosx =
4444
Option.value_map (C.ocaml_config_var c "system") ~default:false
@@ -64,8 +64,5 @@ let () =
6464
| _ -> failwith "pkg-config failed to return libs"
6565
in
6666
let conf = { C.Pkg_config.cflags; libs } in
67-
let write_sexp file sexp =
68-
Out_channel.write_all file ~data:(Sexp.to_string sexp)
69-
in
70-
write_sexp "c_flags.sexp" (sexp_of_list sexp_of_string conf.cflags);
71-
write_sexp "c_library_flags.sexp" (sexp_of_list sexp_of_string conf.libs))
67+
C.Flags.write_sexp "c_flags.sexp" conf.cflags;
68+
C.Flags.write_sexp "c_library_flags.sexp" conf.libs)

src/config/dune

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(executables
2+
(names discover)
3+
(libraries base stdio dune.configurator)
4+
)

src/config/jbuild

-10
This file was deleted.

src/dune

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(library
2+
(public_name sqlite3)
3+
(c_names sqlite3_stubs)
4+
(c_flags (
5+
(:include c_flags.sexp) -g -O2 -fPIC -DPIC
6+
; NOTE: for debugging before releases
7+
; -Wall -pedantic -Wextra -Wunused -Wno-long-long -Wno-keyword-macro
8+
))
9+
(c_library_flags (:include c_library_flags.sexp) -lpthread)
10+
)
11+
12+
(rule
13+
(targets c_flags.sexp c_library_flags.sexp)
14+
(deps (:discover config/discover.exe))
15+
(action (run %{discover}))
16+
)

src/jbuild

-23
This file was deleted.

test/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ TARGETS = \
44
.PHONY: all clean
55

66
all:
7-
@jbuilder build --dev $(TARGETS)
7+
@dune build $(TARGETS)
88

99
clean:
10-
@jbuilder clean
10+
@dune clean

test/dune

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(executables
2+
(names test_agg test_db test_error test_exec test_fun test_stmt)
3+
(libraries str sqlite3)
4+
)

test/jbuild

-10
This file was deleted.

0 commit comments

Comments
 (0)