Skip to content

Commit

Permalink
Rename Install_printer to Uri_top to prevent conflict with other …
Browse files Browse the repository at this point in the history
…libraries with similar name

Closes mirage#24
  • Loading branch information
avsm committed Sep 5, 2013
1 parent ee50ac8 commit 54008e7
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 372 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.3.10 (2013-09-05):
* Rename `Install_printer` to `Uri_top` to prevent conflict with other libraries with similar name (#24).

1.3.9 (2013-08-30):
* Add back support for OCaml 3.12.1 by fixing the compiler-libs linking.

Expand Down
4 changes: 2 additions & 2 deletions _oasis
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
OASISFormat: 0.3
Name: uri
Version: 1.3.9
Version: 1.3.10
Synopsis: RFC3968 URI parsing library
Description: Uniform Resource Identifier (URI) parsing and encoding.
This is pure OCaml code.
Expand Down Expand Up @@ -40,7 +40,7 @@ Library uri_top
Path: top
FindlibName: top
FindlibParent: uri
Modules: Install_printers
Modules: Uri_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
Expand Down
10 changes: 5 additions & 5 deletions lib/META
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OASIS_START
# DO NOT EDIT (digest: e4750bd8a3fd1cc7b166d5ed18e00018)
version = "1.3.9"
# DO NOT EDIT (digest: 3ded089e23f47608c18d891b7e7f2daf)
version = "1.3.10"
description = "RFC3968 URI parsing library"
requires = "re.posix re.str"
archive(byte) = "uri.cma"
Expand All @@ -9,7 +9,7 @@ archive(native) = "uri.cmxa"
archive(native, plugin) = "uri.cmxs"
exists_if = "uri.cma"
package "top" (
version = "1.3.9"
version = "1.3.10"
description = "Toplevel printers for URIs"
requires = "uri"
archive(byte) = "uri_top.cma"
Expand All @@ -20,7 +20,7 @@ package "top" (
)

package "services_full" (
version = "1.3.9"
version = "1.3.10"
description = "RFC3968 URI parsing library"
requires = "uri"
archive(byte) = "services_full.cma"
Expand All @@ -31,7 +31,7 @@ package "services_full" (
)

package "services" (
version = "1.3.9"
version = "1.3.10"
description = "RFC3968 URI parsing library"
requires = "uri"
archive(byte) = "services.cma"
Expand Down
70 changes: 20 additions & 50 deletions myocamlbuild.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(* OASIS_START *)
(* DO NOT EDIT (digest: e2e9156747579fc14f33fe1e5dc8f121) *)
(* DO NOT EDIT (digest: 82bc88bfb20ee1a14fe59bccc93bc93a) *)
module OASISGettext = struct
(* # 21 "src/oasis/OASISGettext.ml" *)

Expand Down Expand Up @@ -234,21 +234,19 @@ module MyOCamlbuildFindlib = struct
Ocamlbuild_pack.Lexers.blank_sep_strings

let split s ch =
let buf = Buffer.create 13 in
let x = ref [] in
let flush () =
x := (Buffer.contents buf) :: !x;
Buffer.clear buf
let x =
ref []
in
String.iter
(fun c ->
if c = ch then
flush ()
else
Buffer.add_char buf c)
s;
flush ();
List.rev !x
let rec go s =
let pos =
String.index s ch
in
x := (String.before s pos)::!x;
go (String.after s (pos + 1))
in
try
go s
with Not_found -> !x

let split_nl s = split s '\n'

Expand Down Expand Up @@ -283,27 +281,17 @@ module MyOCamlbuildFindlib = struct

(* When one link an OCaml library/binary/package, one should use -linkpkg *)
flag ["ocaml"; "link"; "program"] & A"-linkpkg";
flag ["ocaml"; "link"; "output_obj"] & 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
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"
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;
flag ["ocaml"; "compile"; "pkg_"^pkg] & S[A"-package"; A pkg];
flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S[A"-package"; A pkg];
flag ["ocaml"; "doc"; "pkg_"^pkg] & S[A"-package"; A pkg];
flag ["ocaml"; "link"; "pkg_"^pkg] & S[A"-package"; A pkg];
flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S[A"-package"; A pkg];
end
(find_packages ());

Expand Down Expand Up @@ -464,24 +452,6 @@ module MyOCamlbuildBase = struct
)
t.lib_c;

(* Add output_obj rules mapped to .nobj.o *)
let native_output_obj x =
OC.link_gen "cmx" "cmxa" !Options.ext_lib [!Options.ext_obj; "cmi"]
OC.ocamlopt_link_prog
(fun tags -> tags++"ocaml"++"link"++"native"++"output_obj") x
in
rule "ocaml: cmx* and o* -> .nobj.o" ~prod:"%.nobj.o" ~deps:["%.cmx"; "%.o"]
(native_output_obj "%.cmx" "%.nobj.o");

(* Add output_obj rules mapped to .bobj.o *)
let bytecode_output_obj x =
OC.link_gen "cmo" "cma" !Options.ext_lib [!Options.ext_obj; "cmi"]
OC.ocamlc_link_prog
(fun tags -> tags++"ocaml"++"link"++"byte"++"output_obj") x
in
rule "ocaml: cmo* -> .nobj.o" ~prod:"%.bobj.o" ~deps:["%.cmo"]
(bytecode_output_obj "%.cmo" "%.bobj.o");

(* Add flags *)
List.iter
(fun (tags, cond_specs) ->
Expand All @@ -503,7 +473,7 @@ module MyOCamlbuildBase = struct
end


# 506 "myocamlbuild.ml"
# 476 "myocamlbuild.ml"
open Ocamlbuild_plugin;;
let package_default =
{
Expand All @@ -522,7 +492,7 @@ let package_default =

let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;

# 526 "myocamlbuild.ml"
# 496 "myocamlbuild.ml"
(* OASIS_STOP *)

let () =
Expand Down
Loading

0 comments on commit 54008e7

Please sign in to comment.