Bug 177023 - x11-toolkits/flowcanvas doesn't build with recent graphviz
Summary: x11-toolkits/flowcanvas doesn't build with recent graphviz
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Pawel Pekala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-16 14:30 UTC by Bojan Petrovic
Modified: 2013-03-29 20:00 UTC (History)
0 users

See Also:


Attachments
file.diff (2.69 KB, patch)
2013-03-16 14:30 UTC, Bojan Petrovic
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bojan Petrovic 2013-03-16 14:30:00 UTC
The x11-toolkits/flowcanvas is already marked as BROKEN because it cannot compile with recent graphviz library.

The problem seems to be twofold:

First, flowcanvas relies on deprecated libraph graphviz library. Libcgraph has different function signatures and names.

Second, `pkg-config --libs libgvc` reports `-L/usr/local/lib/graphviz -lgvc -lgraph -lcdt`, although libgraph is not installed by graphviz port.

Fix: In the patch, src/Canvas.cpp is updated to use cgraph functions

Also, wscript now replaces 'graph' with 'cgraph' in linker flags after autoconfiguring gvc library.

Patch attached with submission follows:
How-To-Repeat: Try building x11-toolkits/flowcanvas
Comment 1 Pawel Pekala freebsd_committer freebsd_triage 2013-03-29 18:55:52 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pawel

I'll take it.
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-03-29 19:56:05 UTC
Author: pawel
Date: Fri Mar 29 19:55:58 2013
New Revision: 315568
URL: http://svnweb.freebsd.org/changeset/ports/315568

Log:
  Unbreak after graphviz update
  
  PR:		ports/177023
  Submitted by:	Bojan Petrovic <bojan_petrovic@fastmail.fm>

Added:
  head/x11-toolkits/flowcanvas/files/
  head/x11-toolkits/flowcanvas/files/patch-src_Canvas.cpp   (contents, props changed)
  head/x11-toolkits/flowcanvas/files/patch-wscript   (contents, props changed)
Modified:
  head/x11-toolkits/flowcanvas/Makefile   (contents, props changed)

Modified: head/x11-toolkits/flowcanvas/Makefile
==============================================================================
--- head/x11-toolkits/flowcanvas/Makefile	Fri Mar 29 19:41:55 2013	(r315567)
+++ head/x11-toolkits/flowcanvas/Makefile	Fri Mar 29 19:55:58 2013	(r315568)
@@ -8,17 +8,15 @@ CATEGORIES=	x11-toolkits
 MASTER_SITES=	http://download.drobilla.net/
 
 MAINTAINER=	ports@FreeBSD.org
-COMMENT=	An interactive Gtkmm/Gnomecanvasmm widget
-
-BROKEN=		Does not build with recent graphviz
+COMMENT=	Interactive Gtkmm/Gnomecanvasmm widget
 
 LICENSE=	GPLv2 GPLv3
 LICENSE_COMB=	dual
 
 LIB_DEPENDS=	boost_date_time:${PORTSDIR}/devel/boost-libs \
-		gvc.6:${PORTSDIR}/graphics/graphviz \
+		gvc:${PORTSDIR}/graphics/graphviz \
 		gnomecanvasmm-2.6:${PORTSDIR}/graphics/libgnomecanvasmm26 \
-		gtkmm-2.4.1:${PORTSDIR}/x11-toolkits/gtkmm24
+		gtkmm-2.4:${PORTSDIR}/x11-toolkits/gtkmm24
 
 USE_BZIP2=	yes
 USE_PYTHON_BUILD=yes

Added: head/x11-toolkits/flowcanvas/files/patch-src_Canvas.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11-toolkits/flowcanvas/files/patch-src_Canvas.cpp	Fri Mar 29 19:55:58 2013	(r315568)
@@ -0,0 +1,46 @@
+--- src/Canvas.cpp.orig	2011-01-10 00:19:58.000000000 +0100
++++ src/Canvas.cpp	2013-03-16 13:45:17.797462753 +0100
+@@ -1253,21 +1253,21 @@
+ 	 */
+ 
+ 	GVC_t* gvc = gvContext();
+-	Agraph_t* G = agopen((char*)"g", AGDIGRAPH);
++	Agraph_t* G = agopen((char*)"g", Agdirected, NULL);
+ 
+ 	nodes.gvc = gvc;
+ 	nodes.G = G;
+ 
+ 	if (_direction == HORIZONTAL)
+-		agraphattr(G, (char*)"rankdir", (char*)"LR");
++		agattr(G, AGRAPH, (char*)"rankdir", (char*)"LR");
+ 	else
+-		agraphattr(G, (char*)"rankdir", (char*)"TD");
++		agattr(G, AGRAPH, (char*)"rankdir", (char*)"TD");
+ 
+ 	unsigned id = 0;
+ 	for (ItemList::const_iterator i = _items.begin(); i != _items.end(); ++i) {
+ 		std::ostringstream ss;
+ 		ss << "n" << id++;
+-		Agnode_t* node = agnode(G, strdup(ss.str().c_str()));
++		Agnode_t* node = agnode(G, strdup(ss.str().c_str()), true);
+ 		if (boost::dynamic_pointer_cast<Module>(*i)) {
+ 			ss.str("");
+ 			ss << (*i)->width() / 96.0;
+@@ -1310,7 +1310,7 @@
+ 
+ 		assert(src_node && dst_node);
+ 
+-		Agedge_t* edge = agedge(G, src_node, dst_node);
++		Agedge_t* edge = agedge(G, src_node, dst_node, NULL, true);
+ 
+ 		if (use_length_hints && c->length_hint() != 0) {
+ 			std::ostringstream len_ss;
+@@ -1325,7 +1325,7 @@
+ 		if (partner) {
+ 			GVNodes::iterator p = nodes.find(partner);
+ 			if (p != nodes.end())
+-				agedge(G, i->second, p->second);
++				agedge(G, i->second, p->second, NULL, true);
+ 		}
+ 	}
+ 

Added: head/x11-toolkits/flowcanvas/files/patch-wscript
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11-toolkits/flowcanvas/files/patch-wscript	Fri Mar 29 19:55:58 2013	(r315568)
@@ -0,0 +1,10 @@
+--- wscript.orig	2011-01-12 00:09:31.000000000 +0100
++++ wscript	2013-03-16 14:19:43.577462602 +0100
+@@ -41,6 +41,7 @@
+ 	conf.check_tool('compiler_cxx')
+ 	autowaf.check_pkg(conf, 'libgvc', uselib_store='AGRAPH',
+ 	                  atleast_version='2.8', mandatory=False)
++	conf.env['LIB_AGRAPH'] = ['cgraph' if l == 'graph' else l for l in conf.env['LIB_AGRAPH']]
+ 	autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GLIBMM',
+ 	                  atleast_version='2.10.0', mandatory=True)
+ 	autowaf.check_pkg(conf, 'libgnomecanvasmm-2.6', uselib_store='GNOMECANVASMM',
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Pawel Pekala freebsd_committer freebsd_triage 2013-03-29 19:56:15 UTC
State Changed
From-To: open->closed

Committed. Thanks!