[Pkg-ocaml-maint-commits] [fieldslib] 01/07: Imported Upstream version 113.33.03

Stéphane Glondu glondu at moszumanska.debian.org
Thu Jul 28 14:58:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

glondu pushed a commit to branch master
in repository fieldslib.

commit c4ca27f1011d2d91942c607b6b8e5f31f5b43f8e
Author: Stephane Glondu <steph at glondu.net>
Date:   Thu Jul 28 16:29:13 2016 +0200

    Imported Upstream version 113.33.03
---
 META.ab                  |   7 ++--
 Makefile                 |   4 +-
 _oasis                   |  37 +++++++++--------
 _tags                    |   2 +-
 install.ml               |   9 +++++
 js-utils/gen_install.ml  | 102 -----------------------------------------------
 js-utils/install_tags.ml |   9 -----
 myocamlbuild.ml          |  25 +++---------
 opam                     |   9 +++--
 9 files changed, 46 insertions(+), 158 deletions(-)

diff --git a/META.ab b/META.ab
index cc7b5d5..477e40b 100644
--- a/META.ab
+++ b/META.ab
@@ -1,7 +1,8 @@
 version = "$(pkg_version)"
 description = "Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values"
 requires = ""
-archive(byte          ) = "fieldslib.cma"
-archive(native        ) = "fieldslib.cmxa"
-archive(native, plugin) = "fieldslib.cmxs"
+archive(byte  ) = "fieldslib.cma"
+archive(native) = "fieldslib.cmxa"
+plugin(byte  ) = "fieldslib.cma"
+plugin(native) = "fieldslib.cmxs"
 exists_if = "fieldslib.cma"
diff --git a/Makefile b/Makefile
index 05e89be..d2e8a9e 100644
--- a/Makefile
+++ b/Makefile
@@ -26,8 +26,8 @@ all: $(SETUP)
 	./$(SETUP) -all $(ALLFLAGS)
 	$(MAKE) $(NAME).install
 
-$(NAME).install: js-utils/gen_install.ml setup.log setup.data
-	ocaml -I js-utils js-utils/gen_install.ml
+$(NAME).install: install.ml setup.log setup.data
+	ocaml -I "$(OCAML_TOPLEVEL_PATH)" install.ml
 
 install: $(NAME).install
 	opam-installer -i --prefix $(PREFIX) $(NAME).install
diff --git a/_oasis b/_oasis
index 6206569..1087e00 100644
--- a/_oasis
+++ b/_oasis
@@ -1,20 +1,23 @@
-OASISFormat:      0.4
-OCamlVersion:     >= 4.02.3
-FindlibVersion:   >= 1.3.2
-Name:             fieldslib
-Version:          113.24.00
-Synopsis:         Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values
-Authors:          Jane Street Group, LLC <opensource at janestreet.com>
-Copyrights:       (C) 2009-2016 Jane Street Group LLC <opensource at janestreet.com>
-Maintainers:      Jane Street Group, LLC <opensource at janestreet.com>
-License:          Apache-2.0
-LicenseFile:      LICENSE.txt
-Homepage:         https://github.com/janestreet/fieldslib
-Plugins:          StdFiles (0.3), DevFiles (0.3), META (0.3)
-XStdFilesAUTHORS: false
-XStdFilesREADME:  false
-BuildTools:       ocamlbuild
-FilesAB:          META.ab
+OASISFormat:           0.4
+OCamlVersion:          >= 4.02.3
+FindlibVersion:        >= 1.3.2
+Name:                  fieldslib
+Version:               113.33.03
+Synopsis:              Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values
+Authors:               Jane Street Group, LLC <opensource at janestreet.com>
+Copyrights:            (C) 2009-2016 Jane Street Group LLC <opensource at janestreet.com>
+Maintainers:           Jane Street Group, LLC <opensource at janestreet.com>
+License:               Apache-2.0
+LicenseFile:           LICENSE.txt
+Homepage:              https://github.com/janestreet/fieldslib
+Plugins:               StdFiles (0.3), DevFiles (0.3)
+XStdFilesAUTHORS:      false
+XStdFilesREADME:       false
+BuildTools:            ocamlbuild
+BetaFeatures:          section_object
+AlphaFeatures:         ocamlbuild_more_args
+XOCamlbuildPluginTags: package(js-build-tools.ocamlbuild_goodies)
+FilesAB:               META.ab
 Description:
   Part of Jane Street’s Core library
   The Core suite of libraries is an industrial strength alternative to
