From cc6862c9e384c27e4f0de4c3b6f7c7780a89bedf Mon Sep 17 00:00:00 2001 From: Andy Li Date: Jun 25 2018 03:06:20 +0000 Subject: Update oasis-setup.patch with _oasis CompiledObject set to "best" (RHBZ#1593408). --- diff --git a/oasis-setup.patch b/oasis-setup.patch index 467e1b8..5319692 100644 --- a/oasis-setup.patch +++ b/oasis-setup.patch @@ -1,6 +1,7 @@ -diff -u ocamlify-0.0.2/AUTHORS.txt ocamlify-update-0.0.2/AUTHORS.txt ---- ocamlify-0.0.2/AUTHORS.txt 2013-06-26 06:08:31.000000000 +0800 -+++ ocamlify-update-0.0.2/AUTHORS.txt 2018-05-29 11:10:37.772848294 +0800 +diff --git a/AUTHORS.txt b/AUTHORS.txt +index 6abb041..acd16db 100644 +--- a/AUTHORS.txt ++++ b/AUTHORS.txt @@ -1,5 +1,8 @@ (* OASIS_START *) -(* DO NOT EDIT (digest: d1a132a4ab095df48f3d2d499d6c5000) *) @@ -13,26 +14,10 @@ diff -u ocamlify-0.0.2/AUTHORS.txt ocamlify-update-0.0.2/AUTHORS.txt +* Sylvain Le Gall + (* OASIS_STOP *) -diff -u ocamlify-0.0.2/configure ocamlify-update-0.0.2/configure ---- ocamlify-0.0.2/configure 2013-06-26 06:08:31.000000000 +0800 -+++ ocamlify-update-0.0.2/configure 2018-05-29 11:10:37.772848294 +0800 -@@ -1,11 +1,11 @@ - #!/bin/sh - - # OASIS_START --# DO NOT EDIT (digest: 425187ed8bfdbdd207fd76392dd243a7) -+# DO NOT EDIT (digest: dc86c2ad450f91ca10c931b6045d0499) - set -e - - FST=true --for i in "$@"; do -+for i in "$@"; do - if $FST; then - set -- - FST=false -diff -u ocamlify-0.0.2/INSTALL.txt ocamlify-update-0.0.2/INSTALL.txt ---- ocamlify-0.0.2/INSTALL.txt 2013-06-26 06:08:31.000000000 +0800 -+++ ocamlify-update-0.0.2/INSTALL.txt 2018-05-29 11:10:37.772848294 +0800 +diff --git a/INSTALL.txt b/INSTALL.txt +index 667d1b3..8da6e65 100644 +--- a/INSTALL.txt ++++ b/INSTALL.txt @@ -1,16 +1,17 @@ (* OASIS_START *) -(* DO NOT EDIT (digest: ff14f9ae83ff16013a48d7bd3b76fa73) *) @@ -55,7 +40,7 @@ diff -u ocamlify-0.0.2/INSTALL.txt ocamlify-update-0.0.2/INSTALL.txt Installing ========== -@@ -23,7 +24,7 @@ +@@ -23,7 +24,7 @@ Installing Uninstalling ============ @@ -64,9 +49,10 @@ diff -u ocamlify-0.0.2/INSTALL.txt ocamlify-update-0.0.2/INSTALL.txt 2. Run 'ocaml setup.ml -uninstall' OASIS -diff -u ocamlify-0.0.2/Makefile ocamlify-update-0.0.2/Makefile ---- ocamlify-0.0.2/Makefile 2013-06-26 06:08:31.000000000 +0800 -+++ ocamlify-update-0.0.2/Makefile 2018-05-29 11:10:37.772848294 +0800 +diff --git a/Makefile b/Makefile +index ccbf9cf..a9411ed 100644 +--- a/Makefile ++++ b/Makefile @@ -20,7 +20,7 @@ ################################################################################ @@ -76,7 +62,7 @@ diff -u ocamlify-0.0.2/Makefile ocamlify-update-0.0.2/Makefile SETUP = ocaml setup.ml -@@ -33,7 +33,7 @@ +@@ -33,7 +33,7 @@ doc: setup.data build test: setup.data build $(SETUP) -test $(TESTFLAGS) @@ -85,7 +71,7 @@ diff -u ocamlify-0.0.2/Makefile ocamlify-update-0.0.2/Makefile $(SETUP) -all $(ALLFLAGS) install: setup.data -@@ -45,15 +45,18 @@ +@@ -45,15 +45,18 @@ uninstall: setup.data reinstall: setup.data $(SETUP) -reinstall $(REINSTALLFLAGS) @@ -106,9 +92,84 @@ diff -u ocamlify-0.0.2/Makefile ocamlify-update-0.0.2/Makefile .PHONY: build doc test all install uninstall reinstall clean distclean configure # OASIS_STOP -diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml ---- ocamlify-0.0.2/myocamlbuild.ml 2013-06-26 06:08:31.000000000 +0800 -+++ ocamlify-update-0.0.2/myocamlbuild.ml 2018-05-29 11:10:37.772848294 +0800 +diff --git a/README.txt b/README.txt +index c8d0c50..82e15a2 100644 +--- a/README.txt ++++ b/README.txt +@@ -1,11 +1,18 @@ + (* OASIS_START *) +-(* DO NOT EDIT (digest: 6b14e9f8e3ce93d7b61df6632978b14b) *) +-This is the README file for the ocamlify distribution. ++(* DO NOT EDIT (digest: e5345f3fe2acd3045d4e251cfbf369a6) *) + +-include files in OCaml code ++ocamlify - include files in OCaml code ++====================================== + +-See the files INSTALL.txt for building and installation instructions. See the +-file COPYING.txt for copying conditions. ++See the file [INSTALL.txt](INSTALL.txt) for building and installation ++instructions. + ++Copyright and license ++--------------------- ++ ++ocamlify is distributed under the terms of the GNU Lesser General Public ++License version 2.1 with OCaml linking exception. ++ ++See [COPYING.txt](COPYING.txt) for more information. + + (* OASIS_STOP *) +diff --git a/_oasis b/_oasis +index 4915f09..658a9a3 100644 +--- a/_oasis ++++ b/_oasis +@@ -11,5 +11,5 @@ BuildTools: ocamlbuild + + Executable ocamlify + Path: src +- CompiledObject: byte ++ CompiledObject: best + MainIs: ocamlify.ml +diff --git a/_tags b/_tags +index 30cf144..7fe9fed 100644 +--- a/_tags ++++ b/_tags +@@ -1,8 +1,9 @@ + # OASIS_START +-# DO NOT EDIT (digest: d0ff94eb3e82a4875dd557595bea8eb3) +-# Ignore VCS directories, you can use the same kind of rule outside +-# OASIS_START/STOP if you want to exclude directories that contains ++# DO NOT EDIT (digest: b0a95a3908a35f1eadb2bb5d7f18ff09) ++# Ignore VCS directories, you can use the same kind of rule outside ++# OASIS_START/STOP if you want to exclude directories that contains + # useless stuff for the build process ++true: annot, bin_annot + <**/.svn>: -traverse + <**/.svn>: not_hygienic + ".bzr": -traverse +diff --git a/configure b/configure +index 97ed012..6acfaeb 100755 +--- a/configure ++++ b/configure +@@ -1,11 +1,11 @@ + #!/bin/sh + + # OASIS_START +-# DO NOT EDIT (digest: 425187ed8bfdbdd207fd76392dd243a7) ++# DO NOT EDIT (digest: dc86c2ad450f91ca10c931b6045d0499) + set -e + + FST=true +-for i in "$@"; do ++for i in "$@"; do + if $FST; then + set -- + FST=false +diff --git a/myocamlbuild.ml b/myocamlbuild.ml +index 805eb5d..5924578 100644 +--- a/myocamlbuild.ml ++++ b/myocamlbuild.ml @@ -1,16 +1,13 @@ (* OASIS_START *) -(* DO NOT EDIT (digest: c731f09030552f20f1d702a3c5473c9c) *) @@ -131,7 +192,7 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml let fn_ fmt1 fmt2 n = if n = 1 then -@@ -18,21 +15,341 @@ +@@ -18,21 +15,341 @@ module OASISGettext = struct else fmt2^^"" @@ -261,7 +322,7 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml + else + raise Not_found + -+ + + let replace_chars f s = + let buf = Buffer.create (String.length s) in + String.iter (fun c -> Buffer.add_char buf (f c)) s; @@ -299,11 +360,13 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml + +module OASISUtils = struct +(* # 22 "src/oasis/OASISUtils.ml" *) -+ -+ -+ open OASISGettext -+ -+ + + + open OASISGettext + +- type test = string + +- type flag = string + module MapExt = + struct + module type S = @@ -329,7 +392,7 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml + end + end + - ++ + module MapString = MapExt.Make(String) + + @@ -465,21 +528,19 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml + +module OASISExpr = struct +(* # 22 "src/oasis/OASISExpr.ml" *) - - - open OASISGettext ++ ++ ++ open OASISGettext + open OASISUtils + - -- type test = string ++ + type test = string + type flag = string - -- type flag = string ++ type t = | EBool of bool -@@ -41,9 +358,10 @@ +@@ -41,9 +358,10 @@ module OASISExpr = struct | EOr of t * t | EFlag of flag | ETest of test * string @@ -492,7 +553,7 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml let eval var_get t = let rec eval' = -@@ -75,6 +393,7 @@ +@@ -75,6 +393,7 @@ module OASISExpr = struct in eval' t @@ -500,7 +561,7 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml let choose ?printer ?name var_get lst = let rec choose_aux = function -@@ -111,282 +430,337 @@ +@@ -111,282 +430,337 @@ module OASISExpr = struct in choose_aux (List.rev lst) @@ -642,6 +703,11 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml - Buffer.contents buff - in - var_expand (MapString.find name env) +- +- let var_choose lst env = +- OASISExpr.choose +- (fun nm -> var_get nm env) +- lst + let rec var_expand str env = + let buff = Buffer.create ((String.length str) * 2) in + Buffer.add_substitute @@ -657,11 +723,7 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml + str)) + str; + Buffer.contents buff - -- let var_choose lst env = -- OASISExpr.choose -- (fun nm -> var_get nm env) -- lst ++ + + let var_get name env = var_expand (MapString.find name env) env + let var_choose lst env = OASISExpr.choose (fun nm -> var_get nm env) lst @@ -774,9 +836,9 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml let find_packages () = - List.map before_space (split_nl & run_and_read "ocamlfind list") + List.map before_space (split_nl & run_and_read (exec_from_conf "ocamlfind" ^ " list")) -+ - (* this is supposed to list available syntaxes, but I don't know how to do it. *) ++ + (* Mock to list available syntaxes. *) let find_syntaxes () = ["camlp4o"; "camlp4r"] @@ -918,6 +980,7 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml - - | _ -> - () +- + flag ["ocaml"; "infer_interface"; "syntax_"^syntax] & + S[A"-syntax"; A syntax]; + end (find_syntaxes ()); @@ -940,7 +1003,7 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml + flag ["ocaml"; "package(threads)"; "link"] (S[A "-thread"]); + flag ["ocaml"; "package(threads)"; "infer_interface"] (S[A "-thread"]); + flag ["c"; "package(threads)"; "compile"] (S[A "-thread"]); - ++ + | _ -> + () end @@ -1027,7 +1090,7 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml | Before_options -> let no_trailing_dot s = if String.length s >= 1 && s.[0] = '.' then -@@ -396,35 +770,44 @@ +@@ -396,35 +770,44 @@ module MyOCamlbuildBase = struct in List.iter (fun (opt, var) -> @@ -1083,7 +1146,7 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml (fun (dir, include_dirs) -> Pathname.define_context dir include_dirs) t.includes; -@@ -439,26 +822,28 @@ +@@ -439,26 +822,28 @@ module MyOCamlbuildBase = struct flag ["link"; "library"; "ocaml"; "native"; tag_libstubs lib] (S[A"-cclib"; A("-l"^(nm_libstubs lib))]); @@ -1119,7 +1182,7 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml (S[A"-I"; P(dir)]); ) t.lib_c; -@@ -466,32 +851,40 @@ +@@ -466,32 +851,40 @@ module MyOCamlbuildBase = struct (* Add flags *) List.iter (fun (tags, cond_specs) -> @@ -1171,62 +1234,16 @@ diff -u ocamlify-0.0.2/myocamlbuild.ml ocamlify-update-0.0.2/myocamlbuild.ml +# 889 "myocamlbuild.ml" (* OASIS_STOP *) Ocamlbuild_plugin.dispatch dispatch_default;; -diff -u ocamlify-0.0.2/README.txt ocamlify-update-0.0.2/README.txt ---- ocamlify-0.0.2/README.txt 2013-06-26 06:08:31.000000000 +0800 -+++ ocamlify-update-0.0.2/README.txt 2018-05-29 11:10:37.772848294 +0800 -@@ -1,11 +1,18 @@ - (* OASIS_START *) --(* DO NOT EDIT (digest: 6b14e9f8e3ce93d7b61df6632978b14b) *) --This is the README file for the ocamlify distribution. -+(* DO NOT EDIT (digest: e5345f3fe2acd3045d4e251cfbf369a6) *) - --include files in OCaml code -+ocamlify - include files in OCaml code -+====================================== - --See the files INSTALL.txt for building and installation instructions. See the --file COPYING.txt for copying conditions. -+See the file [INSTALL.txt](INSTALL.txt) for building and installation -+instructions. - -+Copyright and license -+--------------------- -+ -+ocamlify is distributed under the terms of the GNU Lesser General Public -+License version 2.1 with OCaml linking exception. -+ -+See [COPYING.txt](COPYING.txt) for more information. - - (* OASIS_STOP *) -diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml ---- ocamlify-0.0.2/setup.ml 2013-06-26 06:08:31.000000000 +0800 -+++ ocamlify-update-0.0.2/setup.ml 2018-05-29 11:10:37.782848161 +0800 -@@ -1,42 +1,20 @@ --(********************************************************************************) --(* ocamlify: include files in OCaml code *) --(* *) --(* Copyright (C) 2009-2010, OCamlCore SARL *) --(* *) --(* This library is free software; you can redistribute it and/or modify it *) --(* under the terms of the GNU Lesser General Public License as published by *) --(* the Free Software Foundation; either version 2.1 of the License, or (at *) --(* your option) any later version, with the OCaml static compilation *) --(* exception. *) --(* *) --(* This library is distributed in the hope that it will be useful, but *) --(* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *) --(* or FITNESS FOR A PARTICULAR PURPOSE. See the file COPYING for more *) --(* details. *) --(* *) --(* You should have received a copy of the GNU Lesser General Public License *) --(* along with this library; if not, write to the Free Software Foundation, *) --(* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *) --(********************************************************************************) -+(* setup.ml generated for the first time by OASIS v0.4.11 *) +diff --git a/setup.ml b/setup.ml +index 7b53edb..87518ce 100644 +--- a/setup.ml ++++ b/setup.ml +@@ -20,23 +20,20 @@ + (********************************************************************************) (* OASIS_START *) -(* DO NOT EDIT (digest: e1b35f4beac5c9c844c0c1c02d73290d) *) -+(* DO NOT EDIT (digest: 339d3191072e30ef0eb57232ba90d28d) *) ++(* DO NOT EDIT (digest: 34f91ad0e2768568009a7877006a665e) *) (* - Regenerated by OASIS v0.3.1 + Regenerated by OASIS v0.4.11 @@ -1251,7 +1268,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let fn_ fmt1 fmt2 n = if n = 1 then -@@ -44,83 +22,21 @@ +@@ -44,83 +41,21 @@ module OASISGettext = struct else fmt2^^"" @@ -1340,7 +1357,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let nsplitf str f = if str = "" then -@@ -133,44 +49,48 @@ +@@ -133,44 +68,48 @@ module OASISString = struct Buffer.clear buf in let str_len = String.length str in @@ -1398,9 +1415,9 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + raise Not_found + else + !str_idx - !what_idx -+ - let sub_start str len = ++ + let sub_start str len = let str_len = String.length str in if len >= str_len then @@ -1412,7 +1429,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let sub_end ?(offset=0) str len = let str_len = String.length str in if len >= str_len then -@@ -178,23 +98,22 @@ +@@ -178,23 +117,22 @@ module OASISString = struct else String.sub str 0 (str_len - len) @@ -1448,7 +1465,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let strip_starts_with ~what str = if starts_with ~what str then -@@ -202,23 +121,22 @@ +@@ -202,23 +140,22 @@ module OASISString = struct else raise Not_found @@ -1484,7 +1501,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let strip_ends_with ~what str = if ends_with ~what str then -@@ -226,56 +144,127 @@ +@@ -226,56 +163,127 @@ module OASISString = struct else raise Not_found @@ -1556,22 +1573,30 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + module Make (Ord: Map.OrderedType) = + struct + include Map.Make(Ord) - -- module SetString = Set.Make(String) ++ + let rec add_list t = + function + | (k, v) :: tl -> add_list (add k v t) tl + | [] -> t -+ + +- module SetString = Set.Make(String) + let of_list lst = add_list empty lst -+ + +- let set_string_add_list st lst = +- List.fold_left +- (fun acc e -> SetString.add e acc) +- st +- lst + let to_list t = fold (fun k v acc -> (k, v) :: acc) t [] + end + end + + + module MapString = MapExt.Make(String) -+ + +- let set_string_of_list = +- set_string_add_list +- SetString.empty + + module SetExt = + struct @@ -1597,16 +1622,8 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + let to_list = elements + end + end - -- let set_string_add_list st lst = -- List.fold_left -- (fun acc e -> SetString.add e acc) -- st -- lst - -- let set_string_of_list = -- set_string_add_list -- SetString.empty ++ ++ + module SetString = SetExt.Make(String) @@ -1639,7 +1656,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let varname_of_string ?(hyphen='_') s = if String.length s = 0 then begin -@@ -303,9 +292,10 @@ +@@ -303,9 +311,10 @@ module OASISUtils = struct else buf in @@ -1651,7 +1668,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let varname_concat ?(hyphen='_') p s = let what = String.make 1 hyphen in let p = -@@ -326,44 +316,443 @@ +@@ -326,44 +335,443 @@ module OASISUtils = struct let is_varname str = str = varname_of_string str @@ -2112,7 +2129,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let create () = Hashtbl.create 13 -@@ -371,27 +760,28 @@ +@@ -371,27 +779,28 @@ module PropList = struct let clear t = Hashtbl.clear t @@ -2155,7 +2172,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let create ?(case_insensitive=false) nm = { -@@ -400,7 +790,7 @@ +@@ -400,7 +809,7 @@ module PropList = struct order = Queue.create (); name_norm = (if case_insensitive then @@ -2164,7 +2181,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml else fun s -> s); } -@@ -410,21 +800,21 @@ +@@ -410,21 +819,21 @@ module PropList = struct t.name_norm nm in @@ -2201,7 +2218,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let mem t nm = Hashtbl.mem t.fields nm -@@ -450,7 +840,7 @@ +@@ -450,7 +859,7 @@ module PropList = struct let v = find t k in @@ -2210,7 +2227,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml acc t.order -@@ -464,24 +854,24 @@ +@@ -464,24 +873,24 @@ module PropList = struct t.name end @@ -2245,7 +2262,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let create ?schema ?name ?parse ?print ?default ?update ?help extra = (* Default value container *) -@@ -520,33 +910,33 @@ +@@ -520,33 +929,33 @@ module PropList = struct let x = match update with | Some f -> @@ -2297,7 +2314,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in (* Set data, from string *) -@@ -558,9 +948,9 @@ +@@ -558,9 +967,9 @@ module PropList = struct let print = match print with | Some f -> @@ -2309,7 +2326,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in (* Get data, as a string *) -@@ -568,22 +958,22 @@ +@@ -568,22 +977,22 @@ module PropList = struct print (get data) in @@ -2347,7 +2364,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let fset data t ?context x = t.set data ?context x -@@ -596,28 +986,27 @@ +@@ -596,28 +1005,27 @@ module PropList = struct let fgets data t = t.gets data @@ -2380,7 +2397,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let generic_message ~ctxt lvl fmt = let cond = if ctxt.quiet then -@@ -628,38 +1017,41 @@ +@@ -628,38 +1036,41 @@ module OASISMessage = struct | `Info -> ctxt.info | _ -> true in @@ -2433,7 +2450,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml type comparator = | VGreater of t -@@ -669,26 +1061,20 @@ +@@ -669,26 +1080,20 @@ module OASISVersion = struct | VLesserEqual of t | VOr of comparator * comparator | VAnd of comparator * comparator @@ -2465,7 +2482,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let val_ascii c = if c = '~' then -1 else if is_digit c then 0 -@@ -723,76 +1109,79 @@ +@@ -723,76 +1128,79 @@ module OASISVersion = struct let compare_digit () = let extract_int v p = let start_p = !p in @@ -2586,7 +2603,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let rec string_of_comparator = function -@@ -802,9 +1191,10 @@ +@@ -802,9 +1210,10 @@ module OASISVersion = struct | VGreaterEqual v -> ">= "^(string_of_version v) | VLesserEqual v -> "<= "^(string_of_version v) | VOr (c1, c2) -> @@ -2599,7 +2616,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let rec varname_of_comparator = let concat p v = -@@ -813,40 +1203,38 @@ +@@ -813,40 +1222,38 @@ module OASISVersion = struct (OASISUtils.varname_of_string (string_of_version v)) in @@ -2613,6 +2630,9 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - (varname_of_comparator c1)^"_or_"^(varname_of_comparator c2) - | VAnd (c1, c2) -> - (varname_of_comparator c1)^"_and_"^(varname_of_comparator c2) +- +- let version_0_3_or_after t = +- comparator_apply t (VGreaterEqual (string_of_version "0.3")) + function + | VGreater v -> concat "gt" v + | VLesser v -> concat "lt" v @@ -2623,9 +2643,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + (varname_of_comparator c1)^"_or_"^(varname_of_comparator c2) + | VAnd (c1, c2) -> + (varname_of_comparator c1)^"_and_"^(varname_of_comparator c2) - -- let version_0_3_or_after t = -- comparator_apply t (VGreaterEqual (string_of_version "0.3")) ++ end @@ -2637,14 +2655,14 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml (** License for _oasis fields @author Sylvain Le Gall - *) -- + *) -- type license = string + type license = string + type license_exception = string +- type license = string +- - type license_exception = string type license_version = @@ -2656,7 +2674,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml type license_dep_5_unit = { -@@ -854,31 +1242,32 @@ +@@ -854,31 +1261,32 @@ module OASISLicense = struct excption: license_exception option; version: license_version; } @@ -2696,7 +2714,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml type t = | EBool of bool -@@ -887,9 +1276,10 @@ +@@ -887,9 +1295,10 @@ module OASISExpr = struct | EOr of t * t | EFlag of flag | ETest of test * string @@ -2709,7 +2727,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let eval var_get t = let rec eval' = -@@ -921,6 +1311,7 @@ +@@ -921,6 +1330,7 @@ module OASISExpr = struct in eval' t @@ -2717,7 +2735,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let choose ?printer ?name var_get lst = let rec choose_aux = function -@@ -957,44 +1348,188 @@ +@@ -957,44 +1367,188 @@ module OASISExpr = struct in choose_aux (List.rev lst) @@ -2923,7 +2941,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml type vcs = | Darcs -@@ -1006,149 +1541,165 @@ +@@ -1006,344 +1560,636 @@ module OASISTypes = struct | Arch | Monotone | OtherVCS of url @@ -3016,23 +3034,6 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + type build_section = -- { -- bs_build: bool conditional; -- bs_install: bool conditional; -- bs_path: unix_dirname; -- bs_compiled_object: compiled_object; -- bs_build_depends: dependency list; -- bs_build_tools: tool list; -- bs_c_sources: unix_filename list; -- bs_data_files: (unix_filename * unix_filename option) list; -- bs_ccopt: args conditional; -- bs_cclib: args conditional; -- bs_dlllib: args conditional; -- bs_dllpath: args conditional; -- bs_byteopt: args conditional; -- bs_nativeopt: args conditional; -- } -- + { + bs_build: bool conditional; + bs_install: bool conditional; @@ -3053,16 +3054,8 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + bs_nativeopt: args conditional; + } + - - type library = -- { -- lib_modules: string list; -- lib_pack: bool; -- lib_internal_modules: string list; -- lib_findlib_parent: findlib_name option; -- lib_findlib_name: findlib_name option; -- lib_findlib_containers: findlib_name list; -- } ++ ++ type library = + { + lib_modules: string list; + lib_pack: bool; @@ -3072,52 +3065,31 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + lib_findlib_directory: unix_dirname option; + lib_findlib_containers: findlib_name list; + } - - - type object_ = -- { -- obj_modules: string list; -- obj_findlib_fullname: findlib_name list option; -- } ++ ++ ++ type object_ = + { + obj_modules: string list; + obj_findlib_fullname: findlib_name list option; + obj_findlib_directory: unix_dirname option; + } + - - type executable = -- { -- exec_custom: bool; -- exec_main_is: unix_filename; -- } ++ ++ type executable = + { + exec_custom: bool; + exec_main_is: unix_filename; + } + - - type flag = -- { -- flag_description: string option; -- flag_default: bool conditional; -- } ++ ++ type flag = + { + flag_description: string option; + flag_default: bool conditional; + } + - - type source_repository = -- { -- src_repo_type: vcs; -- src_repo_location: url; -- src_repo_browser: url option; -- src_repo_module: string option; -- src_repo_branch: string option; -- src_repo_tag: string option; -- src_repo_subdir: unix_filename option; -- } ++ ++ type source_repository = + { + src_repo_type: vcs; + src_repo_location: url; @@ -3128,16 +3100,8 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + src_repo_subdir: unix_filename option; + } + - - type test = -- { -- test_type: [`Test] plugin; -- test_command: command_line conditional; -- test_custom: custom; -- test_working_directory: unix_filename option; -- test_run: bool conditional; -- test_tools: tool list; -- } ++ ++ type test = + { + test_type: [`Test] plugin; + test_command: command_line conditional; @@ -3147,34 +3111,18 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + test_tools: tool list; + } + - - type doc_format = -- | HTML of unix_filename ++ ++ type doc_format = + | HTML of unix_filename (* TODO: source filename. *) - | DocText - | PDF - | PostScript -- | Info of unix_filename ++ | DocText ++ | PDF ++ | PostScript + | Info of unix_filename (* TODO: source filename. *) - | DVI - | OtherDoc -- ++ | DVI ++ | OtherDoc + - - type doc = -- { -- doc_type: [`Doc] plugin; -- doc_custom: custom; -- doc_build: bool conditional; -- doc_install: bool conditional; -- doc_install_dir: unix_filename; -- doc_title: string; -- doc_authors: string list; -- doc_abstract: string option; -- doc_format: doc_format; -- doc_data_files: (unix_filename * unix_filename option) list; -- doc_build_tools: tool list; -- } ++ ++ type doc = + { + doc_type: [`Doc] plugin; + doc_custom: custom; @@ -3190,18 +3138,18 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + doc_build_tools: tool list; + } + - - type section = - | Library of common_section * build_section * library -@@ -1158,192 +1709,468 @@ - | SrcRepo of common_section * source_repository - | Test of common_section * test - | Doc of common_section * doc -- + - - type section_kind = -- [ `Library | `Object | `Executable | `Flag | `SrcRepo | `Test | `Doc ] ++ type section = ++ | Library of common_section * build_section * library ++ | Object of common_section * build_section * object_ ++ | Executable of common_section * build_section * executable ++ | Flag of common_section * flag ++ | SrcRepo of common_section * source_repository ++ | Test of common_section * test ++ | Doc of common_section * doc ++ ++ ++ type section_kind = + [ `Library | `Object | `Executable | `Flag | `SrcRepo | `Test | `Doc ] + + @@ -3246,89 +3194,66 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + schema_data: PropList.Data.t; + plugin_data: plugin_data; + } - -- type package = -- { -- oasis_version: OASISVersion.t; -- ocaml_version: OASISVersion.comparator option; -- findlib_version: OASISVersion.comparator option; -- name: package_name; -- version: OASISVersion.t; -- license: OASISLicense.t; -- license_file: unix_filename option; -- copyrights: string list; -- maintainers: string list; -- authors: string list; -- homepage: url option; -- synopsis: string; -- description: string option; -- categories: url list; -- -- conf_type: [`Configure] plugin; -- conf_custom: custom; -- -- build_type: [`Build] plugin; -- build_custom: custom; -- -- install_type: [`Install] plugin; -- install_custom: custom; -- uninstall_custom: custom; -- -- clean_custom: custom; -- distclean_custom: custom; -- -- files_ab: unix_filename list; -- sections: section list; -- plugins: [`Extra] plugin list; -- schema_data: PropList.Data.t; -- plugin_data: plugin_data; -- } - - end - --module OASISUnixPath = struct --# 21 "/home/gildor/programmation/oasis/src/oasis/OASISUnixPath.ml" ++ ++ ++end ++ +module OASISFeatures = struct +(* # 22 "src/oasis/OASISFeatures.ml" *) - -- type unix_filename = string -- type unix_dirname = string ++ + open OASISTypes + open OASISUtils + open OASISGettext + open OASISVersion - -- type host_filename = string -- type host_dirname = string ++ + module MapPlugin = + Map.Make + (struct + type t = plugin_kind * name + let compare = Pervasives.compare + end) - -- let current_dir_name = "." ++ + module Data = + struct + type t = -+ { + { +- bs_build: bool conditional; +- bs_install: bool conditional; +- bs_path: unix_dirname; +- bs_compiled_object: compiled_object; +- bs_build_depends: dependency list; +- bs_build_tools: tool list; +- bs_c_sources: unix_filename list; +- bs_data_files: (unix_filename * unix_filename option) list; +- bs_ccopt: args conditional; +- bs_cclib: args conditional; +- bs_dlllib: args conditional; +- bs_dllpath: args conditional; +- bs_byteopt: args conditional; +- bs_nativeopt: args conditional; + oasis_version: OASISVersion.t; + plugin_versions: OASISVersion.t option MapPlugin.t; + alpha_features: string list; + beta_features: string list; -+ } + } +- -- let parent_dir_name = ".." +- type library = + let create oasis_version alpha_features beta_features = -+ { + { +- lib_modules: string list; +- lib_pack: bool; +- lib_internal_modules: string list; +- lib_findlib_parent: findlib_name option; +- lib_findlib_name: findlib_name option; +- lib_findlib_containers: findlib_name list; +- } + oasis_version = oasis_version; + plugin_versions = MapPlugin.empty; + alpha_features = alpha_features; + beta_features = beta_features + } - -- let is_current_dir fn = -- fn = current_dir_name || fn = "" ++ + let of_package pkg = + create + pkg.OASISTypes.oasis_version @@ -3341,19 +3266,10 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + (plugin_kind, plugin_name) + plugin_version + t.plugin_versions} - -- let concat f1 f2 = -- if is_current_dir f1 then -- f2 -- else -- let f1' = -- try OASISString.strip_ends_with ~what:"/" f1 with Not_found -> f1 -- in -- f1'^"/"^f2 ++ + let plugin_version plugin_kind plugin_name t = + MapPlugin.find (plugin_kind, plugin_name) t.plugin_versions - -- let make = ++ + let to_string t = + Printf.sprintf + "oasis_version: %s; alpha_features: %s; beta_features: %s; \ @@ -3382,45 +3298,18 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + + + let string_of_stage = - function -- | hd :: tl -> -- List.fold_left -- (fun f p -> concat f p) -- hd -- tl -- | [] -> -- invalid_arg "OASISUnixPath.make" ++ function + | Alpha -> "alpha" + | Beta -> "beta" - -- let dirname f = -- try -- String.sub f 0 (String.rindex f '/') -- with Not_found -> -- current_dir_name - -- let basename f = -- try -- let pos_start = -- (String.rindex f '/') + 1 -- in -- String.sub f pos_start ((String.length f) - pos_start) -- with Not_found -> -- f ++ ++ + let field_of_stage = + function + | Alpha -> "AlphaFeatures" + | Beta -> "BetaFeatures" - -- let chop_extension f = -- try -- let last_dot = -- String.rindex f '.' -- in -- let sub = -- String.sub f 0 last_dot -+ type publication = InDev of stage | SinceVersion of OASISVersion.t + ++ type publication = InDev of stage | SinceVersion of OASISVersion.t + + type t = + { + name: string; @@ -3478,7 +3367,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + let version_is_good = + OASISVersion.comparator_apply + version (OASISVersion.VGreaterEqual min_version) - in ++ in + Printf.ksprintf + (fun str -> if version_is_good then None else Some str) + fmt @@ -3499,9 +3388,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + | Field(fld, where), Some(plugin_knd, plugin_name, _), + SinceVersion min_version -> + begin - try -- let last_slash = -- String.rindex f '/' ++ try + let plugin_version_current = + try + match Data.plugin_version plugin_knd plugin_name data with @@ -3520,11 +3407,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + (f_ "Field %s in %s is only valid when the OASIS plugin %s \ + is defined.") + fld where plugin_name - in -- if last_slash < last_dot then -- sub -- else -- f ++ in + version_is_good ~min_version plugin_version_current + (f_ "Field %s in %s is only valid for the OASIS plugin %s \ + since v%s, update your plugin from '%s (%s)' to \ @@ -3578,10 +3461,20 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + with Failure msg -> + Some msg + end -+ + +- type object_ = +- { +- obj_modules: string list; +- obj_findlib_fullname: findlib_name list option; +- } + | NoOrigin, None, SinceVersion min_version -> + version_is_good ~min_version data.Data.oasis_version "%s" no_message -+ + +- type executable = +- { +- exec_custom: bool; +- exec_main_is: unix_filename; +- } + | NoOrigin, Some(plugin_knd, plugin_name, _), SinceVersion min_version -> + begin + try @@ -3592,35 +3485,127 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + in + version_is_good ~min_version plugin_version_current + "%s" no_message - with Not_found -> -- sub ++ with Not_found -> + Some no_message + end -+ -+ + +- type flag = +- { +- flag_description: string option; +- flag_default: bool conditional; +- } + +- type source_repository = +- { +- src_repo_type: vcs; +- src_repo_location: url; +- src_repo_browser: url option; +- src_repo_module: string option; +- src_repo_branch: string option; +- src_repo_tag: string option; +- src_repo_subdir: unix_filename option; +- } + let data_assert t data origin = + match data_check t data origin with + | None -> () + | Some str -> failwith str -+ +- type test = +- { +- test_type: [`Test] plugin; +- test_command: command_line conditional; +- test_custom: custom; +- test_working_directory: unix_filename option; +- test_run: bool conditional; +- test_tools: tool list; +- } + +- type doc_format = +- | HTML of unix_filename +- | DocText +- | PDF +- | PostScript +- | Info of unix_filename +- | DVI +- | OtherDoc +- + let data_test t data = + match data_check t data NoOrigin with + | None -> true + | Some _ -> false -+ -+ + +- type doc = +- { +- doc_type: [`Doc] plugin; +- doc_custom: custom; +- doc_build: bool conditional; +- doc_install: bool conditional; +- doc_install_dir: unix_filename; +- doc_title: string; +- doc_authors: string list; +- doc_abstract: string option; +- doc_format: doc_format; +- doc_data_files: (unix_filename * unix_filename option) list; +- doc_build_tools: tool list; +- } + +- type section = +- | Library of common_section * build_section * library +- | Object of common_section * build_section * object_ +- | Executable of common_section * build_section * executable +- | Flag of common_section * flag +- | SrcRepo of common_section * source_repository +- | Test of common_section * test +- | Doc of common_section * doc +- + let package_test t pkg = + data_test t (Data.of_package pkg) -+ -+ + +- type section_kind = +- [ `Library | `Object | `Executable | `Flag | `SrcRepo | `Test | `Doc ] + +- type package = + let create ?plugin name publication description = + let () = + if Hashtbl.mem all_features name then + failwithf "Feature '%s' is already declared." name + in + let t = -+ { + { +- oasis_version: OASISVersion.t; +- ocaml_version: OASISVersion.comparator option; +- findlib_version: OASISVersion.comparator option; +- name: package_name; +- version: OASISVersion.t; +- license: OASISLicense.t; +- license_file: unix_filename option; +- copyrights: string list; +- maintainers: string list; +- authors: string list; +- homepage: url option; +- synopsis: string; +- description: string option; +- categories: url list; +- +- conf_type: [`Configure] plugin; +- conf_custom: custom; +- +- build_type: [`Build] plugin; +- build_custom: custom; +- +- install_type: [`Install] plugin; +- install_custom: custom; +- uninstall_custom: custom; +- +- clean_custom: custom; +- distclean_custom: custom; +- +- files_ab: unix_filename list; +- sections: section list; +- plugins: [`Extra] plugin list; +- schema_data: PropList.Data.t; +- plugin_data: plugin_data; +- } + name = name; + plugin = plugin; + publication = publication; @@ -3629,14 +3614,110 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + in + Hashtbl.add all_features name t; + t -+ -+ + +-end + +-module OASISUnixPath = struct +-# 21 "/home/gildor/programmation/oasis/src/oasis/OASISUnixPath.ml" + let get_stage name = + try + (Hashtbl.find all_features name).publication - with Not_found -> ++ with Not_found -> ++ failwithf (f_ "Feature %s doesn't exist.") name + +- type unix_filename = string +- type unix_dirname = string + +- type host_filename = string +- type host_dirname = string ++ let list () = ++ Hashtbl.fold (fun _ v acc -> v :: acc) all_features [] + +- let current_dir_name = "." ++ (* ++ * Real flags. ++ *) + +- let parent_dir_name = ".." + +- let is_current_dir fn = +- fn = current_dir_name || fn = "" ++ let features = ++ create "features_fields" ++ (since_version "0.4") ++ (fun () -> ++ s_ "Enable to experiment not yet official features.") + +- let concat f1 f2 = +- if is_current_dir f1 then +- f2 +- else +- let f1' = +- try OASISString.strip_ends_with ~what:"/" f1 with Not_found -> f1 +- in +- f1'^"/"^f2 + +- let make = +- function +- | hd :: tl -> +- List.fold_left +- (fun f p -> concat f p) +- hd +- tl +- | [] -> +- invalid_arg "OASISUnixPath.make" ++ let flag_docs = ++ create "flag_docs" ++ (since_version "0.3") ++ (fun () -> ++ s_ "Make building docs require '-docs' flag at configure.") + +- let dirname f = +- try +- String.sub f 0 (String.rindex f '/') +- with Not_found -> +- current_dir_name + +- let basename f = +- try +- let pos_start = +- (String.rindex f '/') + 1 +- in +- String.sub f pos_start ((String.length f) - pos_start) +- with Not_found -> +- f ++ let flag_tests = ++ create "flag_tests" ++ (since_version "0.3") ++ (fun () -> ++ s_ "Make running tests require '-tests' flag at configure.") + +- let chop_extension f = +- try +- let last_dot = +- String.rindex f '.' +- in +- let sub = +- String.sub f 0 last_dot +- in +- try +- let last_slash = +- String.rindex f '/' +- in +- if last_slash < last_dot then +- sub +- else +- f +- with Not_found -> +- sub + +- with Not_found -> - f -+ failwithf (f_ "Feature %s doesn't exist.") name ++ let pack = ++ create "pack" ++ (since_version "0.3") ++ (fun () -> ++ s_ "Allow to create packed library.") - let capitalize_file f = - let dir = dirname f in @@ -3647,31 +3728,33 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - let dir = dirname f in - let base = basename f in - concat dir (String.uncapitalize base) -+ let list () = -+ Hashtbl.fold (fun _ v acc -> v :: acc) all_features [] ++ let section_object = ++ create "section_object" beta ++ (fun () -> ++ s_ "Implement an object section.") -end -+ (* -+ * Real flags. -+ *) -module OASISHostPath = struct -# 21 "/home/gildor/programmation/oasis/src/oasis/OASISHostPath.ml" - -+ let features = -+ create "features_fields" -+ (since_version "0.4") ++ let dynrun_for_release = ++ create "dynrun_for_release" alpha + (fun () -> -+ s_ "Enable to experiment not yet official features.") ++ s_ "Make '-setup-update dynamic' suitable for releasing project.") + - open Filename ++ let compiled_setup_ml = ++ create "compiled_setup_ml" alpha ++ (fun () -> ++ s_ "Compile the setup.ml and speed-up actions done with it.") - module Unix = OASISUnixPath -+ let flag_docs = -+ create "flag_docs" -+ (since_version "0.3") ++ let disable_oasis_section = ++ create "disable_oasis_section" alpha + (fun () -> -+ s_ "Make building docs require '-docs' flag at configure.") ++ s_ "Allow the OASIS section comments and digests to be omitted in \ ++ generated files.") - let make = - function @@ -3679,6 +3762,12 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - invalid_arg "OASISHostPath.make" - | hd :: tl -> - List.fold_left Filename.concat hd tl ++ let no_automatic_syntax = ++ create "no_automatic_syntax" alpha ++ (fun () -> ++ s_ "Disable the automatic inclusion of -syntax camlp4o for packages \ ++ that matches the internal heuristic (if a dependency ends with \ ++ a .syntax or is a well known syntax).") - let of_unix ufn = - if Sys.os_type = "Unix" then @@ -3694,50 +3783,6 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - else - p) - (OASISString.nsplit ufn '/')) -+ let flag_tests = -+ create "flag_tests" -+ (since_version "0.3") -+ (fun () -> -+ s_ "Make running tests require '-tests' flag at configure.") -+ -+ -+ let pack = -+ create "pack" -+ (since_version "0.3") -+ (fun () -> -+ s_ "Allow to create packed library.") -+ -+ -+ let section_object = -+ create "section_object" beta -+ (fun () -> -+ s_ "Implement an object section.") -+ -+ -+ let dynrun_for_release = -+ create "dynrun_for_release" alpha -+ (fun () -> -+ s_ "Make '-setup-update dynamic' suitable for releasing project.") -+ - -+ let compiled_setup_ml = -+ create "compiled_setup_ml" alpha -+ (fun () -> -+ s_ "Compile the setup.ml and speed-up actions done with it.") -+ -+ let disable_oasis_section = -+ create "disable_oasis_section" alpha -+ (fun () -> -+ s_ "Allow the OASIS section comments and digests to be omitted in \ -+ generated files.") -+ -+ let no_automatic_syntax = -+ create "no_automatic_syntax" alpha -+ (fun () -> -+ s_ "Disable the automatic inclusion of -syntax camlp4o for packages \ -+ that matches the internal heuristic (if a dependency ends with \ -+ a .syntax or is a well known syntax).") -+ + let findlib_directory = + create "findlib_directory" beta + (fun () -> @@ -3748,7 +3793,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + create "findlib_extra_files" beta + (fun () -> + s_ "Allow to install extra files for findlib libraries.") -+ + + let source_patterns = + create "source_patterns" alpha + (fun () -> @@ -3797,7 +3842,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let section_common_set cs = function | Library (_, bs, lib) -> Library (cs, bs, lib) -@@ -1354,42 +2181,47 @@ +@@ -1354,42 +2200,47 @@ module OASISSection = struct | Test (_, tst) -> Test (cs, tst) | Doc (_, doc) -> Doc (cs, doc) @@ -3863,7 +3908,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let equal t1 t2 = (id t1) = (id t2) -@@ -1397,177 +2229,187 @@ +@@ -1397,177 +2248,187 @@ module OASISSection = struct Hashtbl.hash (id t) end @@ -4045,6 +4090,8 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - ~ext_dll - ~source_file_exists - (cs, bs, lib) = +- +- let find_modules lst ext = + ~ctxt + ~is_native + ~has_native_dynlink @@ -4052,8 +4099,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + ~ext_dll + ~source_file_exists + (cs, bs, lib) = - -- let find_modules lst ext = ++ + let find_modules lst ext = let find_module modul = - match find_module source_file_exists bs modul with @@ -4066,7 +4112,13 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - module '%s' in library %s") - modul cs.cs_name; - lst -- in ++ match find_module ~ctxt source_file_exists cs bs modul with ++ | `Sources (_, [fn]) when ext <> "cmi" ++ && Filename.check_suffix fn ".mli" -> ++ None (* No implementation files for pure interface. *) ++ | `Sources (base_fn, _) -> Some [base_fn] ++ | `No_sources lst -> Some lst + in - List.map - (fun nm -> - List.map @@ -4078,13 +4130,6 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - (* The headers that should be compiled along *) - let headers = - if lib.lib_pack then -+ match find_module ~ctxt source_file_exists cs bs modul with -+ | `Sources (_, [fn]) when ext <> "cmi" -+ && Filename.check_suffix fn ".mli" -> -+ None (* No implementation files for pure interface. *) -+ | `Sources (base_fn, _) -> Some [base_fn] -+ | `No_sources lst -> Some lst -+ in + List.fold_left + (fun acc nm -> + match find_module nm with @@ -4158,7 +4203,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml else acc in -@@ -1575,143 +2417,151 @@ +@@ -1575,143 +2436,151 @@ module OASISLibrary = struct add_pack_header ([cs.cs_name^".cma"] :: acc) in let native acc = @@ -4378,7 +4423,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let findlib_mapping pkg = (* Map from library name to either full findlib name or parts + parent. *) let fndlb_parts_of_lib_name = -@@ -1724,53 +2574,53 @@ +@@ -1724,53 +2593,53 @@ module OASISFindlib = struct let name = String.concat "." (lib.lib_findlib_containers @ [name]) in @@ -4475,10 +4520,12 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in (* Solve the above graph to be only library name to full findlib name. *) -@@ -1782,40 +2632,40 @@ +@@ -1780,42 +2649,42 @@ module OASISFindlib = struct + failwithf + (f_ "Library '%s' is involved in a cycle \ with regard to findlib naming.") - lib_name; - let visited = SetString.add lib_name visited in +- lib_name; +- let visited = SetString.add lib_name visited in - try - match MapString.find lib_name mp with - | `Solved fndlb_nm -> @@ -4494,6 +4541,8 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - (f_ "Library '%s', which is defined as the findlib parent of \ - library '%s', doesn't exist.") - lib_name lib_name_child ++ lib_name; ++ let visited = SetString.add lib_name visited in + try + match MapString.find lib_name mp with + | `Solved fndlb_nm -> @@ -4540,7 +4589,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in (* Convert an internal library name to a findlib name. *) -@@ -1827,75 +2677,89 @@ +@@ -1827,75 +2696,89 @@ module OASISFindlib = struct in (* Add a library to the tree. @@ -4623,24 +4672,24 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml | hd :: tl -> - Node (None, MapString.add hd (new_node tl) MapString.empty) + Node (None, MapString.add hd (new_node tl) MapString.empty) - in -- add_children (OASISString.nsplit fndlb_fullname '.') mp ++ in + add_children (OASISString.nsplit fndlb_fullname '.') mp - in - -- let rec group_of_tree mp = ++ in ++ + let unix_directory dn lib = + let directory = + match lib with + | `Library lib -> lib.lib_findlib_directory + | `Object obj -> obj.obj_findlib_directory -+ in + in +- add_children (OASISString.nsplit fndlb_fullname '.') mp + match dn, directory with + | None, None -> None + | None, Some dn | Some dn, None -> Some dn + | Some dn1, Some dn2 -> Some (OASISUnixPath.concat dn1 dn2) -+ in -+ + in + +- let rec group_of_tree mp = + let rec group_of_tree dn mp = MapString.fold (fun nm node acc -> @@ -4666,7 +4715,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml mp [] in -@@ -1904,27 +2768,25 @@ +@@ -1904,27 +2787,25 @@ module OASISFindlib = struct (fun mp -> function | Library (cs, bs, lib) -> @@ -4705,7 +4754,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in let library_name_of_findlib_name fndlb_nm = try -@@ -1933,76 +2795,86 @@ +@@ -1933,76 +2814,86 @@ module OASISFindlib = struct raise (FindlibPackageNotFound fndlb_nm) in @@ -4739,14 +4788,6 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - children - | Package (_, cs, bs, lib, _) -> - Some (cs, bs, lib) -- in -- match root_lib_aux grp with -- | Some res -> -- res -- | None -> -- failwithf -- (f_ "Unable to determine root library of findlib library '%s'") -- (findlib_of_group grp) + List.fold_left + (fun res grp -> + if res = None then @@ -4757,7 +4798,14 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + children + | Package (_, cs, bs, lib, _, _) -> + Some (cs, bs, lib) -+ in + in +- match root_lib_aux grp with +- | Some res -> +- res +- | None -> +- failwithf +- (f_ "Unable to determine root library of findlib library '%s'") +- (findlib_of_group grp) + match root_lib_aux grp with + | Some res -> + res @@ -4821,7 +4869,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let run ~ctxt ?f_exit_code ?(quote=true) cmd args = let cmd = if quote then -@@ -2020,74 +2892,79 @@ +@@ -2020,74 +2911,79 @@ module OASISExec = struct let cmdline = String.concat " " (cmd :: args) in @@ -4948,7 +4996,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let find_file ?(case_sensitive=true) paths exts = -@@ -2097,7 +2974,7 @@ +@@ -2097,7 +2993,7 @@ module OASISFileUtil = struct (List.map (fun a -> List.map @@ -4957,7 +5005,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml lst2) lst1) in -@@ -2105,312 +2982,318 @@ +@@ -2105,312 +3001,318 @@ module OASISFileUtil = struct let rec combined_paths lst = match lst with | p1 :: p2 :: tl -> @@ -5122,7 +5170,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + (f_ "Cannot create directory '%s', a file of the same name already \ + exists") + tgt - end ++ end + else + begin + mkdir_parent ~ctxt f (Filename.dirname tgt); @@ -5131,8 +5179,8 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + f tgt; + mkdir ~ctxt tgt + end -+ end -+ + end + + + let rmdir ~ctxt tgt = + if Sys.readdir tgt = [||] then begin @@ -5147,7 +5195,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + tgt + end + - ++ let glob ~ctxt fn = - let basename = - Filename.basename fn @@ -5368,6 +5416,11 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - Buffer.contents buff - in - var_expand (MapString.find name env) +- +- let var_choose lst env = +- OASISExpr.choose +- (fun nm -> var_get nm env) +- lst + let rec var_expand str env = + let buff = Buffer.create ((String.length str) * 2) in + Buffer.add_substitute @@ -5383,11 +5436,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + str)) + str; + Buffer.contents buff - -- let var_choose lst env = -- OASISExpr.choose -- (fun nm -> var_get nm env) -- lst ++ + + let var_get name env = var_expand (MapString.find name env) env + let var_choose lst env = OASISExpr.choose (fun nm -> var_get nm env) lst @@ -5461,7 +5510,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml type cli_handle_t = | CLINone | CLIAuto -@@ -2418,79 +3301,82 @@ +@@ -2418,79 +3320,82 @@ module BaseEnv = struct | CLIEnable | CLIUser of (Arg.key * Arg.spec * Arg.doc) list @@ -5604,7 +5653,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml and var_get name = let vl = -@@ -2504,7 +3390,8 @@ +@@ -2504,7 +3409,8 @@ module BaseEnv = struct raise e end in @@ -5614,7 +5663,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let var_choose ?printer ?name lst = OASISExpr.choose -@@ -2513,27 +3400,29 @@ +@@ -2513,27 +3419,29 @@ module BaseEnv = struct var_get lst @@ -5659,7 +5708,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let default = [ -@@ -2554,22 +3443,22 @@ +@@ -2554,22 +3462,22 @@ module BaseEnv = struct in (* Try to find a value that can be defined @@ -5687,7 +5736,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml end else errors, res) -@@ -2579,13 +3468,13 @@ +@@ -2579,13 +3487,13 @@ module BaseEnv = struct Pervasives.compare o2 o1) lst) in @@ -5708,7 +5757,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in let help = -@@ -2601,23 +3490,24 @@ +@@ -2601,23 +3509,24 @@ module BaseEnv = struct ~parse:(fun ?(context=ODefault) s -> [context, fun () -> s]) ~print:var_get_low ~default @@ -5744,7 +5793,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml if Schema.mem schema name then begin (* TODO: look suspsicious, we want to memorize dflt not dflt () *) -@@ -2637,8 +3527,9 @@ +@@ -2637,8 +3546,9 @@ module BaseEnv = struct dflt end @@ -5756,7 +5805,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let print_hidden = var_define -@@ -2649,6 +3540,7 @@ +@@ -2649,6 +3559,7 @@ module BaseEnv = struct "print_hidden" (fun () -> "false") @@ -5764,7 +5813,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let var_all () = List.rev (Schema.fold -@@ -2660,49 +3552,68 @@ +@@ -2660,49 +3571,68 @@ module BaseEnv = struct [] schema) @@ -5869,7 +5918,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let print () = let printable_vars = -@@ -2711,20 +3622,15 @@ +@@ -2711,20 +3641,15 @@ module BaseEnv = struct if not def.hide || bool_of_string (print_hidden ()) then begin try @@ -5893,7 +5942,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml end else acc) -@@ -2736,162 +3642,166 @@ +@@ -2736,162 +3661,166 @@ module BaseEnv = struct (List.rev_map String.length (List.rev_map fst printable_vars)) in @@ -6183,7 +6232,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let prog_best prg prg_lst = var_redefine prg -@@ -2901,74 +3811,80 @@ +@@ -2901,74 +3830,80 @@ module BaseCheck = struct (fun res e -> match res with | Some _ -> @@ -6307,7 +6356,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let package ?version_comparator pkg () = let var = OASISUtils.varname_concat -@@ -2981,13 +3897,13 @@ +@@ -2981,13 +3916,13 @@ module BaseCheck = struct (ocamlfind ()) ["query"; "-format"; "%d"; pkg] in @@ -6328,7 +6377,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in let vl = var_redefine -@@ -2995,80 +3911,83 @@ +@@ -2995,80 +3930,83 @@ module BaseCheck = struct (fun () -> findlib_dir pkg) () in @@ -6460,7 +6509,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml lazy (var_protect (Marshal.to_string -@@ -3079,13 +3998,14 @@ +@@ -3079,13 +4017,14 @@ module BaseOCamlcConfig = struct (ocamlc ()) ["-config"])) [])) in @@ -6482,7 +6531,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let var_define nm = (* Extract data from ocamlc -config *) -@@ -3095,47 +4015,47 @@ +@@ -3095,47 +4034,47 @@ module BaseOCamlcConfig = struct 0 in let chop_version_suffix s = @@ -6553,7 +6602,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let ocamlfind = BaseCheck.ocamlfind let ocamlc = BaseOCamlcConfig.ocamlc let ocamlopt = prog_opt "ocamlopt" -@@ -3146,32 +4066,38 @@ +@@ -3146,32 +4085,38 @@ module BaseStandardVar = struct let rpkg = ref None @@ -6594,7 +6643,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let pkg_version = var_define ~short_desc:(fun () -> s_ "Package version") -@@ -3179,16 +4105,20 @@ +@@ -3179,16 +4124,20 @@ module BaseStandardVar = struct (fun () -> (OASISVersion.string_of_version (pkg_get ()).version)) @@ -6615,7 +6664,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let standard_library_default = c "standard_library_default" let standard_library = c "standard_library" let standard_runtime = c "standard_runtime" -@@ -3202,23 +4132,26 @@ +@@ -3202,23 +4151,26 @@ module BaseStandardVar = struct let default_executable_name = c "default_executable_name" let systhread_supported = c "systhread_supported" @@ -6649,7 +6698,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml (**/**) let p name hlp dflt = -@@ -3229,119 +4162,140 @@ +@@ -3229,119 +4181,140 @@ module BaseStandardVar = struct name dflt @@ -6796,7 +6845,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let destdir = p "destdir" (fun () -> s_ "Prepend a path when installing package") -@@ -3351,35 +4305,39 @@ +@@ -3351,35 +4324,39 @@ module BaseStandardVar = struct ("destdir", Some (s_ "undefined by construct")))) @@ -6841,7 +6890,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let rm = var_define ~short_desc:(fun () -> s_ "Remove a file.") -@@ -3389,6 +4347,7 @@ +@@ -3389,6 +4366,7 @@ module BaseStandardVar = struct | "Win32" -> "del" | _ -> "rm -f") @@ -6849,7 +6898,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let rmdir = var_define ~short_desc:(fun () -> s_ "Remove a directory.") -@@ -3398,6 +4357,7 @@ +@@ -3398,6 +4376,7 @@ module BaseStandardVar = struct | "Win32" -> "rd" | _ -> "rm -rf") @@ -6857,7 +6906,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let debug = var_define ~short_desc:(fun () -> s_ "Turn ocaml debug flag on") -@@ -3405,6 +4365,7 @@ +@@ -3405,6 +4384,7 @@ module BaseStandardVar = struct "debug" (fun () -> "true") @@ -6865,7 +6914,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let profile = var_define ~short_desc:(fun () -> s_ "Turn ocaml profile flag on") -@@ -3412,17 +4373,19 @@ +@@ -3412,17 +4392,19 @@ module BaseStandardVar = struct "profile" (fun () -> "false") @@ -6886,7 +6935,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let docs = var_define_cond ~since_version:"0.3" (fun () -> -@@ -3433,6 +4396,7 @@ +@@ -3433,6 +4415,7 @@ module BaseStandardVar = struct (fun () -> "true")) "true" @@ -6894,7 +6943,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let native_dynlink = var_define ~short_desc:(fun () -> s_ "Compiler support generation of .cmxs.") -@@ -3440,7 +4404,7 @@ +@@ -3440,7 +4423,7 @@ module BaseStandardVar = struct "native_dynlink" (fun () -> let res = @@ -6903,7 +6952,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml OASISVersion.comparator_apply (OASISVersion.version_of_string (ocaml_version ())) (OASISVersion.VLesser -@@ -3452,37 +4416,38 @@ +@@ -3452,37 +4435,38 @@ module BaseStandardVar = struct (OASISVersion.VLesser (OASISVersion.version_of_string "0.30")) in @@ -6969,7 +7018,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let init pkg = rpkg := Some pkg; -@@ -3491,180 +4456,140 @@ +@@ -3491,180 +4475,140 @@ module BaseStandardVar = struct end module BaseFileAB = struct @@ -7112,7 +7161,14 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - in - read_aux (SetTupleString.empty, []) - end -+ +- else +- begin +- [] +- end + +- let register event data = +- let chn_out = +- open_out_gen [Open_append; Open_creat; Open_text] 0o644 default_filename + let load ~ctxt () = + let module SetTupleString = + Set.Make @@ -7123,71 +7179,35 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + | 0 -> String.compare s12 s22 + | n -> n + end) -+ in -+ if ctxt.srcfs#file_exists default_filename then begin -+ defer_close -+ (ctxt.srcfs#open_in default_filename) -+ (fun rdr -> -+ let line = ref 1 in -+ let lxr = Genlex.make_lexer [] (stream_of_reader rdr) in -+ let rec read_aux (st, lst) = -+ match Stream.npeek 2 lxr with -+ | [Genlex.String e; Genlex.String d] -> -+ let t = e, d in -+ Stream.junk lxr; Stream.junk lxr; -+ if SetTupleString.mem t st then -+ read_aux (st, lst) -+ else -+ read_aux (SetTupleString.add t st, t :: lst) -+ | [] -> List.rev lst -+ | _ -> -+ failwithf -+ (f_ "Malformed log file '%s' at line %d") -+ (ctxt.srcfs#string_of_filename default_filename) -+ !line -+ in -+ read_aux (SetTupleString.empty, [])) -+ end else begin -+ [] -+ end -+ -+ -+ let register ~ctxt event data = -+ defer_close -+ (ctxt.srcfs#open_out -+ ~mode:[Open_append; Open_creat; Open_text] -+ ~perm:0o644 -+ default_filename) -+ (fun wrtr -> -+ let buf = Buffer.create 13 in -+ Printf.bprintf buf "%S %S\n" event data; -+ wrtr#output buf) -+ -+ -+ let unregister ~ctxt event data = -+ let lst = load ~ctxt () in -+ let buf = Buffer.create 13 in -+ List.iter -+ (fun (e, d) -> -+ if e <> event || d <> data then -+ Printf.bprintf buf "%S %S\n" e d) -+ lst; -+ if Buffer.length buf > 0 then -+ defer_close -+ (ctxt.srcfs#open_out default_filename) -+ (fun wrtr -> wrtr#output buf) - else -- begin -- [] -- end -+ ctxt.srcfs#remove default_filename - -- let register event data = -- let chn_out = -- open_out_gen [Open_append; Open_creat; Open_text] 0o644 default_filename -- in + in - Printf.fprintf chn_out "%S %S\n" event data; - close_out chn_out ++ if ctxt.srcfs#file_exists default_filename then begin ++ defer_close ++ (ctxt.srcfs#open_in default_filename) ++ (fun rdr -> ++ let line = ref 1 in ++ let lxr = Genlex.make_lexer [] (stream_of_reader rdr) in ++ let rec read_aux (st, lst) = ++ match Stream.npeek 2 lxr with ++ | [Genlex.String e; Genlex.String d] -> ++ let t = e, d in ++ Stream.junk lxr; Stream.junk lxr; ++ if SetTupleString.mem t st then ++ read_aux (st, lst) ++ else ++ read_aux (SetTupleString.add t st, t :: lst) ++ | [] -> List.rev lst ++ | _ -> ++ failwithf ++ (f_ "Malformed log file '%s' at line %d") ++ (ctxt.srcfs#string_of_filename default_filename) ++ !line ++ in ++ read_aux (SetTupleString.empty, [])) ++ end else begin ++ [] ++ end - let unregister event data = - if Sys.file_exists default_filename then @@ -7213,11 +7233,6 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - if not !write_something then - Sys.remove default_filename - end -+ let filter ~ctxt events = -+ let st_events = SetString.of_list events in -+ List.filter -+ (fun (e, _) -> SetString.mem e st_events) -+ (load ~ctxt ()) - let filter events = - let st_events = @@ -7230,8 +7245,42 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - List.filter - (fun (e, _) -> SetString.mem e st_events) - (load ()) ++ let register ~ctxt event data = ++ defer_close ++ (ctxt.srcfs#open_out ++ ~mode:[Open_append; Open_creat; Open_text] ++ ~perm:0o644 ++ default_filename) ++ (fun wrtr -> ++ let buf = Buffer.create 13 in ++ Printf.bprintf buf "%S %S\n" event data; ++ wrtr#output buf) ++ - let exists event data = ++ let unregister ~ctxt event data = ++ let lst = load ~ctxt () in ++ let buf = Buffer.create 13 in ++ List.iter ++ (fun (e, d) -> ++ if e <> event || d <> data then ++ Printf.bprintf buf "%S %S\n" e d) ++ lst; ++ if Buffer.length buf > 0 then ++ defer_close ++ (ctxt.srcfs#open_out default_filename) ++ (fun wrtr -> wrtr#output buf) ++ else ++ ctxt.srcfs#remove default_filename ++ ++ ++ let filter ~ctxt events = ++ let st_events = SetString.of_list events in ++ List.filter ++ (fun (e, _) -> SetString.mem e st_events) ++ (load ~ctxt ()) ++ ++ + let exists ~ctxt event data = List.exists (fun v -> (event, data) = v) @@ -7253,7 +7302,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml type t = | BExec (* Executable *) | BExecLib (* Library coming with executable *) -@@ -3672,97 +4597,85 @@ +@@ -3672,97 +4616,85 @@ module BaseBuilt = struct | BObj (* Library *) | BDoc (* Document *) @@ -7405,7 +7454,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let of_executable ffn (cs, bs, exec) = let unix_exec_is, unix_dll_opt = -@@ -3777,22 +4690,23 @@ +@@ -3777,22 +4709,23 @@ module BaseBuilt = struct let evs = (BExec, cs.cs_name, [[ffn unix_exec_is]]) :: @@ -7414,16 +7463,15 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - [BExecLib, cs.cs_name, [[ffn fn]]] - | None -> - []) -- in -- evs, -- unix_exec_is, -- unix_dll_opt + (match unix_dll_opt with + | Some fn -> + [BExecLib, cs.cs_name, [[ffn fn]]] + | None -> + []) -+ in + in +- evs, +- unix_exec_is, +- unix_dll_opt + evs, + unix_exec_is, + unix_dll_opt @@ -7439,7 +7487,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml ~is_native:(bool_of_string (is_native ())) ~has_native_dynlink:(bool_of_string (native_dynlink ())) ~ext_lib:(ext_lib ()) -@@ -3804,7 +4718,7 @@ +@@ -3804,7 +4737,7 @@ module BaseBuilt = struct cs.cs_name, List.map (List.map ffn) unix_lst] in @@ -7448,7 +7496,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let of_object ffn (cs, bs, obj) = -@@ -3812,7 +4726,7 @@ +@@ -3812,7 +4745,7 @@ module BaseBuilt = struct OASISObject.generated_unix_files ~ctxt:!BaseContext.default ~source_file_exists:(fun fn -> @@ -7457,7 +7505,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml ~is_native:(bool_of_string (is_native ())) (cs, bs, obj) in -@@ -3821,18 +4735,20 @@ +@@ -3821,18 +4754,20 @@ module BaseBuilt = struct cs.cs_name, List.map (List.map ffn) unix_lst] in @@ -7480,7 +7528,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let run cmd args extra_args = OASISExec.run ~ctxt:!BaseContext.default ~quote:false (var_expand cmd) -@@ -3840,6 +4756,7 @@ +@@ -3840,43 +4775,44 @@ module BaseCustom = struct var_expand (args @ (Array.to_list extra_args))) @@ -7488,10 +7536,10 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let hook ?(failsafe=false) cstm f e = let optional_command lst = let printer = -@@ -3847,36 +4764,36 @@ + function | Some (cmd, args) -> String.concat " " (cmd :: args) | None -> s_ "No command" - in +- in - match - var_choose - ~name:(s_ "Pre/Post Command") @@ -7511,6 +7559,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - end - | None -> - () ++ in + match + var_choose + ~name:(s_ "Pre/Post Command") @@ -7547,7 +7596,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml open OASISTypes -@@ -3884,96 +4801,91 @@ +@@ -3884,96 +4820,91 @@ module BaseDynVar = struct open BaseEnv open BaseBuilt @@ -7585,6 +7634,9 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - Some (Printf.sprintf - (f_ "Executable '%s' not yet built.") - cs.cs_name))))) +- +- | Library _ | Object _ | Flag _ | Test _ | SrcRepo _ | Doc _ -> +- ()) + | Executable (cs, bs, _) -> + if var_choose bs.bs_build then + var_ignore @@ -7609,9 +7661,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + Some (Printf.sprintf + (f_ "Executable '%s' not yet built.") + cs.cs_name))))) - -- | Library _ | Object _ | Flag _ | Test _ | SrcRepo _ | Doc _ -> -- ()) ++ + | Library _ | Object _ | Flag _ | Test _ | SrcRepo _ | Doc _ -> + ()) pkg.sections @@ -7704,7 +7754,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml end else begin -@@ -3981,110 +4893,111 @@ +@@ -3981,110 +4912,111 @@ module BaseTest = struct (failure, n) end in @@ -7731,11 +7781,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - failwith msg - else - info "%s" msg; -+ if failure_percent > 0.0 then -+ failwith msg -+ else -+ info "%s" msg; - +- - (* Possible explanation why the tests where not run. *) - if OASISVersion.version_0_3_or_after pkg.oasis_version && - not (bool_of_string (BaseStandardVar.tests ())) && @@ -7743,6 +7789,11 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - BaseMessage.warning - "Tests are turned off, consider enabling with \ - 'ocaml setup.ml -configure --enable-tests'" ++ if failure_percent > 0.0 then ++ failwith msg ++ else ++ info "%s" msg; ++ + (* Possible explanation why the tests where not run. *) + if OASISFeatures.package_test OASISFeatures.flag_tests pkg && + not (bool_of_string (BaseStandardVar.tests ())) && @@ -7788,14 +7839,15 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml end in - List.iter one_doc lst; -+ List.iter one_doc lst; - +- - if OASISVersion.version_0_3_or_after pkg.oasis_version && - not (bool_of_string (BaseStandardVar.docs ())) && - lst <> [] then - BaseMessage.warning - "Docs are turned off, consider enabling with \ - 'ocaml setup.ml -configure --enable-docs'" ++ List.iter one_doc lst; ++ + if OASISFeatures.package_test OASISFeatures.flag_docs pkg && + not (bool_of_string (BaseStandardVar.docs ())) && + lst <> [] then @@ -7879,7 +7931,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml (* Associate a plugin function with data from package *) let join_plugin_sections filter_map lst = -@@ -4093,12 +5006,13 @@ +@@ -4093,12 +5025,13 @@ module BaseSetup = struct (fun acc sct -> match filter_map sct with | Some e -> @@ -7895,7 +7947,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml (* Search for plugin data associated with a section name *) let lookup_plugin_section plugin action nm lst = try -@@ -4110,149 +5024,148 @@ +@@ -4110,149 +5043,148 @@ module BaseSetup = struct nm action @@ -7937,9 +7989,9 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml (* Replace data in file *) - BaseFileAB.replace t.package.files_ab + BaseFileAB.replace ~ctxt t.package.files_ab ++ - let build t args = -+ + let build ~ctxt t args = BaseCustom.hook t.package.build_custom @@ -8038,22 +8090,23 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - "-no-doc", - Arg.Set rno_doc, - s_ "Don't run doc target"; -- ++ [ ++ "-no-doc", ++ Arg.Set rno_doc, ++ s_ "Don't run doc target"; + - "-no-test", - Arg.Set rno_test, - s_ "Don't run test target"; - ] - (failwithf (f_ "Don't know what to do with '%s'")) - ""; -+ [ -+ "-no-doc", -+ Arg.Set rno_doc, -+ s_ "Don't run doc target"; -+ + "-no-test", + Arg.Set rno_test, + s_ "Don't run test target"; -+ + +- info "Running configure step"; +- configure t [||]; + "--", + Arg.Rest (fun arg -> arg_rest := arg :: !arg_rest), + s_ "All arguments for configure."; @@ -8061,33 +8114,15 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + (failwithf (f_ "Don't know what to do with '%s'")) + ""; -- info "Running configure step"; -- configure t [||]; -+ info "Running configure step"; -+ configure ~ctxt t (Array.of_list (List.rev !arg_rest)); - - info "Running build step"; - build t [||]; -+ info "Running build step"; -+ build ~ctxt t [||]; ++ info "Running configure step"; ++ configure ~ctxt t (Array.of_list (List.rev !arg_rest)); - (* Load setup.log dynamic variables *) - BaseDynVar.init t.package; -+ (* Load setup.log dynamic variables *) -+ BaseDynVar.init ~ctxt t.package; -+ -+ if not !rno_doc then begin -+ info "Running doc step"; -+ doc ~ctxt t [||] -+ end else begin -+ info "Skipping doc step" -+ end; -+ if not !rno_test then begin -+ info "Running test step"; -+ test ~ctxt t [||] -+ end else begin -+ info "Skipping test step" -+ end ++ info "Running build step"; ++ build ~ctxt t [||]; - if not !rno_doc then - begin @@ -8098,6 +8133,8 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - begin - info "Skipping doc step" - end; ++ (* Load setup.log dynamic variables *) ++ BaseDynVar.init ~ctxt t.package; - if not !rno_test then - begin @@ -8108,8 +8145,18 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - begin - info "Skipping test step" - end -+ let install ~ctxt t args = -+ BaseCustom.hook t.package.install_custom (t.install ~ctxt t.package) args ++ if not !rno_doc then begin ++ info "Running doc step"; ++ doc ~ctxt t [||] ++ end else begin ++ info "Skipping doc step" ++ end; ++ if not !rno_test then begin ++ info "Running test step"; ++ test ~ctxt t [||] ++ end else begin ++ info "Skipping test step" ++ end - let install t args = - BaseCustom.hook @@ -8122,6 +8169,10 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - t.package.uninstall_custom - (t.uninstall t.package) - args ++ let install ~ctxt t args = ++ BaseCustom.hook t.package.install_custom (t.install ~ctxt t.package) args ++ ++ + let uninstall ~ctxt t args = + BaseCustom.hook t.package.uninstall_custom (t.uninstall ~ctxt t.package) args + @@ -8136,7 +8187,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let clean, distclean = let failsafe f a = -@@ -4262,11 +5175,11 @@ +@@ -4262,11 +5194,11 @@ module BaseSetup = struct warning (f_ "Action fail with error: %s") (match e with @@ -8151,7 +8202,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml BaseCustom.hook ~failsafe:true cstm -@@ -4274,45 +5187,32 @@ +@@ -4274,45 +5206,32 @@ module BaseSetup = struct (* Clean section *) List.iter (function @@ -8217,7 +8268,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml t t.package.clean_custom t.clean -@@ -4321,12 +5221,13 @@ +@@ -4321,12 +5240,13 @@ module BaseSetup = struct args in @@ -8233,7 +8284,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml t t.package.distclean_custom t.distclean -@@ -4334,38 +5235,39 @@ +@@ -4334,38 +5254,39 @@ module BaseSetup = struct t.distclean_test args; @@ -8292,7 +8343,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in let oasis_exec = match t.oasis_exec with -@@ -4378,16 +5280,16 @@ +@@ -4378,16 +5299,16 @@ module BaseSetup = struct let setup_ml, args = match Array.to_list Sys.argv with | setup_ml :: args -> @@ -8313,7 +8364,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml "ocaml", "setup.ml" else ocaml, setup_ml -@@ -4398,64 +5300,62 @@ +@@ -4398,64 +5319,62 @@ module BaseSetup = struct OASISExec.run_read_one_line ~ctxt:!BaseContext.default ~f_exit_code: @@ -8432,7 +8483,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in if !update_setup_ml then -@@ -4463,7 +5363,8 @@ +@@ -4463,7 +5382,8 @@ module BaseSetup = struct try match t.oasis_digest with | Some dgst -> @@ -8442,7 +8493,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml begin do_update (); true -@@ -4471,7 +5372,7 @@ +@@ -4471,7 +5391,7 @@ module BaseSetup = struct else false | None -> @@ -8451,7 +8502,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml with e -> error (f_ "Error when updating setup.ml. If you want to avoid this error, \ -@@ -4483,157 +5384,290 @@ +@@ -4483,157 +5403,290 @@ module BaseSetup = struct else false @@ -8707,20 +8758,20 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - else - !act_ref t (Array.of_list (List.rev !extra_args_ref)) + BaseDynVar.init ~ctxt t.package; -+ + +- with e when !catch_exn -> +- error "%s" (Printexc.to_string e); +- exit 1 + if not (t.setup_update && update_setup_ml t) then + !act_ref ~ctxt t (Array.of_list (List.rev !extra_args_ref)) + + with e when !catch_exn -> + error "%s" (Printexc.to_string e); + exit 1 - -- with e when !catch_exn -> -- error "%s" (Printexc.to_string e); -- exit 1 - - end - ++ ++ ++end ++ +module BaseCompat = struct +(* # 22 "src/base/BaseCompat.ml" *) + @@ -8813,8 +8864,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + } + in + Original.setup t' - --# 4611 "setup.ml" ++ + end + + let adapt_setup_t setup_t = @@ -8855,10 +8905,11 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + struct + include Compat_0_4 + end -+ -+end -+ -+ + + end + + +-# 4611 "setup.ml" +# 5662 "setup.ml" module InternalConfigurePlugin = struct -# 21 "/home/gildor/programmation/oasis/src/plugins/internal/InternalConfigurePlugin.ml" @@ -8873,7 +8924,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml open BaseEnv open OASISTypes -@@ -4641,24 +5675,14 @@ +@@ -4641,24 +5694,14 @@ module InternalConfigurePlugin = struct open OASISGettext open BaseMessage @@ -8905,7 +8956,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let add_errors fmt = Printf.kbprintf -@@ -4677,29 +5701,29 @@ +@@ -4677,29 +5720,29 @@ module InternalConfigurePlugin = struct let check_tools lst = List.iter (function @@ -8958,7 +9009,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml lst in -@@ -4723,39 +5747,39 @@ +@@ -4723,39 +5766,39 @@ module InternalConfigurePlugin = struct (* Check depends *) List.iter (function @@ -9031,7 +9082,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml bs.bs_build_depends end in -@@ -4767,50 +5791,50 @@ +@@ -4767,50 +5810,50 @@ module InternalConfigurePlugin = struct begin match pkg.ocaml_version with | Some ver_cmp -> @@ -9113,7 +9164,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml (OASISVersion.version_of_string "4.0.0") >= 0 in if ocaml_ge4 then let findlib_lt132 = -@@ -4835,37 +5859,37 @@ +@@ -4835,37 +5878,37 @@ module InternalConfigurePlugin = struct (* Check build depends *) List.iter (function @@ -9173,7 +9224,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml end; (* Check errors *) -@@ -4882,15 +5906,20 @@ +@@ -4882,15 +5925,20 @@ module InternalConfigurePlugin = struct (SetString.cardinal !errors) end @@ -9195,7 +9246,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml open BaseEnv open BaseStandardVar open BaseMessage -@@ -4899,29 +5928,21 @@ +@@ -4899,29 +5947,21 @@ module InternalInstallPlugin = struct open OASISGettext open OASISUtils @@ -9234,7 +9285,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let split_install_command ocamlfind findlib_name meta files = if Sys.os_type = "Win32" then (* Arguments for the first command: *) -@@ -4961,20 +5982,21 @@ +@@ -4961,20 +6001,21 @@ module InternalInstallPlugin = struct | (firsts, others) -> let cmd = args @ firsts in (* Use -add for remaining commands: *) @@ -9263,7 +9314,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml findlib_name (BaseStandardVar.findlib_version ()) in let cmds = split other_args others in -@@ -4985,24 +6007,22 @@ +@@ -4985,24 +6026,22 @@ module InternalInstallPlugin = struct else ["install" :: findlib_name :: meta :: files] @@ -9298,7 +9349,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in let tgt_file = Filename.concat -@@ -5015,20 +6035,48 @@ +@@ -5015,20 +6054,48 @@ module InternalInstallPlugin = struct in (* Create target directory if needed *) OASISFileUtil.mkdir_parent @@ -9353,7 +9404,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let tgtdir = OASISHostPath.of_unix (var_expand tgtdir) in -@@ -5045,7 +6093,7 @@ +@@ -5045,7 +6112,7 @@ module InternalInstallPlugin = struct src; List.iter (fun fn -> @@ -9362,7 +9413,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml fn (fun () -> match tgt_opt with -@@ -5057,146 +6105,158 @@ +@@ -5057,146 +6124,158 @@ module InternalInstallPlugin = struct lst in @@ -9535,6 +9586,15 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - acc - obj.obj_modules - in +- +- let acc = +- (* Get generated files *) +- BaseBuilt.fold +- BaseBuilt.BObj +- cs.cs_name +- (fun acc fn -> fn :: acc) +- acc +- in + let f_data () = + (* Install data associated with the library *) + install_data @@ -9549,13 +9609,15 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + f_data, new_files @ extra_files + in -- let acc = -- (* Get generated files *) -- BaseBuilt.fold -- BaseBuilt.BObj -- cs.cs_name -- (fun acc fn -> fn :: acc) -- acc +- let f_data () = +- (* Install data associated with the object *) +- install_data +- bs.bs_path +- bs.bs_data_files +- (Filename.concat +- (datarootdir ()) +- pkg.name); +- f_data () - in + let files_of_library (f_data, acc) data_lib = + let cs, bs, lib, dn, lib_extra = !lib_hook data_lib in @@ -9579,17 +9641,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + new_files + in + let acc = (dn, new_files) :: acc in - -- let f_data () = -- (* Install data associated with the object *) -- install_data -- bs.bs_path -- bs.bs_data_files -- (Filename.concat -- (datarootdir ()) -- pkg.name); -- f_data () -- in ++ + let f_data () = + (* Install data associated with the library *) + install_data @@ -9652,7 +9704,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in (* Install one group of library *) -@@ -5207,10 +6267,10 @@ +@@ -5207,10 +6286,10 @@ module InternalInstallPlugin = struct match grp with | Container (_, children) -> data_and_files, children @@ -9667,7 +9719,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in List.fold_left install_group_lib_aux -@@ -5219,268 +6279,213 @@ +@@ -5219,268 +6298,213 @@ module InternalInstallPlugin = struct in (* Findlib name of the root library *) @@ -10104,7 +10156,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let ocamlbuildflags = var_define -@@ -5488,6 +6493,7 @@ +@@ -5488,6 +6512,7 @@ module OCamlbuildCommon = struct "ocamlbuildflags" (fun () -> "") @@ -10112,7 +10164,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml (** Fix special arguments depending on environment *) let fix_args args extra_argv = List.flatten -@@ -5497,6 +6503,14 @@ +@@ -5497,6 +6522,14 @@ module OCamlbuildCommon = struct "-classic-display"; "-no-log"; "-no-links"; @@ -10127,7 +10179,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml "-install-lib-dir"; (Filename.concat (standard_library ()) "ocamlbuild") ] -@@ -5509,13 +6523,25 @@ +@@ -5509,13 +6542,25 @@ module OCamlbuildCommon = struct ] else []; @@ -10154,7 +10206,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml if bool_of_string (profile ()) then ["-tag"; "profile"] else -@@ -5526,71 +6552,76 @@ +@@ -5526,71 +6571,76 @@ module OCamlbuildCommon = struct Array.to_list extra_argv; ] @@ -10254,13 +10306,13 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - let build pkg argv = + let cond_targets_hook = ref (fun lst -> lst) -+ ++ + let build ~ctxt args pkg argv = (* Return the filename in build directory *) let in_build_dir fn = Filename.concat -@@ -5603,19 +6634,6 @@ +@@ -5603,19 +6653,6 @@ module OCamlbuildPlugin = struct in_build_dir (OASISHostPath.of_unix fn) in @@ -10280,7 +10332,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let cond_targets = List.fold_left (fun acc -> -@@ -5635,11 +6653,11 @@ +@@ -5635,11 +6672,11 @@ module OCamlbuildPlugin = struct (List.map (List.filter (fun fn -> @@ -10297,7 +10349,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml unix_files)) in -@@ -5667,8 +6685,8 @@ +@@ -5667,8 +6704,8 @@ module OCamlbuildPlugin = struct (List.map (List.filter (fun fn -> @@ -10308,7 +10360,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml unix_files)) in -@@ -5683,10 +6701,8 @@ +@@ -5683,10 +6720,8 @@ module OCamlbuildPlugin = struct | Executable (cs, bs, exec) when var_choose bs.bs_build -> begin @@ -10321,7 +10373,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml in let target ext = -@@ -5696,12 +6712,13 @@ +@@ -5696,12 +6731,13 @@ module OCamlbuildPlugin = struct (OASISUnixPath.chop_extension exec.exec_main_is))^ext in @@ -10338,7 +10390,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml | ev -> ev) evs -@@ -5737,63 +6754,69 @@ +@@ -5737,63 +6773,69 @@ module OCamlbuildPlugin = struct (fun fns -> if not (List.exists OASISFileUtil.file_exists_case fns) then failwithf @@ -10423,9 +10475,9 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + args: args; + run_path: unix_filename; + } -+ - let doc_build path pkg (cs, doc) argv = ++ + let doc_build ~ctxt run _ (cs, _) argv = let index_html = OASISUnixPath.make @@ -10435,7 +10487,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml cs.cs_name^".docdir"; "index.html"; ] -@@ -5802,34 +6825,38 @@ +@@ -5802,34 +6844,38 @@ module OCamlbuildDocPlugin = struct OASISHostPath.make [ build_dir argv; @@ -10453,6 +10505,10 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml - [OASISFileUtil.glob ~ctxt:!BaseContext.default - (Filename.concat tgt_dir glb)]) - ["*.html"; "*.css"] +- +- let doc_clean t pkg (cs, doc) argv = +- run_clean argv; +- BaseBuilt.unregister BaseBuilt.BDoc cs.cs_name + run_ocamlbuild ~ctxt + {run.args with extra = index_html :: run.args.extra} argv; + List.iter @@ -10467,10 +10523,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + let doc_clean ~ctxt _ _ (cs, _) argv = + run_clean ~ctxt argv; + BaseBuilt.unregister ~ctxt BaseBuilt.BDoc cs.cs_name - -- let doc_clean t pkg (cs, doc) argv = -- run_clean argv; -- BaseBuilt.unregister BaseBuilt.BDoc cs.cs_name ++ end @@ -10489,7 +10542,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml test = []; doc = []; install = InternalInstallPlugin.install; -@@ -5844,8 +6871,6 @@ +@@ -5844,8 +6890,6 @@ let setup_t = { oasis_version = "0.3"; ocaml_version = None; @@ -10498,7 +10551,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml version = "0.0.2"; license = OASISLicense.DEP5License -@@ -5853,49 +6878,22 @@ +@@ -5853,49 +6897,22 @@ let setup_t = { OASISLicense.license = "LGPL"; excption = Some "OCaml linking"; @@ -10556,7 +10609,7 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml files_ab = ["src/OCamlifyConfig.ml.ab"]; sections = [ -@@ -5903,8 +6901,8 @@ +@@ -5903,44 +6920,192 @@ let setup_t = ({ cs_name = "ocamlify"; cs_data = PropList.Data.create (); @@ -10567,8 +10620,9 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; -@@ -5912,35 +6910,182 @@ - bs_compiled_object = Byte; + bs_path = "src"; +- bs_compiled_object = Byte; ++ bs_compiled_object = Best; bs_build_depends = []; bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_interface_patterns = @@ -10742,8 +10796,10 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml + }; oasis_fn = Some "_oasis"; - oasis_version = "0.3.1"; +- oasis_digest = Some "n>\223\251\160\250J\198\167_\r\200\174\0231\220"; + oasis_version = "0.4.11"; - oasis_digest = Some "n>\223\251\160\250J\198\167_\r\200\174\0231\220"; ++ oasis_digest = ++ Some "\142\220\214\196\163\254=\249\151\231PH\n\160\r\200"; oasis_exec = None; oasis_setup_args = []; - setup_update = false; @@ -10754,25 +10810,9 @@ diff -u ocamlify-0.0.2/setup.ml ocamlify-update-0.0.2/setup.ml let setup () = BaseSetup.setup setup_t;; -# 5926 "setup.ml" -+# 7088 "setup.ml" ++# 7089 "setup.ml" +let setup_t = BaseCompat.Compat_0_3.adapt_setup_t setup_t +open BaseCompat.Compat_0_3 (* OASIS_STOP *) let () = setup ();; -Common subdirectories: ocamlify-0.0.2/src and ocamlify-update-0.0.2/src -diff -u ocamlify-0.0.2/_tags ocamlify-update-0.0.2/_tags ---- ocamlify-0.0.2/_tags 2013-06-26 06:08:31.000000000 +0800 -+++ ocamlify-update-0.0.2/_tags 2018-05-29 11:10:37.772848294 +0800 -@@ -1,8 +1,9 @@ - # OASIS_START --# DO NOT EDIT (digest: d0ff94eb3e82a4875dd557595bea8eb3) --# Ignore VCS directories, you can use the same kind of rule outside --# OASIS_START/STOP if you want to exclude directories that contains -+# DO NOT EDIT (digest: b0a95a3908a35f1eadb2bb5d7f18ff09) -+# Ignore VCS directories, you can use the same kind of rule outside -+# OASIS_START/STOP if you want to exclude directories that contains - # useless stuff for the build process -+true: annot, bin_annot - <**/.svn>: -traverse - <**/.svn>: not_hygienic - ".bzr": -traverse + diff --git a/ocamlify.spec b/ocamlify.spec index a5ee76d..7ef4937 100644 --- a/ocamlify.spec +++ b/ocamlify.spec @@ -2,7 +2,7 @@ Name: ocamlify Version: 0.0.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Include files in OCaml code License: LGPLv2+ with exceptions @@ -58,6 +58,9 @@ ocaml setup.ml -test %changelog +* Mon Jun 25 2018 Andy Li - 0.0.2-4 +- Update oasis-setup.patch with _oasis CompiledObject set to "best" (RHBZ#1593408). + * Tue May 29 2018 Andy Li - 0.0.2-3 - Apply a patch that contains the new setup.ml generated by OASIS 0.4.11 (RHBZ#1583335).