[Pkg-ocaml-maint-commits] [SCM] Cooperative light-weight thread library for OCaml branch, master, updated. debian/2.3.2-1-9-ga88f603
Stephane Glondu
steph at glondu.net
Fri Dec 7 10:29:55 UTC 2012
The following commit has been merged in the master branch:
commit 7e397d403e89874ed5af9b35c88414e3a3dc3590
Author: Stephane Glondu <steph at glondu.net>
Date: Fri Dec 7 10:21:40 2012 +0100
Update debian/modules.ml
* more verbosity when DH_VERBOSE=1
* cmx files are now installed by upstream even for private modules
* cmxs files are no longer installed by upstream on !natdynlink
* new private module: Lwt_unix_jobs_generated
diff --git a/debian/modules.ml b/debian/modules.ml
index 1571cca..1ea9436 100644
--- a/debian/modules.ml
+++ b/debian/modules.ml
@@ -8,9 +8,21 @@
let dll_dir = Sys.getenv "OCAML_DLL_DIR"
let is_native = Sys.getenv "OCAML_HAVE_OCAMLOPT" = "yes"
+let has_natdynlink = Sys.getenv "OCAML_NATDYNLINK" = "yes"
+
+let dh_verbose =
+ if (try Sys.getenv "DH_VERBOSE" = "1" with Not_found -> false) then
+ (fun fmt -> Printf.printf fmt)
+ else
+ (fun fmt -> Printf.ifprintf stderr fmt)
let is_private = function
- | "Pa_lwt_options" | "Lwt_log_rules" | "Lwt_ocaml_completion" | "Lwt_simple_top" -> true
+ | "Pa_lwt_options"
+ | "Lwt_log_rules"
+ | "Lwt_ocaml_completion"
+ | "Lwt_simple_top"
+ | "Lwt_unix_jobs_generated"
+ -> true
| _ -> false
let suffix = function
@@ -42,17 +54,20 @@ let split_dll =
let print_cma () cma =
let component = suffix (Filename.chop_suffix (Filename.basename cma) ".cma") in
+ let () = dh_verbose "Generating module data for %s, going to lwt%s...\n%!" cma component in
let flags = [Open_creat; Open_append] in
let dev = open_out_gen flags 0o644 (Printf.sprintf "debian/liblwt%s-ocaml-dev.install" component) in
let runtime = open_out_gen flags 0o644 (Printf.sprintf "debian/liblwt%s-ocaml.install" component) in
let () = Printf.fprintf runtime "%s\n" (chop_prefix cma) in
let () =
let x = Filename.chop_suffix cma ".cma" in
- if is_native then begin
+ if is_native then (
Printf.fprintf dev "%s\n" (chop_prefix x ^ ".cmxa");
Printf.fprintf dev "%s\n" (chop_prefix x ^ ".a");
+ );
+ if has_natdynlink then (
Printf.fprintf runtime "%s\n" (chop_prefix x ^ ".cmxs");
- end
+ );
in
let dlls, modules =
let objinfo = Printf.ksprintf Unix.open_process_in "ocamlobjinfo %s | sed -nr 's/^(Unit name|Extra dynamically.*): //p'" cma in
@@ -69,23 +84,20 @@ let print_cma () cma =
| xs -> [], xs
in
let dirname = Filename.dirname cma in
- let print_module m =
- let m = Filename.concat dirname (String.uncapitalize m) in
- let () = if is_native then begin
- let x = Filename.basename (m^".cmx") in
- match FileUtil.find (FileUtil.Basename_is x) "_build" (fun o x -> assert (o = None); Some x) None with
- | Some x -> Printf.fprintf dev "%s %s\n" x (chop_prefix dirname)
- | None -> assert false
- end in
- Printf.fprintf dev "%s\n" (chop_prefix (m^".cmi"));
- Printf.fprintf dev "%s\n" (chop_prefix (m^".mli"))
+ let print_module mname =
+ let m = Filename.concat dirname (String.uncapitalize mname) in
+ if is_native then Printf.fprintf dev "%s\n" (chop_prefix (m^".cmx"));
+ if not (is_private mname) then (
+ Printf.fprintf dev "%s\n" (chop_prefix (m^".cmi"));
+ Printf.fprintf dev "%s\n" (chop_prefix (m^".mli"));
+ )
in
let print_dll m =
let b = chop_prefix dirname in
Printf.fprintf runtime "%s %s\n" (Filename.concat b ("dll"^m^".so")) dll_dir;
Printf.fprintf dev "%s\n" (Filename.concat b ("lib"^m^".a"))
in
- List.iter (fun x -> if not (is_private x) then print_module x) modules;
+ List.iter print_module modules;
List.iter print_dll dlls;
close_out dev;
close_out runtime
diff --git a/debian/rules b/debian/rules
index 4210d22..b56e747 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,6 +10,7 @@ include /usr/share/ocaml/ocamlvars.mk
export OCAML_DLL_DIR
export OCAML_HAVE_OCAMLOPT
+export OCAML_NATDYNLINK
export OCAMLFIND_DESTDIR=$(DESTDIR)/$(OCAML_STDLIB_DIR)
export OCAMLFIND_LDCONF=ignore
--
Cooperative light-weight thread library for OCaml
More information about the Pkg-ocaml-maint-commits
mailing list