Skip to content

Commit 4c397ad

Browse files
committed
Install missing internal module and updated Oasis
1 parent 572b3c2 commit 4c397ad

File tree

8 files changed

+194
-141
lines changed

8 files changed

+194
-141
lines changed

CHANGES.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2014-10-29: Fixed an installation problem due to a missing internal module.
2+
13
2014-10-23: Fixed string handling for new OCaml version 4.02 (String/Bytes
24
modules). Requires new findlib version (>= 1.5).
35

_oasis

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
OASISFormat: 0.4
22
Name: postgresql-ocaml
3-
Version: 2.1.1
3+
Version: 2.1.2
44
Synopsis: postgresql-ocaml - bindings to the PostgreSQL library
55
Description: postgresql-ocaml offers library functions for accessing PostgreSQL databases
66
Authors: Alain Frisch <alain.frisch@lexifi.com>,
@@ -29,15 +29,16 @@ Flag strict
2929
Default: true
3030

3131
Library postgresql
32-
Path: lib
33-
FindlibName: postgresql
34-
Modules: Postgresql
35-
CSources: postgresql_stubs.c
36-
CCOpt: -g -O2 -fPIC -DPIC
32+
Path: lib
33+
FindlibName: postgresql
34+
Modules: Postgresql
35+
InternalModules: Postgresql_compat
36+
CSources: postgresql_stubs.c
37+
CCOpt: -g -O2 -fPIC -DPIC
3738
if flag(strict) && ccomp_type(cc)
38-
CCOpt+: -Wall -pedantic -Wextra -Wunused -Wno-long-long
39-
CCLib: -lpq
40-
BuildDepends: threads, bigarray, bytes
39+
CCOpt+: -Wall -pedantic -Wextra -Wunused -Wno-long-long
40+
CCLib: -lpq
41+
BuildDepends: threads, bigarray, bytes
4142

4243

4344
# Examples