diff --git a/_tags b/_tags
index a50900a..8e250b4 100644
--- a/_tags
+++ b/_tags
@@ -1,7 +1,7 @@
 <**/*.ml{,i}>: warn(-40), no_alias_deps
 <**/*>: thread
 # This prevents the implicit addition of -ppx options by ocamlfind
-<**/*.ml{,i}>: predicate(ppx_driver)
+<**/*>: predicate(custom_ppx)
 <src/*.ml>: for-pack(Fieldslib)
 # OASIS_START
 # OASIS_STOP
diff --git a/install.ml b/install.ml
new file mode 100644
index 0000000..2bc2532
--- /dev/null
+++ b/install.ml
@@ -0,0 +1,9 @@
+#use "topfind";;
+#require "js-build-tools.oasis2opam_install";;
+
+open Oasis2opam_install;;
+
+generate ~package:"fieldslib"
+  [ oasis_lib "fieldslib"
+  ; file "META" ~section:"lib"
+  ]
diff --git a/js-utils/gen_install.ml b/js-utils/gen_install.ml
deleted file mode 100644
index 39db642..0000000
--- a/js-utils/gen_install.ml
+++ /dev/null
@@ -1,102 +0,0 @@
-(* Generate <package>.install from setup.log *)
-
-#use "install_tags.ml"
-
-module String_map = Map.Make(String)
-let string_map_of_list =
-  List.fold_left
-    (fun acc (k, v) ->
-       assert (not (String_map.mem k acc));
-       String_map.add k v acc)
-    String_map.empty
-
-let lines_of_file fn =
-  let ic = open_in fn in
-  let rec loop acc =
-    match input_line ic with
-    | exception End_of_file ->
-      close_in ic;
-      List.rev acc
-    | line ->
-      loop (line :: acc)
-  in
-  loop []
-
-let read_setup_log () =
-  lines_of_file "setup.log"
-  |> List.map (fun line -> Scanf.sscanf line "%S %S" (fun tag arg -> (tag, arg)))
-
-let read_setup_data () =
-  lines_of_file "setup.data"
-  |> List.map (fun line -> Scanf.sscanf line "%[^=]=%S" (fun k v -> (k, v)))
-
-let remove_cwd =
-  let prefix = Sys.getcwd () ^ "/" in
-  let len_prefix = String.length prefix in
-  fun fn ->
-    let len = String.length fn in
-    if len >= len_prefix && String.sub fn 0 len_prefix = prefix then
-      String.sub fn len_prefix (len - len_prefix)
-    else
-      fn
-
-let gen_section oc name files =
-  let pr fmt = Printf.fprintf oc (fmt ^^ "\n") in
-  pr "%s: [" name;
-  List.iter
-    (fun (src, dst) ->
-       let src = remove_cwd src in
-       let dst =
-         match dst with
-         | None -> Filename.basename src
-         | Some fn -> fn
-       in
-       if src = dst then
-         pr "  %S" src
-       else
-         pr "  %S {%S}" src dst)
-    files;
-  pr "]"
-
-let rec filter_log tags log acc =
-  match log with
-  | [] -> acc
-  | (tag, fname) :: rest ->
-    match String_map.find tag tags with
-    | exception Not_found -> filter_log tags rest acc
-    | dst -> filter_log tags rest ((fname, dst) :: acc)
-
-let () =
-  let log = read_setup_log () in
-  let setup_data = read_setup_data () in
-  let ext_dll =
-    match List.assoc "ext_dll" setup_data with
-    | ext -> ext
-    | exception Not_found -> ".so"
-  in
-  let merge name files map =
-    match String_map.find name map with
-    | files' -> String_map.add name (files @ files') map
-    | exception Not_found -> String_map.add name files map
-  in
-  let sections =
-    List.fold_left
-      (fun acc (name, tags, extra_files) ->
-         let tags = string_map_of_list tags in
-         let files = filter_log tags log [] @ extra_files in
-         if name = "lib" then
-           let stubs, others =
-             List.partition
-               (fun (fn, _) -> Filename.check_suffix fn ext_dll)
-               files
-           in
-           merge "lib" others (merge "stublibs" stubs acc)
-         else
-           merge name files acc)
-      String_map.empty sections
-    |> String_map.bindings
-    |> List.filter (fun (_, l) -> l <> [])
-  in
-  let oc = open_out (package_name ^ ".install") in
-  List.iter (fun (name, files) -> gen_section oc name files) sections;
-  close_out oc
diff --git a/js-utils/install_tags.ml b/js-utils/install_tags.ml
deleted file mode 100644
index 515c5ca..0000000
--- a/js-utils/install_tags.ml
+++ /dev/null
@@ -1,9 +0,0 @@
-let package_name = "fieldslib"
-
-let sections =
-  [ ("lib",
-    [ ("built_lib_fieldslib", None)
-    ],
-    [ ("META", None)
-    ])
-  ]
diff --git a/myocamlbuild.ml b/myocamlbuild.ml
index 4688954..326d293 100644
--- a/myocamlbuild.ml
+++ b/myocamlbuild.ml
@@ -2,28 +2,13 @@
 (* OASIS_STOP *)
 # 3 "myocamlbuild.ml"
 
-(* Temporary hacks *)
-let js_hacks = function
-  | After_rules ->
-    rule "Generate a cmxs from a cmxa"
-      ~dep:"%.cmxa"
-      ~prod:"%.cmxs"
-      ~insert:`top
-      (fun env _ ->
-         Cmd (S [ !Options.ocamlopt
-                ; A "-shared"
-                ; A "-linkall"
-                ; A "-I"; A (Pathname.dirname (env "%"))
-                ; A (env "%.cmxa")
-                ; A "-o"
-                ; A (env "%.cmxs")
-            ]));
+module JS = Jane_street_ocamlbuild_goodies
 
-    (* Pass -predicates to ocamldep *)
-    pflag ["ocaml"; "ocamldep"] "predicate" (fun s -> S [A "-predicates"; A s])
-  | _ -> ()
+let dev_mode = true
 
 let () =
   Ocamlbuild_plugin.dispatch (fun hook ->
-    js_hacks hook;
+    JS.alt_cmxs_of_cmxa_rule hook;
+    JS.pass_predicates_to_ocamldep hook;
+    if dev_mode && not Sys.win32 then JS.track_external_deps hook;
     dispatch_default hook)
diff --git a/opam b/opam
index 95979ac..cf1b847 100644
--- a/opam
+++ b/opam
@@ -10,8 +10,9 @@ build: [
   [make]
 ]
 depends: [
-  "ocamlbuild" {build}
-  "oasis"      {build & >= "0.4"}
-  "ocamlfind"  {build & >= "1.3.2"}
+  "ocamlbuild"     {build}
+  "oasis"          {build & >= "0.4"}
+  "ocamlfind"      {build & >= "1.3.2"}
+  "js-build-tools" {build}
 ]
-available: [ ocaml-version >= "4.02.3" ]
+available: [ ocaml-version = "4.02.3" ]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/fieldslib.git



More information about the Pkg-ocaml-maint-commits mailing list