Fixing broken pkg-plist and make it build fine with python-bindings

Jens Rehsack rehsack at liwing.de
Tue Apr 20 05:07:32 PDT 2004


>Submitter-Id:	current-users
>Originator:	Jens Rehsack <rehsack at liwing.de>
>Organization:	LiWing IT-Services
>Confidential:	no
>Synopsis:	Fixing broken pkg-plist and make it build fine with python-bindings
>Severity:	serious
>Priority:	medium
>Category:	ports
>Class:		sw-bug
>Release:	FreeBSD 5.2-CURRENT i386
>Environment:
System: FreeBSD statler 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Sun Apr 4 11:05:15 GMT 2004 root at statler:/usr/obj/usr/src/sys/STATLER i386


	
>Description:
	It seems that in last days/weeks diacanvas2 didn't build fine when
	it has no DISPLAY available. Because of the commiter of my introduced
	port removed the WITH(OUT)_PYTHON, python is required every time
	and maybe that's better.
	But py-gtk testing routine seems to require an X connection, so
	I've borrowed the great stuff from the editors/openoffice port
	to have an virtual X Server if none is available.
>How-To-Repeat:
	
>Fix:

	

--- patch-python-bindings begins here ---
Index: graphics/diacanvas2/Makefile
===================================================================
diff -u graphics/diacanvas2/Makefile.orig graphics/diacanvas2/Makefile
--- graphics/diacanvas2/Makefile.orig	Mon Apr 19 04:22:25 2004
+++ graphics/diacanvas2/Makefile	Tue Apr 20 11:38:37 2004
@@ -18,8 +18,6 @@
 BUILD_DEPENDS=	${PYTHON_SITELIBDIR}/gtk-2.0/gnome/__init__.py:${PORTSDIR}/x11-toolkits/py-gnome2
 RUN_DEPENDS=	${PYTHON_SITELIBDIR}/gtk-2.0/gnome/__init__.py:${PORTSDIR}/x11-toolkits/py-gnome2
 
-BROKEN=		"Broken pkg-plist"
-
 USE_GNOME=	gnomehack libgnomeprint libgnomeprintui libartlgpl2 \
 		libgnomecanvas
 USE_PYTHON=	2.2+
@@ -30,9 +28,33 @@
 		LDFLAGS="-L${LOCALBASE}/lib"
 INSTALLS_SHLIB=	yes
 
+.if !defined(DISPLAY)
+BUILD_DEPENDS+= Xvfb:${PORTSDIR}/x11-servers/XFree86-4-VirtualFramebufferServer
+CONFIGURE_ENV+=	DISPLAY=localhost:1001
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e \
 		's|unit_tests doc|unit_tests|g' ${WRKSRC}/Makefile.in
+
+pre-configure:
+.if exists(${WRKDIR}/.Xvfb.pid)
+	@-${CAT} ${WRKDIR}/.Xvfb.pid | ${XARGS} kill
+	@${RM} -f ${WRKDIR}/.Xvfb.pid
+.endif
+.if !defined(DISPLAY)
+	#
+	# This is a UGLY hack to not have to specify a X-Display.
+	#
+	${X11BASE}/bin/Xvfb :1001 -screen 0 800x600x24 > /dev/null 2>&1 & ${ECHO} $$! > ${WRKDIR}/.Xvfb.pid
+	@sleep 5
+.endif
+
+post-configure:
+.if !defined(DISPLAY)
+	@-${CAT} ${WRKDIR}/.Xvfb.pid | ${XARGS} kill
+	@${RM} -f ${WRKDIR}/.Xvfb.pid
+.endif
 
 post-install:
 .if !defined(NOPORTDOCS)
Index: graphics/diacanvas2/pkg-plist
===================================================================
diff -u graphics/diacanvas2/pkg-plist.orig graphics/diacanvas2/pkg-plist
--- graphics/diacanvas2/pkg-plist.orig	Fri Apr  9 13:48:47 2004
+++ graphics/diacanvas2/pkg-plist	Tue Apr 20 11:55:12 2004
@@ -89,6 +89,6 @@
 share/pygtk/2.0/defs/diageometry.defs
 share/pygtk/2.0/defs/diashape.defs
 share/pygtk/2.0/defs/diaview.defs
-%%PORTDOCS%%@dirrm %%DOCSDIR%%
+ at dirrm %%PORTDOCS%%%%DOCSDIR%%
 @dirrm %%PYTHON_SITELIBDIR%%/diacanvas
 @dirrm include/diacanvas
--- patch-python-bindings ends here ---




More information about the freebsd-ports mailing list