[Pkg-ocaml-maint-commits] [ocamlgraph] 01/04: Imported Upstream version 1.8.5
Mehdi Dogguy
mehdi at moszumanska.debian.org
Sun Apr 27 09:04:36 UTC 2014
This is an automated email from the git hooks/post-receive script.
mehdi pushed a commit to branch master
in repository ocamlgraph.
commit 96da5ed539dce050375265b5afb1217ebfbacb4a
Author: Mehdi Dogguy <mehdi at debian.org>
Date: Sun Apr 27 10:48:53 2014 +0200
Imported Upstream version 1.8.5
---
CHANGES | 10 ++++
Makefile.in | 16 +++++-
configure | 6 +-
configure.in | 6 +-
dgraph/dGraphTreeLayout.ml | 6 +-
dgraph/dGraphTreeModel.ml | 4 +-
src/graphviz.ml | 139 ++++++++++++++++++++++++++++-----------------
src/graphviz.mli | 5 +-
8 files changed, 127 insertions(+), 65 deletions(-)
diff --git a/CHANGES b/CHANGES
index de52adb..7d9d1d3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,14 @@
+version 1.8.5, March 4, 2014
+-----------------------------
+ o Graphviz: reverted to the old API where edges and vertices are
+ given a single style attribute; but such attributes are collected
+ and output in the DOT file into a list (thus allowing multiple style
+ attributes)
+ o fixed issue in ./configure with ocamlfind on Win32.
+ o fixed compilation when laglgnomecanvas is missing (bug introduced in 1.8.4).
+ o fixed more issues with 'make -j'.
+
version 1.8.4, February 4, 2014
-------------------------------
o fixed [Graphml] printer (contributed by Johannes Schauer)
diff --git a/Makefile.in b/Makefile.in
index 1c9e657..9cecdc4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -112,7 +112,7 @@ graph.cmo: $(CMI) $(CMO)
graph.cmx: $(CMI) $(CMX)
$(OCAMLOPT) $(INCLUDES) -pack -o $@ $^
-VERSION=1.8.4
+VERSION=1.8.5
src/version.ml: Makefile
rm -f $@
@@ -239,9 +239,19 @@ $(DGRAPH_DIR)/dgraph.opt: $(CMXA) $(DGRAPH_CMXLIB) \
# without these extra dependencies, building graph.cmx also rebuilds the .cmi
# while graph.cmi may be required at the same time by some .cmo of the
# bytecodes, leading to tentative access to a corrupted graph.cmi.
+
+ifeq (@LABLGNOMECANVAS@,yes)
graph.cmx: | $(DGRAPH_DIR)/dgraph.byte \
$(VIEWER_DIR)/viewgraph.byte \
$(ED_DIR)/editor.byte
+endif
+
+$(CMX): | $(SRCDIR)/blocks.cmo
+
+# No .mli for blocks.ml: so, to avoid clash when generating block.cmi
+# from both ocamlc and ocamlopt, force to fully compile the bytecode library
+# before the native one
+$(SRCDIR)/blocks.cmx: | graph.cmo
# Examples
##########
@@ -446,7 +456,7 @@ endif
doc: $(DOC_CMO)
mkdir -p doc
rm -f doc/*
- $(OCAMLDOC) -d doc -html $(DGRAPH_INCLUDES) $(DOC_SRC)
+ $(OCAMLDOC) -d doc -html $(DGRAPH_INCLUDES) -I lib -I src $(DOC_SRC)
# literate programming
$(NAME).tex: $(DOC_SRC)
@@ -501,7 +511,7 @@ source:
# Build and install the .tar.gz requiered by Frama-C
framac: EXPORTDIR=ocamlgraph
-framac: FTP=$$HOME/frama-c
+framac: FTP=$$HOME/GIT/BRANCHES/master
framac:
mkdir -p export
cd export; rm -rf $(EXPORTDIR)
diff --git a/configure b/configure
index 884a345..1b59d5b 100755
--- a/configure
+++ b/configure
@@ -2249,11 +2249,13 @@ fi
if test "$OCAMLFIND" = "" ; then
echo "No ocamlfind detected"
else
- OCAMLLIB_BY_FINDLIB=`ocamlfind query stdlib | tr -d '\\r'`
+ OCAMLLIB_BY_FINDLIB=`ocamlfind printconf stdlib | tr -d '\\r'`
if test "$OCAMLLIB_BY_FINDLIB" = "$OCAMLLIB" ; then
echo "OCamlfind detected and enabled"
else
- echo "OCamlfind detected but disabled. Standard libraries differ."
+ echo "OCamlfind detected but disabled. Standard libraries differ:"
+ echo " ocamlc: '$OCAMLLIB'"
+ echo " ocamlfind: '$OCAMLLIB_BY_FINDLIB'"
OCAMLFIND=""
fi
fi
diff --git a/configure.in b/configure.in
index fbc437d..cbb3f6f 100644
--- a/configure.in
+++ b/configure.in
@@ -146,11 +146,13 @@ AC_CHECK_PROG(OCAMLFIND,ocamlfind,ocamlfind)
if test "$OCAMLFIND" = "" ; then
echo "No ocamlfind detected"
else
- OCAMLLIB_BY_FINDLIB=`ocamlfind query stdlib | tr -d '\\r'`
+ OCAMLLIB_BY_FINDLIB=`ocamlfind printconf stdlib | tr -d '\\r'`
if test "$OCAMLLIB_BY_FINDLIB" = "$OCAMLLIB" ; then
echo "OCamlfind detected and enabled"
else
- echo "OCamlfind detected but disabled. Standard libraries differ."
+ echo "OCamlfind detected but disabled. Standard libraries differ:"
+ echo " ocamlc: '$OCAMLLIB'"
+ echo " ocamlfind: '$OCAMLLIB_BY_FINDLIB'"
OCAMLFIND=""
fi
fi
diff --git a/dgraph/dGraphTreeLayout.ml b/dgraph/dGraphTreeLayout.ml
index 1a1f52a..1cbe97f 100755
--- a/dgraph/dGraphTreeLayout.ml
+++ b/dgraph/dGraphTreeLayout.ml
@@ -239,7 +239,7 @@ struct
| `Peripheries p -> vattrs.peripheries <- set_if_none vattrs.peripheries p
| `Regular r -> vattrs.regular <- set_if_none vattrs.regular r
| `Shape shape -> vattrs.shape <- set_if_none vattrs.shape shape
- | `Style s -> vattrs.style <- s @ vattrs.style
+ | `Style s -> vattrs.style <- s :: vattrs.style
| `Width w -> vattrs.width <- set_if_none vattrs.width w
| `Fillcolor c ->
vattrs.fillcolor <- set_if_none vattrs.fillcolor
@@ -605,7 +605,7 @@ struct
eattrs.labelfontsize <- set_if_none eattrs.labelfontsize s;
attributes_list_to_eattributes eattrs q
| `Style s :: q ->
- eattrs.style <- s @ eattrs.style;
+ eattrs.style <- s :: eattrs.style;
attributes_list_to_eattributes eattrs q
| (`Arrowhead _ | `Arrowsize _ | `Arrowtail _ | `Comment _ | `Constraint _
| `Headlabel _ | `Headport _ | `Headurl _ | `Labelangle _
@@ -631,7 +631,7 @@ struct
let dgraph_layout_default =
[ `Color 0xFF0000; `Decorate false; `Dir `Forward; `Fontcolor 0x00000;
`Fontname "Sans"; `Fontsize 12; `Label ""; `Labelfontcolor 0x000000;
- `Labelfontname "Sans"; `Labelfontsize 12; `Style [`Solid] ]
+ `Labelfontname "Sans"; `Labelfontsize 12; `Style `Solid ]
in
attributes_list_to_eattributes eattrs
(Tree.default_edge_attributes tree
diff --git a/dgraph/dGraphTreeModel.ml b/dgraph/dGraphTreeModel.ml
index ba2a992..00dab20 100755
--- a/dgraph/dGraphTreeModel.ml
+++ b/dgraph/dGraphTreeModel.ml
@@ -175,13 +175,13 @@ module SubTreeMake(G: Graphviz.GraphWithDotAttrs) = struct
let vertex_attributes v =
let t = tree () in
- if TM.is_ghost_node v t then [ `Style [`Invis] ]
+ if TM.is_ghost_node v t then [ `Style `Invis ]
else G.vertex_attributes (TM.get_graph_vertex v t)
let edge_attributes e =
let t = tree () in
if TM.is_ghost_node (T.E.src e) t || TM.is_ghost_node (T.E.dst e) t then
- [ `Style [`Dashed]; `Dir `None ]
+ [ `Style `Dashed; `Dir `None ]
else
G.edge_attributes
(G.find_edge
diff --git a/src/graphviz.ml b/src/graphviz.ml
index 4b32232..c4038c7 100644
--- a/src/graphviz.ml
+++ b/src/graphviz.ml
@@ -64,6 +64,10 @@ let fprint_string_user ppf s =
(* let s = String.escaped s in*)
fprintf ppf "\"%s\"" s
+let fprint_square_not_empty printer ppf = function
+ | [] -> ()
+ | l -> fprintf ppf " [%a]" printer l
+
type arrow_style =
[ `None | `Normal | `Inv | `Dot | `Odot | `Invdot | `Invodot ]
@@ -80,6 +84,14 @@ let fprint_dir ppf = function
`TopToBottom -> fprintf ppf "TB"
| `LeftToRight -> fprintf ppf "LR"
+type symbseq =
+ | COMMA
+ | SEMI
+
+let fprint_symbseq ppf = function
+ | COMMA -> pp_print_string ppf ","
+ | SEMI -> pp_print_string ppf ";"
+
(** The [ATTRIBUTES] module type defines the interface for the engines. *)
module type ATTRIBUTES = sig
@@ -167,7 +179,8 @@ module CommonAttributes = struct
(** Sets the shape of the node. Default value is [`Ellipse].
[`Polygon (i, f)] draws a polygon with [n] sides and a skewing
of [f]. *)
- | `Style of [ `Rounded | `Filled | `Solid | `Dashed | `Dotted | `Bold | `Invis ] list
+ | `Style of
+ [ `Rounded | `Filled | `Solid | `Dashed | `Dotted | `Bold | `Invis ]
(** Sets the layout style of the node. Several styles may be combined
simultaneously. *)
| `Width of float
@@ -208,7 +221,7 @@ module CommonAttributes = struct
| `Penwidth of float
(** Width of the pen (in points) used to draw the edge. Default value
is [1.0]. *)
- | `Style of [ `Solid | `Dashed | `Dotted | `Bold | `Invis ] list
+ | `Style of [ `Solid | `Dashed | `Dotted | `Bold | `Invis ]
(** Sets the layout style of the edge. Several styles may be combined
simultaneously. *)
]
@@ -242,12 +255,12 @@ module CommonAttributes = struct
| `Polygon (i, f) -> fprintf ppf "polygon, sides=%i, skew=%f" i f
let rec fprint_string_list ppf = function
- [] -> ()
+ | [] -> ()
| [hd] -> fprintf ppf "%s" hd
| hd :: tl -> fprintf ppf "%s,%a" hd fprint_string_list tl
let node_style_str = function
- `Rounded -> "rounded"
+ | `Rounded -> "rounded"
| `Filled -> "filled"
| `Solid -> "solid"
| `Dashed -> "dashed"
@@ -255,6 +268,11 @@ module CommonAttributes = struct
| `Bold -> "bold"
| `Invis -> "invis"
+ let fprint_style_list sep ppf a =
+ fprintf ppf "style=\"%a\"%a@ "
+ fprint_string_list (List.map node_style_str a)
+ fprint_symbseq sep
+
let fprint_vertex ppf = function
| `Color a -> fprintf ppf "color=%a" fprint_color a
| `ColorWithTransparency a ->
@@ -269,7 +287,7 @@ module CommonAttributes = struct
| `Peripheries i -> fprintf ppf "peripheries=%i" i
| `Regular b -> fprintf ppf "regular=%b" b
| `Shape a -> fprintf ppf "shape=%a" fprint_shape a
- | `Style a -> fprintf ppf "style=\"%a\"" fprint_string_list (List.map node_style_str a)
+ | `Style _ -> assert false
| `Width f -> fprintf ppf "width=%f" f
let edge_style_str =
@@ -296,7 +314,40 @@ module CommonAttributes = struct
(* (String.escaped s) *)
| `Labelfontsize i -> fprintf ppf "labelfontsize=%i" i
| `Penwidth f -> fprintf ppf "penwidth=%f" f
- | `Style a -> fprintf ppf "style=\"%a\"" fprint_string_list (List.map edge_style_str a)
+ | `Style _ -> assert false
+
+ let rec filter_style al sl l = match l with
+ | [] -> al, sl
+ | `Style s :: l -> filter_style al (s :: sl) l
+ | a :: l -> filter_style (a :: al) sl l
+
+ (** [fprint_graph_attribute printer ppf list] pretty prints a list of
+ attributes on the formatter [ppf], using the printer [printer] for
+ each attribute. The list appears between brackets and attributes
+ are speparated by ",". If the list is empty, nothing is printed. *)
+ let fprint_attributes fprint_style_list fprint_attribute sep ppf list =
+ if list <> [] then begin
+ let list, styles = filter_style [] [] list in
+ let rec fprint_attributes_rec ppf = function
+ | [] -> ()
+ | hd :: tl ->
+ fprintf ppf "%a%a@ "
+ fprint_attribute hd
+ fprint_symbseq sep;
+ fprint_attributes_rec ppf tl
+ in
+ fprintf ppf "@[<hov>%a" fprint_attributes_rec list;
+ if styles <> [] then begin
+ fprint_style_list sep ppf styles
+ end;
+ fprintf ppf "@]"
+ end
+
+ let fprint_vertex_list =
+ fprint_attributes fprint_style_list fprint_vertex
+
+ let fprint_edge_list =
+ fprint_attributes fprint_style_list fprint_edge
end
@@ -310,8 +361,8 @@ module type ENGINE = sig
module Attributes : sig
include ATTRIBUTES
val fprint_graph:formatter -> graph -> unit
- val fprint_vertex: formatter -> vertex -> unit
- val fprint_edge: formatter -> edge -> unit
+ val fprint_vertex_list: symbseq -> formatter -> vertex list -> unit
+ val fprint_edge_list: symbseq -> formatter -> edge list -> unit
end
(** The litteral name of the engine. *)
@@ -375,34 +426,6 @@ struct
fprintf ppf "%a;@ " EN.Attributes.fprint_graph att
) list
- (** [fprint_graph_attribute printer ppf list] pretty prints a list of
- attributes on the formatter [ppf], using the printer [printer] for
- each attribute. The list appears between brackets and attributes
- are speparated by ",". If the list is empty, nothing is printed. *)
- let fprint_attributes fprint_attribute ppf = function
- [] -> ()
- | hd :: tl ->
- let rec fprint_attributes_rec ppf = function
- [] -> ()
- | hd' :: tl' ->
- fprintf ppf ",@ %a%a"
- fprint_attribute hd'
- fprint_attributes_rec tl'
- in
- fprintf ppf " [@[<hov>%a%a@]]"
- fprint_attribute hd
- fprint_attributes_rec tl
-
- (** [fprint_graph_attributes ppf list] pretty prints a list of
- node attributes using the format of [fprint_attributes]. *)
- let fprint_node_attributes ppf list =
- fprint_attributes EN.Attributes.fprint_vertex ppf list
-
- (** [fprint_graph_attributes ppf list] pretty prints a list of
- edge attributes using the format of [fprint_attributes]. *)
- let fprint_edge_attributes ppf list =
- fprint_attributes EN.Attributes.fprint_edge ppf list
-
(** [fprint_graph ppf graph] pretty prints the graph [graph] in
the CGL language on the formatter [ppf]. *)
let fprint_graph ppf graph =
@@ -414,8 +437,8 @@ struct
let print_nodes ppf =
let default_node_attributes = X.default_vertex_attributes graph in
if default_node_attributes <> [] then
- fprintf ppf "node%a;@ "
- fprint_node_attributes
+ fprintf ppf "node%a;@ "
+ (fprint_square_not_empty (EN.Attributes.fprint_vertex_list COMMA))
default_node_attributes;
X.iter_vertex
@@ -433,7 +456,7 @@ struct
end;
fprintf ppf "%s%a;@ "
(X.vertex_name node)
- fprint_node_attributes
+ (fprint_square_not_empty (EN.Attributes.fprint_vertex_list COMMA))
(X.vertex_attributes node)
)
graph
@@ -447,17 +470,13 @@ struct
| name :: worklist ->
let sg, nodes = SG.find name !subgraphs in
let children = SG.filter (fun n (sg, nodes) -> sg.EN.Attributes.sg_parent = Some name) !subgraphs in
- fprintf ppf "@[<v 2>subgraph cluster_%s { %t%t@ %t };@]@\n"
-
+ fprintf ppf "@[<v 2>subgraph cluster_%s { %a%t@ %t };@]@\n"
+
name
-
- (fun ppf ->
- (List.iter
- (fun n -> fprintf ppf "%a;@\n" EN.Attributes.fprint_vertex n)
- sg.EN.Attributes.sg_attributes
- )
- )
-
+
+ (EN.Attributes.fprint_vertex_list SEMI)
+ sg.EN.Attributes.sg_attributes
+
(fun ppf ->
(List.iter (fun n -> fprintf ppf "%s;" (X.vertex_name n)) nodes)
)
@@ -481,14 +500,16 @@ struct
let default_edge_attributes = X.default_edge_attributes graph in
if default_edge_attributes <> [] then
fprintf ppf "edge%a;@ "
- fprint_edge_attributes default_edge_attributes;
+ (fprint_square_not_empty (EN.Attributes.fprint_edge_list COMMA))
+ default_edge_attributes;
X.iter_edges_e (function edge ->
fprintf ppf "%s %s %s%a;@ "
(X.vertex_name (X.E.src edge))
EN.edge_arrow
(X.vertex_name (X.E.dst edge))
- fprint_edge_attributes (X.edge_attributes edge)
+ (fprint_square_not_empty (EN.Attributes.fprint_edge_list COMMA))
+ (X.edge_attributes edge)
) graph
in
@@ -736,6 +757,14 @@ module DotAttributes = struct
| `Tailurl s -> fprintf ppf "tailURL=%a" fprint_string s
| `Weight i -> fprintf ppf "weight=%i" i
+ let fprint_vertex_list =
+ CommonAttributes.fprint_attributes
+ CommonAttributes.fprint_style_list fprint_vertex
+
+ let fprint_edge_list =
+ CommonAttributes.fprint_attributes
+ CommonAttributes.fprint_style_list fprint_edge
+
end
(** Graph modules with dot attributes *)
@@ -844,6 +873,14 @@ module NeatoAttributes = struct
| `Len f -> fprintf ppf "len=%f" f
| `Weight f -> fprintf ppf "weight=%f" f
+ let fprint_vertex_list =
+ CommonAttributes.fprint_attributes
+ CommonAttributes.fprint_style_list fprint_vertex
+
+ let fprint_edge_list =
+ CommonAttributes.fprint_attributes
+ CommonAttributes.fprint_style_list fprint_edge
+
end
module Neato =
diff --git a/src/graphviz.mli b/src/graphviz.mli
index 26ea28e..5992f46 100644
--- a/src/graphviz.mli
+++ b/src/graphviz.mli
@@ -142,7 +142,8 @@ module CommonAttributes : sig
(** Sets the shape of the vertex. Default value is [`Ellipse].
[`Polygon (i, f)] draws a polygon with [n] sides and a skewing
of [f]. *)
- | `Style of [ `Rounded | `Filled | `Solid | `Dashed | `Dotted | `Bold | `Invis ] list
+ | `Style of
+ [ `Rounded | `Filled | `Solid | `Dashed | `Dotted | `Bold | `Invis ]
(** Sets the layout style of the vertex.
Several styles may be combined simultaneously. *)
| `Width of float
@@ -183,7 +184,7 @@ module CommonAttributes : sig
| `Penwidth of float
(** Width of the pen (in points) used to draw the edge. Default value
is [1.0]. *)
- | `Style of [ `Solid | `Dashed | `Dotted | `Bold | `Invis ] list
+ | `Style of [ `Solid | `Dashed | `Dotted | `Bold | `Invis ]
(** Sets the layout style of the edge. Several styles may be combined
simultaneously. *)
]
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/ocamlgraph.git
More information about the Pkg-ocaml-maint-commits
mailing list