Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Nov 2010 11:33:45 +0100 (CET)
From:      Lapo Luchini <lapo@lapo.it>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/151961: [PATCH] devel/monotone-viz: update to 1.0.2+
Message-ID:  <201011051033.oA5AXjRB093934@lapo.andxor.it>
Resent-Message-ID: <201011051040.oA5Ae9tU078512@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         151961
>Category:       ports
>Synopsis:       [PATCH] devel/monotone-viz: update to 1.0.2+
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 05 10:40:09 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Lapo Luchini
>Release:        FreeBSD 8.1-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD lapo.andxor.it 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010
>Description:
- Update to 1.0.2 plus patches from original repository that the original author didn't yet release as 1.0.3, else it won't work with any mtn 0.46+ release

Added file(s):
- files/patch-agraph.ml
- files/patch-automate.ml

Removed file(s):
- files/patch-lablgtk_src_gContainer.mli

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- monotone-viz-1.0.2.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/devel/monotone-viz/Makefile /usr/home/lapo/ports/monotone-viz/Makefile
--- /usr/ports/devel/monotone-viz/Makefile	2010-03-28 08:33:23.000000000 +0200
+++ /usr/home/lapo/ports/monotone-viz/Makefile	2010-11-05 11:28:27.000000000 +0100
@@ -6,22 +6,28 @@
 #
 
 PORTNAME=	monotone-viz
-PORTVERSION=	1.0.1
-PORTREVISION=	4
+PORTVERSION=	1.0.2
 CATEGORIES=	devel
 MASTER_SITES=	http://oandrieu.nerim.net/monotone-viz/
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Visual interface for Monotone VCS with revision graphs
 
-BUILD_DEPENDS=	ocamlc:${PORTSDIR}/lang/ocaml \
-		dot:${PORTSDIR}/graphics/graphviz \
+BUILD_DEPENDS=	sqlite3:${PORTSDIR}/databases/sqlite3 \
+		lablgtk2:${PORTSDIR}/x11-toolkits/ocaml-lablgtk2
+RUN_DEPENDS+=	dot:${PORTSDIR}/graphics/graphviz \
 		mtn:${PORTSDIR}/devel/monotone \
-		sqlite3:${PORTSDIR}/databases/sqlite3
+		lablgtk2:${PORTSDIR}/x11-toolkits/ocaml-lablgtk2
 
-GNU_CONFIGURE=	YES
-USE_GMAKE=	YES
-USE_GNOME=	gtk20 libgnomecanvas
+LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+GNU_CONFIGURE=	yes
+USE_GMAKE=	yes
+USE_OCAML=	yes
+
+# following line can (and should) be used only after ports/149958 is closed
+#CONFIGURE_ARGS+=	--without-local-lablgtk
 
 ALL_TARGET=
 MAKE_JOBS_UNSAFE=	yes
@@ -29,4 +35,3 @@
 PLIST_FILES=	bin/monotone-viz
 
 .include <bsd.port.mk>
-
diff -ruN --exclude=CVS /usr/ports/devel/monotone-viz/distinfo /usr/home/lapo/ports/monotone-viz/distinfo
--- /usr/ports/devel/monotone-viz/distinfo	2008-06-01 12:13:57.000000000 +0200
+++ /usr/home/lapo/ports/monotone-viz/distinfo	2010-11-05 10:29:15.000000000 +0100
@@ -1,3 +1,2 @@
-MD5 (monotone-viz-1.0.1.tar.gz) = 7add0ae4cc5fdafa14a12aea23d3557f
-SHA256 (monotone-viz-1.0.1.tar.gz) = 02b9025dfa3107ab25df5485acba45d089a467abd336545975983075bbc6a4b5
-SIZE (monotone-viz-1.0.1.tar.gz) = 519352
+SHA256 (monotone-viz-1.0.2.tar.gz) = 404ee47378b144a62eb2dcdfb80430e68d193360216d120977a457cdbf85b7f6
+SIZE (monotone-viz-1.0.2.tar.gz) = 545631
diff -ruN --exclude=CVS /usr/ports/devel/monotone-viz/files/patch-agraph.ml /usr/home/lapo/ports/monotone-viz/files/patch-agraph.ml
--- /usr/ports/devel/monotone-viz/files/patch-agraph.ml	1970-01-01 01:00:00.000000000 +0100
+++ /usr/home/lapo/ports/monotone-viz/files/patch-agraph.ml	2010-08-25 13:13:37.000000000 +0200
@@ -0,0 +1,29 @@
+--- agraph.ml.orig	2007-03-07 22:53:54.000000000 +0100
++++ agraph.ml	2010-08-25 13:13:33.000000000 +0200
+@@ -50,8 +50,9 @@ let dot_format params agraph =
+       agraph.nodes in
+ 
+   !+ "digraph \"monotone-viz\"\n{\n" ;
+-  if params.lr_layout then
+-    !+ "  graph [rankdir=LR] ;\n" ;
++  if params.lr_layout
++  then  !+ "  graph [rankdir=LR] ;\n"
++  else  !+ "  graph [rankdir=BT] ;\n" ;
+   !+ "  graph [ranksep=\"0.25\"] ;\n" ;
+   !+ "  node [label=\"\"] ;\n" ;
+   
+@@ -222,11 +223,11 @@ let spawn_dot graph status done_cb =
+   let dot_prg = graph.layout_params.dot_program in
+   let cmd = 
+     if Viz_misc.debug "dot"
+-    then [ "/bin/sh" ; "-c" ; 
++    then [ "/usr/local/bin/bash" ; "-c" ; 
+ 	   Printf.sprintf 
+ 	     "set -o pipefail ; \
+-              tee agraph.in.dot | %s -q -y -s%.0f | tee agraph.out.dot" dot_prg ppi ]
+-    else [ dot_prg ; "-q" ; "-y" ; Printf.sprintf "-s%.0f" ppi ] in
++              tee agraph.in.dot | %s -q -s%.0f | tee agraph.out.dot" dot_prg ppi ]
++    else [ dot_prg ; "-q" ; Printf.sprintf "-s%.0f" ppi ] in
+   let error fmt =
+     Printf.kprintf (fun s -> done_cb (`LAYOUT_ERROR s)) fmt in
+   try
diff -ruN --exclude=CVS /usr/ports/devel/monotone-viz/files/patch-automate.ml /usr/home/lapo/ports/monotone-viz/files/patch-automate.ml
--- /usr/ports/devel/monotone-viz/files/patch-automate.ml	1970-01-01 01:00:00.000000000 +0100
+++ /usr/home/lapo/ports/monotone-viz/files/patch-automate.ml	2010-11-05 11:14:59.000000000 +0100
@@ -0,0 +1,124 @@
+--- automate.ml.orig	2010-11-05 11:14:53.000000000 +0100
++++ automate.ml	2010-11-05 11:14:55.000000000 +0100
+@@ -44,7 +44,7 @@ type output = [
+   | `OUTPUT       of string
+   | `ERROR        of string
+   | `SYNTAX_ERROR of string]
+-type chunk = command_id * int * bool * string
++type chunk = command_id * bool * string
+ type process = {
+     p_in  :  in_watch ;
+     p_out : out_watch ;
+@@ -152,7 +152,7 @@ let _read_cb w conditions =
+     try 
+       match Giochannel.read_chars w.out_w.w_chan w.out_sb with
+       | `NORMAL read ->
+-	  if debug then log "%s cb: read %d" w.out_w.w_name read ;
++	  if debug then log "%s cb: read %d" w.out_w.w_name read;
+ 	  Buffer.add_substring w.out_buffer w.out_sb 0 read ;
+ 	  w.out_cb w.out_buffer
+       | `EOF ->
+@@ -258,8 +258,8 @@ let encode_stdio cmd =
+ 
+ 
+ 
+-let find_four_colon b =
+-  let to_find = ref 4 in
++let find_three_colon b =
++  let to_find = ref 3 in
+   let i = ref 0 in
+   while !to_find > 0 do
+     let c = Buffer.nth b !i in
+@@ -277,22 +277,20 @@ let truncate_buffer b off len =
+ 
+ let decode_stdio_chunk b =
+   try
+-    let header_len = find_four_colon b in
++    let header_len = find_three_colon b in
+     let h = Buffer.sub b 0 header_len in
+     let c1 = String.index_from h 0 ':' in
+     let number = int_of_string (string_slice ~e:c1 h) in
+-    let code   = int_of_char h.[c1 + 1] - int_of_char '0' in
+     let c2 = String.index_from h (c1 + 1) ':' in
+-    let last   = h.[c2 + 1] in
++    let last   = h.[c1 + 1] in
+     let c3 = String.index_from h (c2 + 1) ':' in
+-    let c4 = String.index_from h (c3 + 1) ':' in
+-    let len   = int_of_string (string_slice ~s:(c3 + 1) ~e:c4 h) in
++    let len   = int_of_string (string_slice ~s:(c2 + 1) ~e:c3 h) in
+     if Buffer.length b < header_len + len
+     then
+       `INCOMPLETE
+     else
+       let data = truncate_buffer b header_len len in
+-      `CHUNK (number, code, last = 'l', data)
++      `CHUNK (number, last = 'l', data)
+   with Invalid_argument _ ->
+     `INCOMPLETE
+ 
+@@ -305,11 +303,11 @@ let rec out_cb p b =
+   | `INCOMPLETE ->
+       ()
+ 
+-  | `CHUNK (nb, _, _, _) when aborted_cmd p nb ->
++  | `CHUNK (nb, _, _) when aborted_cmd p nb ->
+       p.chunks <- List.remove_assoc nb p.chunks ;
+       out_cb p b
+ 
+-  | `CHUNK ((nb, code, false, data) as chunk) ->
++  | `CHUNK ((nb, false, data) as chunk) ->
+       if debug then log "decoded a chunk" ;
+       let previous_chunks =
+ 	try List.assoc nb p.chunks
+@@ -320,7 +318,7 @@ let rec out_cb p b =
+       previous_chunks := chunk :: !previous_chunks ;
+       out_cb p b
+ 
+-  | `CHUNK ((nb, code, true, data) as chunk) ->
++  | `CHUNK ((nb, true, data) as chunk) ->
+       if debug then log "decoded last chunk" ;
+       let chunks =
+ 	try 
+@@ -333,14 +331,14 @@ let rec out_cb p b =
+       p.callbacks <- List.remove_assoc nb p.callbacks ;
+       let msg = 
+ 	String.concat ""
+-	  (List.map (fun (_, _, _, d) -> d) chunks) in
+-      let data =
+-	match code with
+-	| 0 -> `OUTPUT msg
+-	| 1 -> `SYNTAX_ERROR msg
+-	| 2 -> `ERROR msg
++	  (List.map (function (_, false, d) -> d | (_, true, d) -> "") chunks) in
++      let code =
++	match data with
++	| "0" -> `OUTPUT msg
++	| "1" -> `SYNTAX_ERROR msg
++	| "2" -> `ERROR msg
+ 	| _ -> failwith "invalid_code in automate stdio output" in
+-      ignore (Glib.Idle.add ~prio:0 (fun () -> cb data ; false)) ;
++      ignore (Glib.Idle.add ~prio:0 (fun () -> cb code ; false)) ;
+       out_cb p b
+ 
+ 
+@@ -409,6 +407,20 @@ let spawn mtn db = 
+       chunks = [] ;
+       exit_cb = (fun _ -> assert false)
+     } in
++  let rec check_version buf =
++    if String.contains buf '\n' then
++      String.length buf >= 18 && String.sub buf 0 18 = "format-version: 2\n"
++    else
++      match Giochannel.read_chars p.p_out.out_w.w_chan p.p_out.out_sb  with
++      | `NORMAL read -> check_version (buf ^ String.sub p.p_out.out_sb 0 read)
++      | `EOF ->
++	  Giochannel.shutdown p.p_out.out_w.w_chan false;
++	  Giochannel.shutdown p.p_err.out_w.w_chan false;
++	  failwith "mtn version 0.46 or above is required";
++      | `AGAIN -> check_version buf
++  in
++  if not (check_version "")
++  then failwith "mtn stdio uses an unknown format-version";
+   let pid = some child.Gspawn.pid in
+   ignore (Gspawn.add_child_watch ~prio:50 pid (reap_cb p pid)) ;
+   p.p_out.out_cb <- out_cb p ;
diff -ruN --exclude=CVS /usr/ports/devel/monotone-viz/files/patch-lablgtk_src_gContainer.mli /usr/home/lapo/ports/monotone-viz/files/patch-lablgtk_src_gContainer.mli
--- /usr/ports/devel/monotone-viz/files/patch-lablgtk_src_gContainer.mli	2008-06-01 12:13:57.000000000 +0200
+++ /usr/home/lapo/ports/monotone-viz/files/patch-lablgtk_src_gContainer.mli	1970-01-01 01:00:00.000000000 +0100
@@ -1,27 +0,0 @@
---- lablgtk/src/gContainer.mli.orig	2008-05-01 20:41:05.000000000 +0200
-+++ lablgtk/src/gContainer.mli	2008-05-01 20:41:09.000000000 +0200
-@@ -20,7 +20,7 @@
- (*                                                                        *)
- (**************************************************************************)
- 
--(* $Id: gContainer.mli 1347 2007-06-20 07:40:34Z guesdon $ *)
-+(* $Id: gContainer.mli 1397 2008-02-26 00:21:39Z garrigue $ *)
- 
- open Gtk
- open GObj
-@@ -92,11 +92,12 @@ val cast_container : widget -> container
- 
- (** @gtkdoc gtk GtkContainer *)
- val pack_container :
--  create:([> Gtk.container] Gobject.param list -> (#GObj.widget as 'a)) ->
--  [> Gtk.container] Gobject.param list ->
-+  create:(([> Gtk.container] as 'a) Gobject.param list ->
-+          (#GObj.widget as 'b)) ->
-+  'a Gobject.param list ->
-   ?border_width:int ->
-   ?width:int ->
--  ?height:int -> ?packing:(GObj.widget -> unit) -> ?show:bool -> unit -> 'a
-+  ?height:int -> ?packing:(GObj.widget -> unit) -> ?show:bool -> unit -> 'b
- 
- (** {3 GtkBin} *)
- 
--- monotone-viz-1.0.2.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011051033.oA5AXjRB093934>