From boris@brooknet.com.au  Fri Feb 25 13:39:33 2005
Return-Path: <boris@brooknet.com.au>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 72CCD16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Feb 2005 13:39:33 +0000 (GMT)
Received: from bloodwood.hunterlink.net.au (smtp-local.hunterlink.net.au [203.12.144.17])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 03D6F43D58
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 25 Feb 2005 13:39:32 +0000 (GMT)
	(envelope-from boris@brooknet.com.au)
Received: from localhost (ppp23F1.dyn.pacific.net.au [61.8.35.241])
	by bloodwood.hunterlink.net.au (8.12.8/8.12.8) with ESMTP id j1PDdSQp029580
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 26 Feb 2005 00:39:28 +1100
Received: by localhost (Postfix, from userid 0)
	id EF257180E; Sat, 26 Feb 2005 00:40:39 +1100 (EST)
Message-Id: <20050225134039.EF257180E@localhost>
Date: Sat, 26 Feb 2005 00:40:39 +1100 (EST)
From: Sam Lawrance <boris@brooknet.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] graphics/py24-graphviz: fix unfetchable, improve build
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         78069
>Category:       ports
>Synopsis:       [PATCH] graphics/py24-graphviz: fix unfetchable, improve build
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pav
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 25 13:40:11 GMT 2005
>Closed-Date:    Sat Feb 26 13:23:28 GMT 2005
>Last-Modified:  Sat Feb 26 13:23:28 GMT 2005
>Originator:     Sam Lawrance
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD dirk.no.domain 5.3-STABLE FreeBSD 5.3-STABLE #3: Wed Feb  9 00:12:24 EST
>Description:
- Remove files/setup.py
- Add files/Makefile
- Rather than build from port's own download of graphviz,
  depend on the graphviz port and use its shared objects.
  I'm no python programmer, but a quick test showed the calls
  through to the native library to be working.
  (the graphviz tarball was the unfetchable item)

>How-To-Repeat:
>Fix:

--- py24-graphviz-0.1_1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/FreeBSD/ports/graphics/py-graphviz/Makefile,v
retrieving revision 1.6
diff -u -u -r1.6 Makefile
--- Makefile	31 Mar 2003 04:18:46 -0000	1.6
+++ Makefile	25 Feb 2005 13:31:58 -0000
@@ -8,35 +8,42 @@
 PORTVERSION=	0.1
 PORTREVISION=	1
 CATEGORIES=	graphics python
-MASTER_SITES=	http://www.cs.brown.edu/~er/software/Agraph.py/ \
-		http://www.graphviz.org/pub/graphviz/ARCHIVE/:gv
+MASTER_SITES=	http://www.cs.brown.edu/~er/software/Agraph.py/
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
-DISTFILES=	${MODFILES} ${PORTNAME}-${GV_VERSION}.tar.gz:gv
+DISTFILES=	gv.i __init__.py
 DIST_SUBDIR=	${PORTNAME}
-EXTRACT_ONLY=	${PORTNAME}-${GV_VERSION}.tar.gz
+EXTRACT_ONLY=
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Python interface to GraphViz agraph
 
-BUILD_DEPENDS=	${SWIG_CMD}:${PORTSDIR}/devel/swig13
+BUILD_DEPENDS=	${SWIG_CMD}:${PORTSDIR}/devel/swig13 \
+		${LOCALBASE}/lib/graphviz/libagraph.so:${PORTSDIR}/graphics/graphviz
 
 NO_CDROM=	"Can't be included in a commercial product"
 
-MODFILES=	gv.i __init__.py
-WRKSRC=		${WRKDIR}/graphviz-${GV_VERSION}/agraph
-GV_VERSION?=	1.9
-
 USE_PYTHON=	yes
-USE_PYDISTUTILS=	yes
 SWIG_CMD=	${LOCALBASE}/bin/swig1.3
 PLIST_SUB=	PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR:S,^${LOCALBASE}/,,g}
+GV_PORT=	${PORTSDIR}/graphics/graphviz
+MAKE_ENV=	PYTHON_INCLUDEDIR=${PYTHON_INCLUDEDIR} \
+		GRAPHVIZ_INCLUDEDIR=${LOCALBASE}/include/graphviz \
+		SWIG_CMD=${SWIG_CMD}
 
 post-patch:
-	@${CP} ${DISTDIR}/graphviz/gv.i ${FILESDIR}/setup.py ${WRKSRC}
-	@${MKDIR} ${WRKSRC}/graphviz
-	@${CP} ${DISTDIR}/graphviz/__init__.py ${WRKSRC}/graphviz
+	@${MKDIR} ${WRKSRC}
+	@${CP} ${DISTDIR}/graphviz/gv.i ${FILESDIR}/Makefile ${WRKSRC}
 
-pre-build:
-	@cd ${WRKSRC} && ${SWIG_CMD} -python gv.i
+do-install:
+	${MKDIR} ${PYTHON_SITELIBDIR}/${PORTNAME}
+	${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/__init__.py \
+		${WRKSRC}/_graphviz.so ${WRKSRC}/graphviz.py \
+		${PYTHON_SITELIBDIR}/${PORTNAME}
+
+post-install:
+	${PYTHON_CMD} ${PYTHON_LIBDIR}/py_compile.py \
+		${PYTHON_SITELIBDIR}/${PORTNAME}/__init__.py
+	${PYTHON_CMD} ${PYTHON_LIBDIR}/py_compile.py \
+		${PYTHON_SITELIBDIR}/${PORTNAME}/graphviz.py
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /home/ncvs/FreeBSD/ports/graphics/py-graphviz/distinfo,v
retrieving revision 1.3
diff -u -u -r1.3 distinfo
--- distinfo	29 Jan 2004 07:24:29 -0000	1.3
+++ distinfo	25 Feb 2005 11:40:46 -0000
@@ -2,5 +2,3 @@
 SIZE (graphviz/gv.i) = 5246
 MD5 (graphviz/__init__.py) = aaad44b12a9db8876c18bcb7edcfc28b
 SIZE (graphviz/__init__.py) = 8880
-MD5 (graphviz/graphviz-1.9.tar.gz) = 5f8d1e1f15594f4869fc9c68f32e7dbb
-SIZE (graphviz/graphviz-1.9.tar.gz) = 3173162
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/FreeBSD/ports/graphics/py-graphviz/pkg-plist,v
retrieving revision 1.2
diff -u -u -r1.2 pkg-plist
--- pkg-plist	23 Aug 2002 11:30:21 -0000	1.2
+++ pkg-plist	25 Feb 2005 13:05:04 -0000
@@ -1,5 +1,6 @@
 %%PYTHON_SITELIBDIR%%/graphviz/__init__.py
 %%PYTHON_SITELIBDIR%%/graphviz/__init__.pyc
-%%PYTHON_SITELIBDIR%%/graphviz/__init__.pyo
-%%PYTHON_SITELIBDIR%%/graphviz/graphviz.so
+%%PYTHON_SITELIBDIR%%/graphviz/graphviz.py
+%%PYTHON_SITELIBDIR%%/graphviz/graphviz.pyc
+%%PYTHON_SITELIBDIR%%/graphviz/_graphviz.so
 @dirrm %%PYTHON_SITELIBDIR%%/graphviz
--- py24-graphviz-0.1_1.patch ends here ---

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: pav 
State-Changed-When: Fri Feb 25 20:46:12 GMT 2005 
State-Changed-Why:  
I don't see that files/Makefile anywhere ..? 


Responsible-Changed-From-To: freebsd-ports-bugs->pav 
Responsible-Changed-By: pav 
Responsible-Changed-When: Fri Feb 25 20:46:12 GMT 2005 
Responsible-Changed-Why:  
Watch 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78069 

From: Sam Lawrance <boris@brooknet.com.au>
To: Pav Lucistnik <pav@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/78069: [PATCH] graphics/py24-graphviz: fix unfetchable,
	improve build
Date: Sat, 26 Feb 2005 11:58:01 +1100

 --=-jAouQOy6jGFYeBUn5wHA
 Content-Type: text/plain
 Content-Transfer-Encoding: 7bit
 
 Ooops, attached.
 
 
 --=-jAouQOy6jGFYeBUn5wHA
 Content-Disposition: attachment; filename=files-Makefile-patch
 Content-Type: text/plain; name=files-Makefile-patch; charset=ASCII
 Content-Transfer-Encoding: 7bit
 
 --- /dev/null	Sat Feb 26 11:52:47 2005
 +++ files/Makefile	Fri Feb 25 23:39:16 2005
 @@ -0,0 +1,10 @@
 +all: _graphviz.so
 +
 +_graphviz.so: gv_wrap.o
 +	${CC} -shared ${LOCALBASE}/lib/graphviz/libagraph.so ${LOCALBASE}/lib/graphviz/libcdt.so gv_wrap.o -o _graphviz.so
 +
 +gv_wrap.o: gv_wrap.c
 +	${CC} -fno-strict-aliasing -DNDEBUG -O -pipe -DTHREAD_STACK_SIZE=0x20000 -fPIC -Dulong=u_long -DVERSION="py-agraph 1.0" -I${GRAPHVIZ_INCLUDEDIR} -I${PYTHON_INCLUDEDIR} ${CFLAGS} -c gv_wrap.c
 +
 +gv_wrap.c:
 +	${SWIG_CMD} -python gv.i 
 
 --=-jAouQOy6jGFYeBUn5wHA--
 
State-Changed-From-To: feedback->closed 
State-Changed-By: pav 
State-Changed-When: Sat Feb 26 13:23:14 GMT 2005 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=78069 
>Unformatted:
