View | Details | Raw Unified | Return to bug 210789
Collapse All | Expand All

(-)devel/monotone-viz/Makefile (-15 / +40 lines)
Lines 3-39 Link Here
3
3
4
PORTNAME=	monotone-viz
4
PORTNAME=	monotone-viz
5
PORTVERSION=	1.0.2
5
PORTVERSION=	1.0.2
6
PORTREVISION=	6
6
PORTREVISION=	7
7
CATEGORIES=	devel
7
CATEGORIES=	devel
8
MASTER_SITES=	http://oandrieu.nerim.net/monotone-viz/
8
MASTER_SITES=	http://oandrieu.nerim.net/monotone-viz/
9
9
10
PATCH_SITES=	DEBIAN_POOL
11
PATCHFILES=	${PORTNAME}_${PORTVERSION}-4.diff.gz
12
PATCH_DIST_STRIP=	-p1
13
10
MAINTAINER=	ports@FreeBSD.org
14
MAINTAINER=	ports@FreeBSD.org
11
COMMENT=	Visual interface for Monotone VCS with revision graphs
15
COMMENT=	Visual interface for Monotone VCS with revision graphs
12
16
13
LICENSE=	GPLv2
17
LICENSE=	GPLv2+
14
LICENSE_FILE=	${WRKSRC}/COPYING
18
LICENSE_FILE=	${WRKSRC}/COPYING
15
19
16
BROKEN=		fails to build
20
BUILD_DEPENDS=	xpmtoppm:graphics/netpbm \
17
DEPRECATED=	Broken for more than 6 months
21
		lablgtk2:x11-toolkits/ocaml-lablgtk2
18
EXPIRATION_DATE=	2016-07-04
22
RUN_DEPENDS=	mtn:devel/monotone \
19
23
		dot:graphics/graphviz \
20
BUILD_DEPENDS=	lablgtk2:x11-toolkits/ocaml-lablgtk2
24
		bash:shells/bash \
21
RUN_DEPENDS+=	dot:graphics/graphviz \
22
		mtn:devel/monotone \
23
		lablgtk2:x11-toolkits/ocaml-lablgtk2
25
		lablgtk2:x11-toolkits/ocaml-lablgtk2
24
26
25
USES=		gmake
26
USE_OCAML=	yes
27
USE_OCAML=	yes
27
USE_OCAML_CAMLP4=yes
28
USE_OCAML_CAMLP4=	yes
28
GNU_CONFIGURE=	yes
29
CONFIGURE_ARGS+=	--without-local-lablgtk
30
29
31
ALL_TARGET=
30
USES=		gmake
31
GNU_CONFIGURE=	yes
32
CONFIGURE_ARGS=	--without-local-lablgtk
33
ALL_TARGET=	monotone-viz
32
MAKE_JOBS_UNSAFE=	yes
34
MAKE_JOBS_UNSAFE=	yes
33
35
34
PLIST_FILES=	bin/monotone-viz
36
PLIST_FILES=	bin/monotone-viz share/pixmaps/monotone-viz.png
37
38
DESKTOP_ENTRIES="Monotone-viz" "" "monotone-viz" "monotone-viz" \
39
		"Development;RevisionControl;GTK;" ""
40
41
post-patch:
42
.for i in 10-new-stdio.diff 20-dot-rankdir.diff 50-ocaml-4.02.2.diff
43
	@${CAT} ${WRKSRC}/debian/patches/${i} | \
44
		${PATCH} -d ${WRKSRC} -p1 --quiet
45
.endfor
46
	@${REINPLACE_CMD} -e \
47
		's|"/bin/bash"|"${LOCALBASE}/bin/bash"|' ${WRKSRC}/agraph.ml