_tags

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: 843c6fb516c1ba86d98cfc39f6e78629)
2+
# DO NOT EDIT (digest: c022991367bd814a8b8960fbd47f4298)
33
# Ignore VCS directories, you can use the same kind of rule outside
44
# OASIS_START/STOP if you want to exclude directories that contains
55
# useless stuff for the build process
6+
true: annot, bin_annot
67
<**/.svn>: -traverse
78
<**/.svn>: not_hygienic
89
".bzr": -traverse
@@ -15,17 +16,17 @@
1516
"_darcs": not_hygienic
1617
# Library postgresql
1718
"lib/postgresql.cmxs": use_postgresql
18-
<lib/*.ml{,i}>: oasis_library_postgresql_ccopt
19+
<lib/*.ml{,i,y}>: oasis_library_postgresql_ccopt
1920
"lib/postgresql_stubs.c": oasis_library_postgresql_ccopt
2021
<lib/postgresql.{cma,cmxa}>: oasis_library_postgresql_cclib
2122
"lib/libpostgresql_stubs.lib": oasis_library_postgresql_cclib
2223
"lib/dllpostgresql_stubs.dll": oasis_library_postgresql_cclib
2324
"lib/libpostgresql_stubs.a": oasis_library_postgresql_cclib
2425
"lib/dllpostgresql_stubs.so": oasis_library_postgresql_cclib
2526
<lib/postgresql.{cma,cmxa}>: use_libpostgresql_stubs
26-
<lib/*.ml{,i}>: pkg_bigarray
27-
<lib/*.ml{,i}>: pkg_bytes
28-
<lib/*.ml{,i}>: pkg_threads
27+
<lib/*.ml{,i,y}>: pkg_bigarray
28+
<lib/*.ml{,i,y}>: pkg_bytes
29+
<lib/*.ml{,i,y}>: pkg_threads
2930
"lib/postgresql_stubs.c": pkg_bigarray
3031
"lib/postgresql_stubs.c": pkg_bytes
3132
"lib/postgresql_stubs.c": pkg_threads
@@ -60,20 +61,20 @@
6061
<examples/prompt_gtk.{native,byte}>: pkg_lablgtk2
6162
<examples/prompt_gtk.{native,byte}>: pkg_threads
6263
<examples/prompt_gtk.{native,byte}>: use_postgresql
63-
<examples/*.ml{,i}>: pkg_lablgtk2
64+
<examples/*.ml{,i,y}>: pkg_lablgtk2
6465
# Executable test_lo
6566
<examples/test_lo.{native,byte}>: pkg_bigarray
6667
<examples/test_lo.{native,byte}>: pkg_bytes
6768
<examples/test_lo.{native,byte}>: pkg_threads
6869
<examples/test_lo.{native,byte}>: use_postgresql
69-
<examples/*.ml{,i}>: pkg_bigarray
70-
<examples/*.ml{,i}>: pkg_bytes
71-
<examples/*.ml{,i}>: pkg_threads
72-
<examples/*.ml{,i}>: use_postgresql
70+
<examples/*.ml{,i,y}>: pkg_bigarray
71+
<examples/*.ml{,i,y}>: pkg_bytes
72+
<examples/*.ml{,i,y}>: pkg_threads
73+
<examples/*.ml{,i,y}>: use_postgresql
7374
# OASIS_STOP
7475

7576
true: -traverse
7677
<{lib,examples}/**>: traverse
7778

78-
<**/*.ml{,i}>: warn(Aer-44), strict_sequence, safe_string, annot
79+
<**/*.ml{,i}>: warn(Aer-44-48), strict_sequence, safe_string, annot
7980
"lib/postgresql.cmxs": use_libpostgresql_stubs

lib/META

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: 96ce45a2fe6b0b524fc6731126b5f129)
3-
version = "2.1.1"
2+
# DO NOT EDIT (digest: d47606a310e6ba80ffb3692bf4b06615)
3+
version = "2.1.2"
44
description = "postgresql-ocaml - bindings to the PostgreSQL library"
55
requires = "threads bigarray bytes"
66
archive(byte) = "postgresql.cma"

lib/postgresql.mldylib

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: c26c231d9e6acbc7ff10118d262f3f5e)
2+
# DO NOT EDIT (digest: ffd739b43ceebd663a7de299fd616de4)
33
Postgresql
4+
Postgresql_compat
45
# OASIS_STOP

lib/postgresql.mllib

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: c26c231d9e6acbc7ff10118d262f3f5e)
2+
# DO NOT EDIT (digest: ffd739b43ceebd663a7de299fd616de4)
33
Postgresql
4+
Postgresql_compat
45
# OASIS_STOP

myocamlbuild.ml

+52-40
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(* OASIS_START *)
2-
(* DO NOT EDIT (digest: 3e1cc8469630fbc253bc2218e937c7f6) *)
2+
(* DO NOT EDIT (digest: 2f6db32590a6b778a4f6a9b9c2878dd1) *)
33
module OASISGettext = struct
44
(* # 22 "src/oasis/OASISGettext.ml" *)
55

@@ -249,6 +249,9 @@ module MyOCamlbuildFindlib = struct
249249
*)
250250
open Ocamlbuild_plugin
251251

252+
type conf =
253+
{ no_automatic_syntax: bool;
254+
}
252255

253256
(* these functions are not really officially exported *)
254257
let run_and_read =
@@ -315,7 +318,7 @@ module MyOCamlbuildFindlib = struct
315318

316319
(* This lists all supported packages. *)
317320
let find_packages () =
318-
List.map before_space (split_nl & run_and_read "ocamlfind list")
321+
List.map before_space (split_nl & run_and_read (exec_from_conf "ocamlfind" ^ " list"))
319322

320323

321324
(* Mock to list available syntaxes. *)
@@ -338,7 +341,7 @@ module MyOCamlbuildFindlib = struct
338341
]
339342

340343

341-
let dispatch =
344+
let dispatch conf =
342345
function
343346
| After_options ->
344347
(* By using Before_options one let command line options have an higher
@@ -357,31 +360,39 @@ module MyOCamlbuildFindlib = struct
357360
* -linkpkg *)
358361
flag ["ocaml"; "link"; "program"] & A"-linkpkg";
359362

360-
(* For each ocamlfind package one inject the -package option when
361-
* compiling, computing dependencies, generating documentation and
362-
* linking. *)
363-
List.iter
364-
begin fun pkg ->
365-
let base_args = [A"-package"; A pkg] in
366-
(* TODO: consider how to really choose camlp4o or camlp4r. *)
367-
let syn_args = [A"-syntax"; A "camlp4o"] in
368-
let args =
369-
(* Heuristic to identify syntax extensions: whether they end in
370-
".syntax"; some might not.
371-
*)
372-
if Filename.check_suffix pkg "syntax" ||
373-
List.mem pkg well_known_syntax then
374-
syn_args @ base_args
375-
else
376-
base_args
377-
in
378-
flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
379-
flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
380-
flag ["ocaml"; "doc"; "pkg_"^pkg] & S args;
381-
flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args;
382-
flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
383-
end
384-
(find_packages ());
363+
if not (conf.no_automatic_syntax) then begin
364+
(* For each ocamlfind package one inject the -package option when
365+
* compiling, computing dependencies, generating documentation and
366+
* linking. *)
367+
List.iter
368+
begin fun pkg ->
369+
let base_args = [A"-package"; A pkg] in
370+
(* TODO: consider how to really choose camlp4o or camlp4r. *)
371+
let syn_args = [A"-syntax"; A "camlp4o"] in
372+
let (args, pargs) =
373+
(* Heuristic to identify syntax extensions: whether they end in
374+
".syntax"; some might not.
375+
*)
376+
if Filename.check_suffix pkg "syntax" ||
377+
List.mem pkg well_known_syntax then
378+
(syn_args @ base_args, syn_args)
379+
else
380+
(base_args, [])
381+
in
382+
flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
383+
flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
384+
flag ["ocaml"; "doc"; "pkg_"^pkg] & S args;
385+
flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args;
386+
flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
387+
388+
(* TODO: Check if this is allowed for OCaml < 3.12.1 *)
389+
flag ["ocaml"; "compile"; "package("^pkg^")"] & S pargs;
390+
flag ["ocaml"; "ocamldep"; "package("^pkg^")"] & S pargs;
391+
flag ["ocaml"; "doc"; "package("^pkg^")"] & S pargs;
392+
flag ["ocaml"; "infer_interface"; "package("^pkg^")"] & S pargs;
393+
end
394+
(find_packages ());
395+
end;
385396

386397
(* Like -package but for extensions syntax. Morover -syntax is useless
387398
* when linking. *)
@@ -546,12 +557,13 @@ module MyOCamlbuildBase = struct
546557

547558
(* When ocaml link something that use the C library, then one
548559
need that file to be up to date.
560+
This holds both for programs and for libraries.
549561
*)
550-
dep ["link"; "ocaml"; "program"; tag_libstubs lib]
551-
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
562+
dep ["link"; "ocaml"; tag_libstubs lib]
563+
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
552564

553-
dep ["compile"; "ocaml"; "program"; tag_libstubs lib]
554-
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
565+
dep ["compile"; "ocaml"; tag_libstubs lib]
566+
[dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
555567

556568
(* TODO: be more specific about what depends on headers *)
557569
(* Depends on .h files *)
@@ -580,18 +592,18 @@ module MyOCamlbuildBase = struct
580592
()
581593

582594

583-
let dispatch_default t =
595+
let dispatch_default conf t =
584596
dispatch_combine
585597
[
586598
dispatch t;
587-
MyOCamlbuildFindlib.dispatch;
599+
MyOCamlbuildFindlib.dispatch conf;
588600
]
589601

590602

591603
end
592604

593605

594-
# 594 "myocamlbuild.ml"
606+
# 606 "myocamlbuild.ml"
595607
open Ocamlbuild_plugin;;
596608
let package_default =
597609
{
@@ -647,9 +659,11 @@ let package_default =
647659
}
648660
;;
649661

650-
let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
662+
let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}
663+
664+
let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;
651665

652-
# 653 "myocamlbuild.ml"
666+
# 667 "myocamlbuild.ml"
653667
(* OASIS_STOP *)
654668

655669
let () =
@@ -710,6 +724,4 @@ let () =
710724
flag ["oasis_library_postgresql_cclib"; "link"] opgsql_clibs
711725
| _ -> ()
712726
in
713-
dispatch (
714-
MyOCamlbuildBase.dispatch_combine
715-
[MyOCamlbuildBase.dispatch_default package_default; additional_rules])
727+
dispatch (MyOCamlbuildBase.dispatch_combine [dispatch_default; additional_rules])

0 commit comments

Comments
 (0)