The following commit has been merged in the master branch: commit 997c03825f19116afc2b13537c75fe54aa52604f Author: Sylvain Le Gall <gil...@debian.org> Date: Fri Mar 8 00:11:25 2013 +0000
Use not-yet release oasis 0.3.1 API. diff --git a/src/BuildDepends.ml b/src/BuildDepends.ml index 0cae5b7..8bb34ed 100644 --- a/src/BuildDepends.ml +++ b/src/BuildDepends.ml @@ -175,7 +175,8 @@ let get ~ctxt pkg = (fun ((exec, fndlb) as acc) -> function | Library (_, bs, _) - | Executable (_, bs, _) -> + | Executable (_, bs, _) + | Object (_, bs, _) -> depends_of_bs bs acc | Test (_, test) -> diff --git a/src/DhFiles.ml b/src/DhFiles.ml index b6eb37b..183c96f 100644 --- a/src/DhFiles.ml +++ b/src/DhFiles.ml @@ -23,7 +23,7 @@ *) open OASISTypes -open OASISLibrary +open OASISFindlib open ExtString open Common @@ -42,15 +42,15 @@ let create ~ctxt t = debian_with_fn (deb_pkg.name^"."^ext) in - let findlib_roots = - OASISLibrary.group_libs t.pkg_generic + let findlib_roots, _, _ = + OASISFindlib.findlib_mapping t.pkg_generic in let roots = List.rev_map (fun grp -> let findlib_name = - OASISLibrary.findlib_of_group grp + OASISFindlib.findlib_of_group grp in let libs = @@ -58,8 +58,8 @@ let create ~ctxt t = function | Container (_, lst) -> List.fold_left fold acc lst - | Package (_, cs, bs, lib, lst) -> - List.fold_left fold ((cs, bs, lib) :: acc) lst + | Package (_, cs, bs, a, lst) -> + List.fold_left fold ((cs, bs, a) :: acc) lst in fold [] grp in @@ -71,18 +71,29 @@ let create ~ctxt t = List.flatten (List.flatten (List.fold_left - (fun acc e -> - let fns = - OASISLibrary.generated_unix_files - ~ctxt - ~source_file_exists:Sys.file_exists - ~is_native:true - ~has_native_dynlink:true - ~ext_lib:".a" - ~ext_dll:".so" - e - in - fns :: acc) + (fun acc -> + function + | cs, bs, `Library lib -> + let fns = + OASISLibrary.generated_unix_files + ~ctxt + ~source_file_exists:Sys.file_exists + ~is_native:true + ~has_native_dynlink:true + ~ext_lib:".a" + ~ext_dll:".so" + (cs, bs, lib) + in + fns :: acc + | cs, bs, `Object obj -> + let fns = + OASISObject.generated_unix_files + ~ctxt + ~source_file_exists:Sys.file_exists + ~is_native:true + (cs, bs, obj) + in + fns :: acc) [] libs)) in @@ -120,7 +131,7 @@ let create ~ctxt t = (ExternalTool "ocamldoc") doc.doc_build_tools - | Flag _ | Library _ | Executable _ | SrcRepo _ | Test _ -> + | Flag _ | Object _ | Library _ | Executable _ | SrcRepo _ | Test _ -> false) t.pkg_generic.sections in @@ -214,8 +225,8 @@ Section: Programming/OCaml"); (mk_doc_base docdir cs doc); n + 1 - | Library _ | Executable _ | Flag _ - | Test _ | SrcRepo _ -> + | Object _ | Library _ | Executable _ + | Flag _ | Test _ | SrcRepo _ -> n) 1 t.pkg_generic.sections diff --git a/src/Expr.ml b/src/Expr.ml index 5fa36d8..5645273 100644 --- a/src/Expr.ml +++ b/src/Expr.ml @@ -61,7 +61,7 @@ let create ~ctxt pkg = (string_of_bool (choose_simple ~ctxt conf flag.flag_default)) conf - | Library _ | Executable _ | Doc _ | Test _ | SrcRepo _ -> + | Object _ | Library _ | Executable _ | Doc _ | Test _ | SrcRepo _ -> conf) conf pkg.sections diff --git a/src/GenPkg.ml b/src/GenPkg.ml index 460b01a..5ea6871 100644 --- a/src/GenPkg.ml +++ b/src/GenPkg.ml @@ -43,22 +43,25 @@ let executable_name = let set ~ctxt t = - let lib, doc, bin = + let obj, lib, doc, bin = List.fold_left - (fun ((lib, doc, bin) as acc) -> + (fun ((obj, lib, doc, bin) as acc) -> function + | Object (cs, bs, obj') -> + ((cs, bs, obj') :: obj), lib, doc, bin + | Library (cs, bs, lib') -> - ((cs, bs, lib') :: lib), doc, bin + obj, ((cs, bs, lib') :: lib), doc, bin | Executable (cs, bs, exec) -> - lib, doc, ((cs, bs, exec) :: bin) + obj, lib, doc, ((cs, bs, exec) :: bin) | Doc (cs, doc') -> - lib, ((cs, doc') :: doc), bin + obj, lib, ((cs, doc') :: doc), bin | Flag _ | Test _ | SrcRepo _ -> acc) - ([], [], []) + ([], [], [], []) t.pkg_generic.sections in @@ -92,11 +95,12 @@ let set ~ctxt t = end else begin - match OASISLibrary.group_libs t.pkg_generic with + let groups, _, _ = OASISFindlib.findlib_mapping t.pkg_generic in + match groups with | [hd] -> (* First method: if there is a single findlib library use its name *) - OASISLibrary.findlib_of_group hd + OASISFindlib.findlib_of_group hd | _ -> (* Default method: try to guess the target name using source name @@ -128,8 +132,8 @@ let set ~ctxt t = let t = (* Determine if we have bin+dev+runtime *) - match lib, bin with - | [], bin -> + match lib, obj, bin with + | [], [], bin -> begin (* Only a binary package, name = source name *) let exec_name = @@ -143,7 +147,7 @@ let set ~ctxt t = {t with deb_exec = Some (mk_deb exec_name bin)} end - | lib, bin -> + | lib, obj, bin -> begin (* Library only *) let t = diff --git a/src/PkgGeneric.ml b/src/PkgGeneric.ml index e3fae8e..889f106 100644 --- a/src/PkgGeneric.ml +++ b/src/PkgGeneric.ml @@ -39,6 +39,7 @@ let create ~ctxt expr pkg = List.fold_left (fun acc e -> match e with + | Object (_, bs, _) | Library (_, bs, _) | Executable (_, bs, _) -> if eval bs.bs_build && eval bs.bs_install then -- oasis2debian project _______________________________________________ Pkg-ocaml-maint-commits mailing list Pkg-ocaml-maint-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits