ports/155949: www/firefox: firefox 4, WITH_PGO, better Text against DISPLAY problem

Pan Tsu inyaoo at gmail.com
Mon Apr 4 13:43:47 UTC 2011


Bernhard Froehlich <decke at FreeBSD.org> writes:

> I think the cleanest solution would be a check before starting build to
> detect if X is available or not. (ideally configure or otherwise port
> Makefile)
[...]

Does waiting for XOpenDisplay() to time out and abort the build suffice?

%%
Index: www/firefox/Makefile
===================================================================
RCS file: /a/.cvsup/ports/www/firefox/Makefile,v
retrieving revision 1.239
diff -u -p -r1.239 Makefile
--- www/firefox/Makefile	24 Mar 2011 11:04:17 -0000	1.239
+++ www/firefox/Makefile	4 Apr 2011 13:05:54 -0000
@@ -88,7 +87,7 @@ ALL_TARGET=	profiledbuild
 BUILD_DEPENDS+=	yasm:${PORTSDIR}/devel/yasm
 .endif
 
-pre-extract:
+pgo-check:
 .if defined(WITH_PGO)
 	@${ECHO} "*****************************************************************"
 	@${ECHO} "**************************** attention **************************"
@@ -99,7 +98,9 @@ pre-extract:
 	@${ECHO} "During the build a Firefox instance will start and run some test."
 	@${ECHO} "      Do not interrupt or close Firefox during this tests!       "
 	@${ECHO} "*****************************************************************"
-	@sleep 10
+	@${PYTHON_CMD} -c 'from ctypes import CDLL; CDLL("libX11.so").\
+		XOpenDisplay("${DISPLAY}")' & \
+	if sleep 3 && kill $$!; then return 1; fi
 .endif
 
 post-extract::
@@ -122,7 +123,7 @@
 		s|/usr/X11R6|${LOCALBASE}|g' \
 		${WRKSRC}/js/src/configure
 
-pre-configure:
+pre-configure:	pgo-check
 	(cd ${WRKSRC} && ${AUTOCONF})
 	(cd ${WRKSRC}/js/src/ && ${AUTOCONF})
 
%%


More information about the freebsd-gecko mailing list