Skip to content

Commit

Permalink
Merge pull request #19 from djs55/cohttp.0.12.0-api
Browse files Browse the repository at this point in the history
Cohttp.0.12.0 api
  • Loading branch information
djs55 committed Nov 5, 2014
2 parents 351ac92 + 408960d commit 0bdafc5
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 144 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.7.6 (2014-11-04)
* Upgrade to cohttp 0.12.0 API

0.7.5 (2014-06-03)
* Upgrade to cohttp 0.10
* Fix incorrect handling of tar file prefixes
Expand Down
6 changes: 3 additions & 3 deletions _oasis
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
OASISFormat: 0.3
Name: vhd-tool
Version: 0.7.5
Version: 0.7.6
Synopsis: .vhd file manipulation
Authors: Jonathan Ludlam and David Scott
License: LGPL-2.1 with OCaml linking exception
Expand All @@ -16,7 +16,7 @@ Executable "vhd-tool"
MainIs: main.ml
Custom: true
Install: false
BuildDepends: lwt, lwt.unix, vhd-format, vhd-format.lwt, cmdliner, nbd, nbd.lwt, uri, cohttp (>= 0.10.0), cohttp.lwt, tar, sha, sha.sha1, io-page.unix, re.str
BuildDepends: lwt, lwt.unix, vhd-format, vhd-format.lwt, cmdliner, nbd, nbd.lwt, uri, cohttp (>= 0.12.0), cohttp.lwt, tar, sha, sha.sha1, io-page.unix, re.str

Executable "sparse_dd"
Build$: flag(xenserver)
Expand All @@ -25,4 +25,4 @@ Executable "sparse_dd"
MainIs: sparse_dd.ml
Custom: true
Install: false
BuildDepends: lwt, lwt.unix, vhd-format, vhd-format.lwt, cmdliner, nbd, nbd.lwt, uri, cohttp (>= 0.10.0), cohttp.lwt, xenstore, xenstore.client, xenstore.unix, xenstore_transport, xenstore_transport.unix, threads, tapctl, xcp, sha, sha.sha1, tar, io-page.unix, re.str
BuildDepends: lwt, lwt.unix, vhd-format, vhd-format.lwt, cmdliner, nbd, nbd.lwt, uri, cohttp (>= 0.12.0), cohttp.lwt, xenstore, xenstore.client, xenstore.unix, xenstore_transport, xenstore_transport.unix, threads, tapctl, xcp, sha, sha.sha1, tar, io-page.unix, re.str
49 changes: 25 additions & 24 deletions _tags
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# OASIS_START
# DO NOT EDIT (digest: f3e306cb3822f9fd188eb6bf627dd3ca)
# DO NOT EDIT (digest: 87e2609bb063ea0c0d4d7f9df6cc22d2)
# 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
Expand Down Expand Up @@ -54,29 +55,29 @@
<src/sparse_dd.{native,byte}>: pkg_xenstore.unix
<src/sparse_dd.{native,byte}>: pkg_xenstore_transport
<src/sparse_dd.{native,byte}>: pkg_xenstore_transport.unix
<src/*.ml{,i}>: pkg_cmdliner
<src/*.ml{,i}>: pkg_cohttp
<src/*.ml{,i}>: pkg_cohttp.lwt
<src/*.ml{,i}>: pkg_io-page.unix
<src/*.ml{,i}>: pkg_lwt
<src/*.ml{,i}>: pkg_lwt.unix
<src/*.ml{,i}>: pkg_nbd
<src/*.ml{,i}>: pkg_nbd.lwt
<src/*.ml{,i}>: pkg_re.str
<src/*.ml{,i}>: pkg_sha
<src/*.ml{,i}>: pkg_sha.sha1
<src/*.ml{,i}>: pkg_tapctl
<src/*.ml{,i}>: pkg_tar
<src/*.ml{,i}>: pkg_threads
<src/*.ml{,i}>: pkg_uri
<src/*.ml{,i}>: pkg_vhd-format
<src/*.ml{,i}>: pkg_vhd-format.lwt
<src/*.ml{,i}>: pkg_xcp
<src/*.ml{,i}>: pkg_xenstore
<src/*.ml{,i}>: pkg_xenstore.client
<src/*.ml{,i}>: pkg_xenstore.unix
<src/*.ml{,i}>: pkg_xenstore_transport
<src/*.ml{,i}>: pkg_xenstore_transport.unix
<src/*.ml{,i,y}>: pkg_cmdliner
<src/*.ml{,i,y}>: pkg_cohttp
<src/*.ml{,i,y}>: pkg_cohttp.lwt
<src/*.ml{,i,y}>: pkg_io-page.unix
<src/*.ml{,i,y}>: pkg_lwt
<src/*.ml{,i,y}>: pkg_lwt.unix
<src/*.ml{,i,y}>: pkg_nbd
<src/*.ml{,i,y}>: pkg_nbd.lwt
<src/*.ml{,i,y}>: pkg_re.str
<src/*.ml{,i,y}>: pkg_sha
<src/*.ml{,i,y}>: pkg_sha.sha1
<src/*.ml{,i,y}>: pkg_tapctl
<src/*.ml{,i,y}>: pkg_tar
<src/*.ml{,i,y}>: pkg_threads
<src/*.ml{,i,y}>: pkg_uri
<src/*.ml{,i,y}>: pkg_vhd-format
<src/*.ml{,i,y}>: pkg_vhd-format.lwt
<src/*.ml{,i,y}>: pkg_xcp
<src/*.ml{,i,y}>: pkg_xenstore
<src/*.ml{,i,y}>: pkg_xenstore.client
<src/*.ml{,i,y}>: pkg_xenstore.unix
<src/*.ml{,i,y}>: pkg_xenstore_transport
<src/*.ml{,i,y}>: pkg_xenstore_transport.unix
<src/sparse_dd.{native,byte}>: custom
# OASIS_STOP
<src/chunked.ml>: syntax_camlp4o, pkg_cstruct.syntax
Expand Down
88 changes: 51 additions & 37 deletions myocamlbuild.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* OASIS_START *)
(* DO NOT EDIT (digest: 5a9a2168dcb86db37476d58b8c0e25b3) *)
(* DO NOT EDIT (digest: 2b686a81cec9fb16d1640bda36a68fbd) *)
module OASISGettext = struct
(* # 22 "src/oasis/OASISGettext.ml" *)

Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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. *)
Expand All @@ -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
Expand All @@ -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. *)
Expand Down Expand Up @@ -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 *)
Expand Down Expand Up @@ -580,25 +592,27 @@ 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 =
{MyOCamlbuildBase.lib_ocaml = []; lib_c = []; flags = []; includes = []}
;;

let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}

let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;

# 603 "myocamlbuild.ml"
# 617 "myocamlbuild.ml"
(* OASIS_STOP *)
Ocamlbuild_plugin.dispatch dispatch_default;;
27 changes: 27 additions & 0 deletions opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
opam-version: "1"
maintainer: "dave.scott@eu.citrix.com"
tags: [
"org:mirage"
"org:xapi-project"
]
build: [
["./configure" "--bindir=%{bin}%"]
[make]
[make "install"]
]
remove: [[make "uninstall"]]
depends: [
"ocamlfind"
"lwt" {>= "2.4.3"}
"cstruct" {>= "1.0.1"}
"vhd-format" {>= "0.7.0"}
"uuidm"
"cmdliner"
"nbd" {>= "1.0.1"}
"ounit"
"uri"
"tar-format"
"sha"
"cohttp" {>="0.12.0"}
"ssl"
]
Loading

0 comments on commit 0bdafc5

Please sign in to comment.