48
49
post-build:
50
	@(cd ${WRKDIR} && ${SED} -e \
51
		's/^(\(\* XPM \*\))$$/\/\1\// ; \
52
		 s/^let \(monotone_xpm\) = \[|$$/static char * \1[] = {/ ; \
53
		 s/";$$/",/ ; \
54
		 s/|\]$$/};/ ; \
55
		 /GdkPixbuf/d' ${WRKSRC}/icon.ml | \
56
		xpmtoppm --alphaout=icon.pgm | pnmtopng --alpha=icon.pgm > \
57
		monotone-viz.png)
35
58
36
post-install:
59
post-install:
60
	(cd ${WRKDIR} && ${INSTALL_DATA} monotone-viz.png \
61
		${STAGEDIR}${PREFIX}/share/pixmaps)
37
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/monotone-viz
62
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/monotone-viz
38
63
39
.include <bsd.port.mk>
64
.include <bsd.port.mk>
(-)devel/monotone-viz/distinfo (+2 lines)
Lines 1-2 Link Here
1
SHA256 (monotone-viz-1.0.2.tar.gz) = 404ee47378b144a62eb2dcdfb80430e68d193360216d120977a457cdbf85b7f6
1
SHA256 (monotone-viz-1.0.2.tar.gz) = 404ee47378b144a62eb2dcdfb80430e68d193360216d120977a457cdbf85b7f6
2
SIZE (monotone-viz-1.0.2.tar.gz) = 545631
2
SIZE (monotone-viz-1.0.2.tar.gz) = 545631
3
SHA256 (monotone-viz_1.0.2-4.diff.gz) = aed1582e303395790f4b2f3d9a2838d98440f5e3c307e8222d7015fe72fd1bda
4
SIZE (monotone-viz_1.0.2-4.diff.gz) = 11922
(-)devel/monotone-viz/files/patch-Makefile (-2 / +2 lines)
Lines 1-5 Link Here
1
--- Makefile.orig	2009-12-08 00:43:26.000000000 +0100
1
--- Makefile.orig	2009-12-07 23:43:26 UTC
2
+++ Makefile	2010-12-01 12:44:12.000000000 +0100
2
+++ Makefile
3
@@ -105,7 +105,7 @@ PP = $(if $(findstring $(1),$(USE_P4)),-
3
@@ -105,7 +105,7 @@ PP = $(if $(findstring $(1),$(USE_P4)),-
4
 	cd $(<D) ; $(OCAMLC) $(CINCDIRS) $(if $(CPPFLAGS),-ccopt "$(CPPFLAGS)") $(<F)
4
 	cd $(<D) ; $(OCAMLC) $(CINCDIRS) $(if $(CPPFLAGS),-ccopt "$(CPPFLAGS)") $(<F)
5
 
5
 
(-)devel/monotone-viz/files/patch-agraph.ml (-29 lines)
Lines 1-29 Link Here
1
--- agraph.ml.orig	2007-03-07 22:53:54.000000000 +0100
2
+++ agraph.ml	2010-08-25 13:13:33.000000000 +0200
3
@@ -50,8 +50,9 @@ let dot_format params agraph =
4
       agraph.nodes in
5
 
6
   !+ "digraph \"monotone-viz\"\n{\n" ;
7
-  if params.lr_layout then
8
-    !+ "  graph [rankdir=LR] ;\n" ;
9
+  if params.lr_layout
10
+  then  !+ "  graph [rankdir=LR] ;\n"
11
+  else  !+ "  graph [rankdir=BT] ;\n" ;
12
   !+ "  graph [ranksep=\"0.25\"] ;\n" ;
13
   !+ "  node [label=\"\"] ;\n" ;
14
   
15
@@ -222,11 +223,11 @@ let spawn_dot graph status done_cb =
16
   let dot_prg = graph.layout_params.dot_program in
17
   let cmd = 
18
     if Viz_misc.debug "dot"
19
-    then [ "/bin/sh" ; "-c" ; 
20
+    then [ "/usr/local/bin/bash" ; "-c" ; 
21
 	   Printf.sprintf 
22
 	     "set -o pipefail ; \
23
-              tee agraph.in.dot | %s -q -y -s%.0f | tee agraph.out.dot" dot_prg ppi ]
24
-    else [ dot_prg ; "-q" ; "-y" ; Printf.sprintf "-s%.0f" ppi ] in
25
+              tee agraph.in.dot | %s -q -s%.0f | tee agraph.out.dot" dot_prg ppi ]
26
+    else [ dot_prg ; "-q" ; Printf.sprintf "-s%.0f" ppi ] in
27
   let error fmt =
28
     Printf.kprintf (fun s -> done_cb (`LAYOUT_ERROR s)) fmt in
29
   try
(-)devel/monotone-viz/files/patch-automate.ml (-124 lines)
Lines 1-124 Link Here
1
--- automate.ml.orig	2010-11-05 11:14:53.000000000 +0100
2
+++ automate.ml	2010-11-05 11:14:55.000000000 +0100
3
@@ -44,7 +44,7 @@ type output = [
4
   | `OUTPUT       of string
5
   | `ERROR        of string
6
   | `SYNTAX_ERROR of string]
7
-type chunk = command_id * int * bool * string
8
+type chunk = command_id * bool * string
9
 type process = {
10
     p_in  :  in_watch ;
11
     p_out : out_watch ;
12
@@ -152,7 +152,7 @@ let _read_cb w conditions =
13
     try 
14
       match Giochannel.read_chars w.out_w.w_chan w.out_sb with
15
       | `NORMAL read ->
16
-	  if debug then log "%s cb: read %d" w.out_w.w_name read ;
17
+	  if debug then log "%s cb: read %d" w.out_w.w_name read;
18
 	  Buffer.add_substring w.out_buffer w.out_sb 0 read ;
19
 	  w.out_cb w.out_buffer
20
       | `EOF ->
21
@@ -258,8 +258,8 @@ let encode_stdio cmd =
22
 
23
 
24
 
25
-let find_four_colon b =
26
-  let to_find = ref 4 in
27
+let find_three_colon b =
28
+  let to_find = ref 3 in
29
   let i = ref 0 in
30
   while !to_find > 0 do
31
     let c = Buffer.nth b !i in
32
@@ -277,22 +277,20 @@ let truncate_buffer b off len =
33
 
34
 let decode_stdio_chunk b =
35
   try
36
-    let header_len = find_four_colon b in
37
+    let header_len = find_three_colon b in
38
     let h = Buffer.sub b 0 header_len in
39
     let c1 = String.index_from h 0 ':' in
40
     let number = int_of_string (string_slice ~e:c1 h) in
41
-    let code   = int_of_char h.[c1 + 1] - int_of_char '0' in
42
     let c2 = String.index_from h (c1 + 1) ':' in
43
-    let last   = h.[c2 + 1] in
44
+    let last   = h.[c1 + 1] in
45
     let c3 = String.index_from h (c2 + 1) ':' in
46
-    let c4 = String.index_from h (c3 + 1) ':' in
47
-    let len   = int_of_string (string_slice ~s:(c3 + 1) ~e:c4 h) in
48
+    let len   = int_of_string (string_slice ~s:(c2 + 1) ~e:c3 h) in
49
     if Buffer.length b < header_len + len
50
     then
51
       `INCOMPLETE
52
     else
53
       let data = truncate_buffer b header_len len in
54
-      `CHUNK (number, code, last = 'l', data)
55
+      `CHUNK (number, last = 'l', data)
56
   with Invalid_argument _ ->
57
     `INCOMPLETE
58
 
59
@@ -305,11 +303,11 @@ let rec out_cb p b =
60
   | `INCOMPLETE ->
61
       ()
62
 
63
-  | `CHUNK (nb, _, _, _) when aborted_cmd p nb ->
64
+  | `CHUNK (nb, _, _) when aborted_cmd p nb ->
65
       p.chunks <- List.remove_assoc nb p.chunks ;
66
       out_cb p b
67
 
68
-  | `CHUNK ((nb, code, false, data) as chunk) ->
69
+  | `CHUNK ((nb, false, data) as chunk) ->
70
       if debug then log "decoded a chunk" ;
71
       let previous_chunks =
72
 	try List.assoc nb p.chunks
73
@@ -320,7 +318,7 @@ let rec out_cb p b =
74
       previous_chunks := chunk :: !previous_chunks ;
75
       out_cb p b
76
 
77
-  | `CHUNK ((nb, code, true, data) as chunk) ->
78
+  | `CHUNK ((nb, true, data) as chunk) ->
79
       if debug then log "decoded last chunk" ;
80
       let chunks =
81
 	try 
82
@@ -333,14 +331,14 @@ let rec out_cb p b =
83
       p.callbacks <- List.remove_assoc nb p.callbacks ;
84
       let msg = 
85
 	String.concat ""
86
-	  (List.map (fun (_, _, _, d) -> d) chunks) in
87
-      let data =
88
-	match code with
89
-	| 0 -> `OUTPUT msg
90
-	| 1 -> `SYNTAX_ERROR msg
91
-	| 2 -> `ERROR msg
92
+	  (List.map (function (_, false, d) -> d | (_, true, d) -> "") chunks) in
93
+      let code =
94
+	match data with
95
+	| "0" -> `OUTPUT msg
96
+	| "1" -> `SYNTAX_ERROR msg
97
+	| "2" -> `ERROR msg
98
 	| _ -> failwith "invalid_code in automate stdio output" in
99
-      ignore (Glib.Idle.add ~prio:0 (fun () -> cb data ; false)) ;
100
+      ignore (Glib.Idle.add ~prio:0 (fun () -> cb code ; false)) ;
101
       out_cb p b
102
 
103
 
104
@@ -409,6 +407,20 @@ let spawn mtn db = 
105
       chunks = [] ;
106
       exit_cb = (fun _ -> assert false)
107
     } in
108
+  let rec check_version buf =
109
+    if String.contains buf '\n' then
110
+      String.length buf >= 18 && String.sub buf 0 18 = "format-version: 2\n"
111
+    else
112
+      match Giochannel.read_chars p.p_out.out_w.w_chan p.p_out.out_sb  with
113
+      | `NORMAL read -> check_version (buf ^ String.sub p.p_out.out_sb 0 read)
114
+      | `EOF ->
115
+	  Giochannel.shutdown p.p_out.out_w.w_chan false;
116
+	  Giochannel.shutdown p.p_err.out_w.w_chan false;
117
+	  failwith "mtn version 0.46 or above is required";
118
+      | `AGAIN -> check_version buf
119
+  in
120
+  if not (check_version "")
121
+  then failwith "mtn stdio uses an unknown format-version";
122
   let pid = some child.Gspawn.pid in
123
   ignore (Gspawn.add_child_watch ~prio:50 pid (reap_cb p pid)) ;
124
   p.p_out.out_cb <- out_cb p ;
(-)devel/monotone-viz/pkg-descr (-7 / +6 lines)
Lines 1-10 Link Here
1
Monotone-viz is a small GTK+ application that
1
Monotone-viz is a small GTK+ application that visualizes monotone
2
visualizes monotone ancestry graphs.
2
ancestry graphs.
3
3
4
Monotone is a free distributed version control system.
4
Monotone is a free distributed version control system. Monotone-viz is
5
Monotone-viz is developed in the Objective Caml language,
5
developed in the Objective Caml language, using the GTK+ and
6
using the GTK+ and libgnomecanvas libraries (via LablGTK,
6
libgnomecanvas libraries (via LablGTK, an OCaml binding for GTK+), and
7
an OCaml binding for GTK+), and it uses the dot program
7
it uses the dot program from the Graphviz package.
8
from the Graphviz package.
9
8
10
WWW: http://oandrieu.nerim.net/monotone-viz/
9
WWW: http://oandrieu.nerim.net/monotone-viz/

Return to bug 210789