[Pkg-ocaml-maint-commits] [ocaml-ipaddr] 01/07: Imported Upstream version 2.7.0
Stéphane Glondu
glondu at moszumanska.debian.org
Mon Aug 8 07:32:55 UTC 2016
This is an automated email from the git hooks/post-receive script.
glondu pushed a commit to branch master
in repository ocaml-ipaddr.
commit 8ccc56a1c85aa05391177ba4d52b651ffa5c7c44
Author: Stephane Glondu <steph at glondu.net>
Date: Fri Jul 22 13:18:47 2016 +0200
Imported Upstream version 2.7.0
---
.travis.yml | 22 ++++--
CHANGES | 7 ++
LICENSE | 14 ++++
_oasis | 8 +-
_tags | 22 +++---
lib/META | 8 +-
lib/ipaddr.ml | 29 +++++---
lib/ipaddr.mli | 36 ++++++---
lib/macaddr.ml | 2 +-
lib/macaddr.mli | 4 +-
lib_test/test_ipaddr.ml | 21 ++++++
myocamlbuild.ml | 98 ++++++++++++------------
opam | 4 +-
setup.ml | 194 ++++++++++++++++++++++++++++--------------------
14 files changed, 294 insertions(+), 175 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index d3ac3fe..78c64bf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,19 @@
language: c
-install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-opam.sh
-script: bash -ex .travis-opam.sh
+sudo: false
+services:
+ - docker
+install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-docker.sh
+script: bash ./.travis-docker.sh
env:
- - OCAML_VERSION=3.12 PACKAGE=ipaddr
- - OCAML_VERSION=4.01 PACKAGE=ipaddr
- - OCAML_VERSION=latest PACKAGE=ipaddr
+ global:
+ - PACKAGE="ipaddr"
+ matrix:
+ - DISTRO=debian-stable OCAML_VERSION=4.02.3
+ - DISTRO=debian-testing OCAML_VERSION=4.02.3
+ - DISTRO=debian-unstable OCAML_VERSION=4.02.3
+ - DISTRO=ubuntu-12.04 OCAML_VERSION=4.02.3
+ - DISTRO=ubuntu-15.10 OCAML_VERSION=4.02.3
+ - DISTRO=ubuntu-16.04 OCAML_VERSION=4.02.3
+ - DISTRO=centos-6 OCAML_VERSION=4.02.3
+ - DISTRO=centos-7 OCAML_VERSION=4.02.3
+ - DISTRO=fedora-23 OCAML_VERSION=4.02.3
diff --git a/CHANGES b/CHANGES
index 063d1e9..a01e381 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+2.7.0 (2016-02-14):
+* Remove sexplib.syntax, type_conv deps and camlp4 transitive dependency
+* Add ppx_sexp_conv dependency
+* Require OCaml 4.02.2+
+* Add `Ipaddr.Prefix.subset`, `Ipaddr.V4.Prefix.subset` and `Ipaddr.V6.subset`
+ predicates to test containment of subnets (#52 from @seliopou)
+
2.6.1 (2015-02-20):
* Fix findlib requires in oasis to restore pre-4.02.1 compatibility
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..0693f08
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,14 @@
+Copyright (c) 2013-2015 David Sheets <sheets at alum.mit.edu>
+Copyright (c) 2010-2011, 2014 Anil Madhavapeddy <anil at recoil.org>
+
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/_oasis b/_oasis
index 9c193d8..0231aca 100644
--- a/_oasis
+++ b/_oasis
@@ -1,6 +1,6 @@
OASISFormat: 0.3
Name: ipaddr
-Version: 2.6.0
+Version: 2.7.0
Synopsis: A library for manipulation of IP (and MAC) address representations
Authors: David Sheets, Anil Madhavapeddy, Hugo Heuzard
License: ISC
@@ -18,7 +18,7 @@ Flag top
Library ipaddr
Path: lib
Findlibname: ipaddr
- BuildDepends: bytes, sexplib, sexplib.syntax
+ BuildDepends: bytes, sexplib, ppx_sexp_conv
XMETARequires: bytes, sexplib
Modules: Ipaddr, Macaddr
NativeOpt: -w @f at p@u at s@40
@@ -38,9 +38,7 @@ Library ipaddr_top
FindlibName: top
FindlibParent: ipaddr
Modules: Ipaddr_top
- # Compiler libs do not exists for OCaml < 4.0.0 and otherwise always
- # present. Use _tags to set them up.
- # BuildDepends: compiler-libs.toplevel
+ BuildDepends: compiler-libs.toplevel
XMETARequires: ipaddr
XMETADescription: Toplevel printers for IP addresses
diff --git a/_tags b/_tags
index 0131ff0..66315cb 100644
--- a/_tags
+++ b/_tags
@@ -1,8 +1,9 @@
# OASIS_START
-# DO NOT EDIT (digest: ca6d0ca33b49d735e479caedbeb4ec59)
+# DO NOT EDIT (digest: 719b5d7cccee3f039d0e30bd2f4bfafb)
# 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
@@ -16,18 +17,19 @@
# Library ipaddr
"lib/ipaddr.cmxs": use_ipaddr
<lib/ipaddr.{cma,cmxa}>: oasis_library_ipaddr_byte
-<lib/*.ml{,i}>: oasis_library_ipaddr_byte
+<lib/*.ml{,i,y}>: oasis_library_ipaddr_byte
<lib/ipaddr.{cma,cmxa}>: oasis_library_ipaddr_native
-<lib/*.ml{,i}>: oasis_library_ipaddr_native
+<lib/*.ml{,i,y}>: oasis_library_ipaddr_native
# Library ipaddr_unix
"lib/ipaddr_unix.cmxs": use_ipaddr_unix
-<lib/*.ml{,i}>: pkg_bytes
-<lib/*.ml{,i}>: pkg_sexplib
-<lib/*.ml{,i}>: pkg_sexplib.syntax
-<lib/*.ml{,i}>: pkg_unix
-<lib/*.ml{,i}>: use_ipaddr
+<lib/*.ml{,i,y}>: pkg_bytes
+<lib/*.ml{,i,y}>: pkg_ppx_sexp_conv
+<lib/*.ml{,i,y}>: pkg_sexplib
+<lib/*.ml{,i,y}>: pkg_unix
+<lib/*.ml{,i,y}>: use_ipaddr
# Library ipaddr_top
"top/ipaddr_top.cmxs": use_ipaddr_top
+<top/*.ml{,i,y}>: pkg_compiler-libs.toplevel
# OASIS_STOP
-true: debug, annot, bin_annot, principal, safe_string
-<top/*.ml>: I(+compiler-libs)
+true: debug, principal, safe_string
+
diff --git a/lib/META b/lib/META
index 59082bf..58a1773 100644
--- a/lib/META
+++ b/lib/META
@@ -1,6 +1,6 @@
# OASIS_START
-# DO NOT EDIT (digest: 41ee21d4146b5d6f59aa1b873b633a48)
-version = "2.6.0"
+# DO NOT EDIT (digest: 8c04de6f0f6daada35021ac6a5a08e4a)
+version = "2.7.0"
description =
"A library for manipulation of IP (and MAC) address representations"
requires = "bytes sexplib"
@@ -10,7 +10,7 @@ archive(native) = "ipaddr.cmxa"
archive(native, plugin) = "ipaddr.cmxs"
exists_if = "ipaddr.cma"
package "unix" (
- version = "2.6.0"
+ version = "2.7.0"
description =
"A library for manipulation of IP (and MAC) address representations"
requires = "unix ipaddr"
@@ -22,7 +22,7 @@ package "unix" (
)
package "top" (
- version = "2.6.0"
+ version = "2.7.0"
description = "Toplevel printers for IP addresses"
requires = "ipaddr"
archive(byte) = "ipaddr_top.cma"
diff --git a/lib/ipaddr.ml b/lib/ipaddr.ml
index 064c2d4..5806704 100644
--- a/lib/ipaddr.ml
+++ b/lib/ipaddr.ml
@@ -17,7 +17,7 @@
open Sexplib.Std
-exception Parse_error of string * string with sexp
+exception Parse_error of string * string [@@deriving sexp]
type scope =
| Point
@@ -27,7 +27,7 @@ type scope =
| Site
| Organization
| Global
-with sexp
+[@@deriving sexp]
let (~|) = Int32.of_int
let (|~) = Int32.to_int
@@ -237,8 +237,8 @@ module V4 = struct
let routers = make 224 0 0 2
module Prefix = struct
- type addr = t with sexp
- type t = addr * int with sexp
+ type addr = t [@@deriving sexp]
+ type t = addr * int [@@deriving sexp]
let compare (pre,sz) (pre',sz') =
let c = compare pre pre' in
@@ -315,6 +315,9 @@ module V4 = struct
let mem ip (pre,sz) = let host = 32 - sz in (ip >|> host) = (pre >|> host)
+ let subset ~subnet:(pre1,sz1) ~network:(pre2,sz2) =
+ sz1 >= sz2 && mem pre1 (pre2,sz2)
+
let of_addr ip = make 32 ip
let global = make 0 (ip 0 0 0 0)
@@ -688,8 +691,8 @@ module V6 = struct
let site_routers = make 0xff05 0 0 0 0 0 0 2
module Prefix = struct
- type addr = t with sexp
- type t = addr * int with sexp
+ type addr = t [@@deriving sexp]
+ type t = addr * int [@@deriving sexp]
let compare (pre,sz) (pre',sz') =
let c = compare pre pre' in
@@ -772,6 +775,9 @@ module V6 = struct
let m = mask sz in
logand ip m = logand pre m
+ let subset ~subnet:(pre1,sz1) ~network:(pre2,sz2) =
+ sz1 >= sz2 && mem pre1 (pre2,sz2)
+
let of_addr ip = make 128 ip
let global_unicast_001 = make 3 (ip 0x2000 0 0 0 0 0 0 0)
@@ -829,8 +835,8 @@ module V6 = struct
let is_private i = (scope i) <> Global
end
-type ('v4,'v6) v4v6 = V4 of 'v4 | V6 of 'v6 with sexp
-type t = (V4.t,V6.t) v4v6 with sexp
+type ('v4,'v6) v4v6 = V4 of 'v4 | V6 of 'v6 [@@deriving sexp]
+type t = (V4.t,V6.t) v4v6 [@@deriving sexp]
let compare a b = match a,b with
| V4 a, V4 b -> V4.compare a b
@@ -909,8 +915,8 @@ module Prefix = struct
let to_v6 = to_v6
end
- type addr = t with sexp
- type t = (V4.Prefix.t,V6.Prefix.t) v4v6 with sexp
+ type addr = t [@@deriving sexp]
+ type t = (V4.Prefix.t,V6.Prefix.t) v4v6 [@@deriving sexp]
let compare a b = match a,b with
| V4 a , V4 b -> V4.Prefix.compare a b
@@ -953,6 +959,9 @@ module Prefix = struct
let mem ip prefix = V6.Prefix.mem (Addr.to_v6 ip) (to_v6 prefix)
+ let subset ~subnet ~network =
+ V6.Prefix.subset ~subnet:(to_v6 subnet) ~network:(to_v6 network)
+
let of_addr = function
| V4 p -> V4 (V4.Prefix.of_addr p)
| V6 p -> V6 (V6.Prefix.of_addr p)
diff --git a/lib/ipaddr.mli b/lib/ipaddr.mli
index 339dcf4..07ef3f1 100644
--- a/lib/ipaddr.mli
+++ b/lib/ipaddr.mli
@@ -18,7 +18,7 @@
(** A library for manipulation of IP address representations. *)
(** Raised when parsing of IP address syntax fails. *)
-exception Parse_error of string * string with sexp
+exception Parse_error of string * string [@@deriving sexp]
(** Type of ordered address scope classifications *)
type scope =
@@ -29,12 +29,12 @@ type scope =
| Site
| Organization
| Global
-with sexp
+[@@deriving sexp]
(** A collection of functions for IPv4 addresses. *)
module V4 : sig
(** Type of the internet protocol v4 address of a host *)
- type t with sexp
+ type t [@@deriving sexp]
val compare : t -> t -> int
(** Converts the low bytes of four int values into an abstract {! V4.t }. *)
@@ -140,10 +140,10 @@ module V4 : sig
(** A module for manipulating IPv4 network prefixes. *)
module Prefix : sig
- type addr = t with sexp
+ type addr = t [@@deriving sexp]
(** Type of a internet protocol subnet *)
- type t with sexp
+ type t [@@deriving sexp]
val compare : t -> t -> int
@@ -207,6 +207,10 @@ module V4 : sig
(** [mem ip subnet] checks whether [ip] is found within [subnet]. *)
val mem : addr -> t -> bool
+ (** [subset ~subnet ~network] checks whether [subnet] is contained
+ within [network]. *)
+ val subset : subnet:t -> network:t -> bool
+
(** [of_addr ip] create a subnet composed of only one address, [ip].
It is the same as [make 32 ip]. *)
val of_addr : addr -> t
@@ -277,7 +281,7 @@ end
(** A collection of functions for IPv6 addresses. *)
module V6 : sig
(** Type of the internet protocol v6 address of a host *)
- type t with sexp
+ type t [@@deriving sexp]
val compare : t -> t -> int
(** Converts the low bytes of eight int values into an abstract
@@ -389,10 +393,10 @@ module V6 : sig
(** A module for manipulating IPv6 network prefixes. *)
module Prefix : sig
- type addr = t with sexp
+ type addr = t [@@deriving sexp]
(** Type of a internet protocol subnet *)
- type t with sexp
+ type t [@@deriving sexp]
val compare : t -> t -> int
@@ -456,6 +460,10 @@ module V6 : sig
(** [mem ip subnet] checks whether [ip] is found within [subnet]. *)
val mem : addr -> t -> bool
+ (** [subset ~subnet ~network] checks whether [subnet] is contained
+ within [network]. *)
+ val subset : subnet:t -> network:t -> bool
+
(** [of_addr ip] create a subnet composed of only one address, [ip].
It is the same as [make 128 ip]. *)
val of_addr : addr -> t
@@ -521,10 +529,10 @@ module V6 : sig
end
(** Type of either an IPv4 value or an IPv6 value *)
-type ('v4,'v6) v4v6 = V4 of 'v4 | V6 of 'v6 with sexp
+type ('v4,'v6) v4v6 = V4 of 'v4 | V6 of 'v6 [@@deriving sexp]
(** Type of any IP address *)
-type t = (V4.t,V6.t) v4v6 with sexp
+type t = (V4.t,V6.t) v4v6 [@@deriving sexp]
val compare : t -> t -> int
@@ -591,10 +599,10 @@ val multicast_to_mac : t -> Macaddr.t
val to_domain_name : t -> string list
module Prefix : sig
- type addr = t with sexp
+ type addr = t [@@deriving sexp]
(** Type of a internet protocol subnet *)
- type t = (V4.Prefix.t, V6.Prefix.t) v4v6 with sexp
+ type t = (V4.Prefix.t, V6.Prefix.t) v4v6 [@@deriving sexp]
val compare : t -> t -> int
@@ -638,6 +646,10 @@ module Prefix : sig
(** [mem ip subnet] checks whether [ip] is found within [subnet]. *)
val mem : addr -> t -> bool
+ (** [subset ~subnet ~network] checks whether [subnet] is contained
+ within [network]. *)
+ val subset : subnet:t -> network:t -> bool
+
(** [of_addr ip] create a subnet composed of only one address, [ip].*)
val of_addr : addr -> t
diff --git a/lib/macaddr.ml b/lib/macaddr.ml
index 6c3ca14..f7b4fc4 100644
--- a/lib/macaddr.ml
+++ b/lib/macaddr.ml
@@ -17,7 +17,7 @@
open Sexplib.Std
-exception Parse_error of string * string with sexp
+exception Parse_error of string * string [@@deriving sexp]
let need_more x = Parse_error ("not enough data", x)
diff --git a/lib/macaddr.mli b/lib/macaddr.mli
index ba40c56..1eb55e9 100644
--- a/lib/macaddr.mli
+++ b/lib/macaddr.mli
@@ -17,10 +17,10 @@
(** A library for manipulation of MAC address representations. *)
(** Raised when parsing of MAC address syntax fails. *)
-exception Parse_error of string * string with sexp
+exception Parse_error of string * string [@@deriving sexp]
(** Type of the hardware address (MAC) of an ethernet interface. *)
-type t with sexp
+type t [@@deriving sexp]
val compare : t -> t -> int
diff --git a/lib_test/test_ipaddr.ml b/lib_test/test_ipaddr.ml
index 91bcd0d..7a532d6 100644
--- a/lib_test/test_ipaddr.ml
+++ b/lib_test/test_ipaddr.ml
@@ -700,11 +700,32 @@ let test_prefix_mem () =
assert_equal ~msg (Prefix.mem addr subnet) is_mem
) ships
+let test_prefix_subset () =
+ let pre = Prefix.of_string_exn in
+ let ships = [
+ pre "10.0.0.1/32", pre "10.0.0.1/32", true;
+ pre "10.0.0.1/32", pre "10.0.0.2/32", false;
+ pre "10.0.0.3/32", pre "10.0.0.2/31", true;
+ pre "10.0.0.2/31", pre "10.0.0.3/32", false;
+ pre "10.0.10.0/24", V4 V4.Prefix.private_10, true;
+ V4 V4.Prefix.private_10, pre "10.0.10.0/24", false;
+ ] in
+ List.iter (fun (subnet1,subnet2,is_subset) ->
+ let msg = Printf.sprintf "%s is%s subset of %s"
+ (Prefix.to_string subnet1)
+ (if is_subset then "" else " not")
+ (Prefix.to_string subnet2)
+ in
+ assert_equal ~msg
+ (Prefix.subset ~subnet:subnet1 ~network:subnet2) is_subset
+ ) ships
+
let suite = "Test Generic Addresses" >::: [
"string_raw_rt" >:: test_string_raw_rt;
"string_raw_rt_bad" >:: test_string_raw_rt_bad;
"map" >:: test_map;
"prefix_mem" >:: test_prefix_mem;
+ "prefix_subset" >:: test_prefix_subset;
]
;;
diff --git a/myocamlbuild.ml b/myocamlbuild.ml
index 1ec7aa0..9636c6c 100644
--- a/myocamlbuild.ml
+++ b/myocamlbuild.ml
@@ -1,5 +1,5 @@
(* OASIS_START *)
-(* DO NOT EDIT (digest: bad12c52d2295e9705af01fa611f2526) *)
+(* DO NOT EDIT (digest: 4eccf75c2466be915e1695e831bfd9af) *)
module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.ml" *)
@@ -249,6 +249,9 @@ module MyOCamlbuildFindlib = struct
*)
open Ocamlbuild_plugin
+ type conf =
+ { no_automatic_syntax: bool;
+ }
(* these functions are not really officially exported *)
let run_and_read =
@@ -315,7 +318,7 @@ module MyOCamlbuildFindlib = struct
(* This lists all supported packages. *)
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"))
(* Mock to list available syntaxes. *)
@@ -338,7 +341,7 @@ module MyOCamlbuildFindlib = struct
]
- let dispatch =
+ let dispatch conf =
function
| After_options ->
(* By using Before_options one let command line options have an higher
@@ -357,31 +360,39 @@ module MyOCamlbuildFindlib = struct
* -linkpkg *)
flag ["ocaml"; "link"; "program"] & A"-linkpkg";
- (* For each ocamlfind package one inject the -package option when
- * compiling, computing dependencies, generating documentation and
- * linking. *)
- List.iter
- begin fun pkg ->
- let base_args = [A"-package"; A pkg] in
- (* TODO: consider how to really choose camlp4o or camlp4r. *)
- let syn_args = [A"-syntax"; A "camlp4o"] in
- let args =
- (* Heuristic to identify syntax extensions: whether they end in
- ".syntax"; some might not.
- *)
- if Filename.check_suffix pkg "syntax" ||
- List.mem pkg well_known_syntax then
- syn_args @ base_args
- else
- base_args
- in
- flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
- flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
- flag ["ocaml"; "doc"; "pkg_"^pkg] & S args;
- flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args;
- flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
- end
- (find_packages ());
+ if not (conf.no_automatic_syntax) then begin
+ (* For each ocamlfind package one inject the -package option when
+ * compiling, computing dependencies, generating documentation and
+ * linking. *)
+ List.iter
+ begin fun pkg ->
+ let base_args = [A"-package"; A pkg] in
+ (* TODO: consider how to really choose camlp4o or camlp4r. *)
+ let syn_args = [A"-syntax"; A "camlp4o"] in
+ let (args, pargs) =
+ (* Heuristic to identify syntax extensions: whether they end in
+ ".syntax"; some might not.
+ *)
+ if Filename.check_suffix pkg "syntax" ||
+ List.mem pkg well_known_syntax then
+ (syn_args @ base_args, syn_args)
+ else
+ (base_args, [])
+ in
+ flag ["ocaml"; "compile"; "pkg_"^pkg] & S args;
+ flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S args;
+ flag ["ocaml"; "doc"; "pkg_"^pkg] & S args;
+ flag ["ocaml"; "link"; "pkg_"^pkg] & S base_args;
+ flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S args;
+
+ (* TODO: Check if this is allowed for OCaml < 3.12.1 *)
+ flag ["ocaml"; "compile"; "package("^pkg^")"] & S pargs;
+ flag ["ocaml"; "ocamldep"; "package("^pkg^")"] & S pargs;
+ flag ["ocaml"; "doc"; "package("^pkg^")"] & S pargs;
+ flag ["ocaml"; "infer_interface"; "package("^pkg^")"] & S pargs;
+ end
+ (find_packages ());
+ end;
(* Like -package but for extensions syntax. Morover -syntax is useless
* when linking. *)
@@ -546,12 +557,13 @@ module MyOCamlbuildBase = struct
(* When ocaml link something that use the C library, then one
need that file to be up to date.
+ This holds both for programs and for libraries.
*)
- dep ["link"; "ocaml"; "program"; tag_libstubs lib]
- [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
+ dep ["link"; "ocaml"; tag_libstubs lib]
+ [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
- dep ["compile"; "ocaml"; "program"; tag_libstubs lib]
- [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
+ dep ["compile"; "ocaml"; tag_libstubs lib]
+ [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)];
(* TODO: be more specific about what depends on headers *)
(* Depends on .h files *)
@@ -580,18 +592,18 @@ module MyOCamlbuildBase = struct
()
- let dispatch_default t =
+ let dispatch_default conf t =
dispatch_combine
[
dispatch t;
- MyOCamlbuildFindlib.dispatch;
+ MyOCamlbuildFindlib.dispatch conf;
]
end
-# 594 "myocamlbuild.ml"
+# 606 "myocamlbuild.ml"
open Ocamlbuild_plugin;;
let package_default =
{
@@ -621,16 +633,10 @@ let package_default =
}
;;
-let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
+let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}
+
+let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;
-# 627 "myocamlbuild.ml"
+# 641 "myocamlbuild.ml"
(* OASIS_STOP *)
-let () =
- let additional_rules = function
- | After_rules ->
- pflag ["compile"; "ocaml"] "I" (fun x -> S [A "-I"; A x]);
- | _ -> ()
- in
- Ocamlbuild_plugin.dispatch
- (MyOCamlbuildBase.dispatch_combine
- [MyOCamlbuildBase.dispatch_default package_default; additional_rules])
+Ocamlbuild_plugin.dispatch dispatch_default;;
diff --git a/opam b/opam
index 0ee6905..5dc731a 100644
--- a/opam
+++ b/opam
@@ -30,8 +30,10 @@ remove: [
]
depends: [
"ocamlfind" {build}
+ "ocamlbuild" {build}
"base-bytes"
"sexplib"
- "type_conv"
+ "ppx_sexp_conv"
"ounit" {test}
]
+available: [ ocaml-version >= "4.02.2" ]
diff --git a/setup.ml b/setup.ml
index d9ad49c..61e06cd 100644
--- a/setup.ml
+++ b/setup.ml
@@ -1,9 +1,9 @@
(* setup.ml generated for the first time by OASIS v0.4.1 *)
(* OASIS_START *)
-(* DO NOT EDIT (digest: 90b714c94abc1fe7e83f38515fbe8e31) *)
+(* DO NOT EDIT (digest: d67af977feb974c0fe5a1e05a2d2c645) *)
(*
- Regenerated by OASIS v0.4.4
+ Regenerated by OASIS v0.4.5
Visit http://oasis.forge.ocamlcore.org for more information and
documentation about functions used in this file.
*)
@@ -242,11 +242,9 @@ module OASISString = struct
let replace_chars f s =
- let buf = String.make (String.length s) 'X' in
- for i = 0 to String.length s - 1 do
- buf.[i] <- f s.[i]
- done;
- buf
+ let buf = Buffer.create (String.length s) in
+ String.iter (fun c -> Buffer.add_char buf (f c)) s;
+ Buffer.contents buf
end
@@ -1729,6 +1727,13 @@ module OASISFeatures = struct
(fun () ->
s_ "Allows the OASIS section comments and digest 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).")
end
module OASISUnixPath = struct
@@ -2099,16 +2104,6 @@ module OASISLibrary = struct
lst
in
- (* The headers that should be compiled along *)
- let headers =
- if lib.lib_pack then
- []
- else
- find_modules
- lib.lib_modules
- "cmi"
- in
-
(* The .cmx that be compiled along *)
let cmxs =
let should_be_built =
@@ -2134,12 +2129,32 @@ module OASISLibrary = struct
[]
in
+ (* The headers and annot/cmt files that should be compiled along *)
+ let headers =
+ let sufx =
+ if lib.lib_pack
+ then [".cmti"; ".cmt"; ".annot"]
+ else [".cmi"; ".cmti"; ".cmt"; ".annot"]
+ in
+ List.map
+ begin
+ List.fold_left
+ begin fun accu s ->
+ let dot = String.rindex s '.' in
+ let base = String.sub s 0 dot in
+ List.map ((^) base) sufx @ accu
+ end
+ []
+ end
+ (find_modules lib.lib_modules "cmi")
+ in
+
(* Compute what libraries should be built *)
let acc_nopath =
(* Add the packed header file if required *)
let add_pack_header acc =
if lib.lib_pack then
- [cs.cs_name^".cmi"] :: acc
+ [cs.cs_name^".cmi"; cs.cs_name^".cmti"; cs.cs_name^".cmt"] :: acc
else
acc
in
@@ -2499,13 +2514,13 @@ module OASISFindlib = struct
in
let library_name_of_findlib_name =
- Lazy.lazy_from_fun
- (fun () ->
- (* Revert findlib_name_of_library_name. *)
- MapString.fold
- (fun k v mp -> MapString.add v k mp)
- fndlb_name_of_lib_name
- MapString.empty)
+ lazy begin
+ (* Revert findlib_name_of_library_name. *)
+ MapString.fold
+ (fun k v mp -> MapString.add v k mp)
+ fndlb_name_of_lib_name
+ MapString.empty
+ end
in
let library_name_of_findlib_name fndlb_nm =
try
@@ -2875,7 +2890,7 @@ module OASISFileUtil = struct
end
-# 2878 "setup.ml"
+# 2893 "setup.ml"
module BaseEnvLight = struct
(* # 22 "src/base/BaseEnvLight.ml" *)
@@ -2980,7 +2995,7 @@ module BaseEnvLight = struct
end
-# 2983 "setup.ml"
+# 2998 "setup.ml"
module BaseContext = struct
(* # 22 "src/base/BaseContext.ml" *)
@@ -5391,7 +5406,7 @@ module BaseSetup = struct
end
-# 5394 "setup.ml"
+# 5409 "setup.ml"
module InternalConfigurePlugin = struct
(* # 22 "src/plugins/internal/InternalConfigurePlugin.ml" *)
@@ -5827,6 +5842,17 @@ module InternalInstallPlugin = struct
lst
in
+ let make_fnames modul sufx =
+ List.fold_right
+ begin fun sufx accu ->
+ (String.capitalize modul ^ sufx) ::
+ (String.uncapitalize modul ^ sufx) ::
+ accu
+ end
+ sufx
+ []
+ in
+
(** Install all libraries *)
let install_libs pkg =
@@ -5847,27 +5873,29 @@ module InternalInstallPlugin = struct
OASISHostPath.of_unix bs.bs_path
in
List.fold_left
- (fun acc modul ->
- try
- List.find
- OASISFileUtil.file_exists_case
- (List.map
- (Filename.concat path)
- [modul^".mli";
- modul^".ml";
- String.uncapitalize modul^".mli";
- String.capitalize modul^".mli";
- String.uncapitalize modul^".ml";
- String.capitalize modul^".ml"])
- :: acc
- with Not_found ->
- begin
- warning
- (f_ "Cannot find source header for module %s \
- in library %s")
- modul cs.cs_name;
- acc
- end)
+ begin fun acc modul ->
+ begin
+ try
+ [List.find
+ OASISFileUtil.file_exists_case
+ (List.map
+ (Filename.concat path)
+ (make_fnames modul [".mli"; ".ml"]))]
+ with Not_found ->
+ warning
+ (f_ "Cannot find source header for module %s \
+ in library %s")
+ modul cs.cs_name;
+ []
+ end
+ @
+ List.filter
+ OASISFileUtil.file_exists_case
+ (List.map
+ (Filename.concat path)
+ (make_fnames modul [".annot";".cmti";".cmt"]))
+ @ acc
+ end
acc
lib.lib_modules
in
@@ -5915,27 +5943,29 @@ module InternalInstallPlugin = struct
OASISHostPath.of_unix bs.bs_path
in
List.fold_left
- (fun acc modul ->
- try
- List.find
- OASISFileUtil.file_exists_case
- (List.map
- (Filename.concat path)
- [modul^".mli";
- modul^".ml";
- String.uncapitalize modul^".mli";
- String.capitalize modul^".mli";
- String.uncapitalize modul^".ml";
- String.capitalize modul^".ml"])
- :: acc
- with Not_found ->
- begin
- warning
- (f_ "Cannot find source header for module %s \
- in object %s")
- modul cs.cs_name;
- acc
- end)
+ begin fun acc modul ->
+ begin
+ try
+ [List.find
+ OASISFileUtil.file_exists_case
+ (List.map
+ (Filename.concat path)
+ (make_fnames modul [".mli"; ".ml"]))]
+ with Not_found ->
+ warning
+ (f_ "Cannot find source header for module %s \
+ in object %s")
+ modul cs.cs_name;
+ []
+ end
+ @
+ List.filter
+ OASISFileUtil.file_exists_case
+ (List.map
+ (Filename.concat path)
+ (make_fnames modul [".annot";".cmti";".cmt"]))
+ @ acc
+ end
acc
obj.obj_modules
in
@@ -6240,7 +6270,7 @@ module InternalInstallPlugin = struct
end
-# 6243 "setup.ml"
+# 6273 "setup.ml"
module OCamlbuildCommon = struct
(* # 22 "src/plugins/ocamlbuild/OCamlbuildCommon.ml" *)
@@ -6298,6 +6328,11 @@ module OCamlbuildCommon = struct
else
[];
+ if bool_of_string (tests ()) then
+ ["-tag"; "tests"]
+ else
+ [];
+
if bool_of_string (profile ()) then
["-tag"; "profile"]
else
@@ -6613,7 +6648,7 @@ module OCamlbuildDocPlugin = struct
end
-# 6616 "setup.ml"
+# 6651 "setup.ml"
module CustomPlugin = struct
(* # 22 "src/plugins/custom/CustomPlugin.ml" *)
@@ -6761,7 +6796,7 @@ module CustomPlugin = struct
end
-# 6764 "setup.ml"
+# 6799 "setup.ml"
open OASISTypes;;
let setup_t =
@@ -6816,7 +6851,7 @@ let setup_t =
alpha_features = [];
beta_features = [];
name = "ipaddr";
- version = "2.6.0";
+ version = "2.7.0";
license =
OASISLicense.DEP5License
(OASISLicense.DEP5Unit
@@ -6905,7 +6940,7 @@ let setup_t =
[
FindlibPackage ("bytes", None);
FindlibPackage ("sexplib", None);
- FindlibPackage ("sexplib.syntax", None)
+ FindlibPackage ("ppx_sexp_conv", None)
];
bs_build_tools = [ExternalTool "ocamlbuild"];
bs_c_sources = [];
@@ -6980,7 +7015,8 @@ let setup_t =
bs_install = [(OASISExpr.EBool true, true)];
bs_path = "top";
bs_compiled_object = Best;
- bs_build_depends = [];
+ bs_build_depends =
+ [FindlibPackage ("compiler-libs.toplevel", None)];
bs_build_tools = [ExternalTool "ocamlbuild"];
bs_c_sources = [];
bs_data_files = [];
@@ -7029,8 +7065,8 @@ let setup_t =
plugin_data = []
};
oasis_fn = Some "_oasis";
- oasis_version = "0.4.4";
- oasis_digest = Some "ex\027k\201\006S;\144\164\190\024\173\210%`";
+ oasis_version = "0.4.5";
+ oasis_digest = Some "��Y]r\004\029�d�\030$Щ\140\146";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false
@@ -7038,6 +7074,6 @@ let setup_t =
let setup () = BaseSetup.setup setup_t;;
-# 7042 "setup.ml"
+# 7078 "setup.ml"
(* OASIS_STOP *)
let () = setup ();;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/ocaml-ipaddr.git
More information about the Pkg-ocaml-maint-commits
mailing list