Date: Mon, 04 Apr 2011 17:16:53 +0400 From: Pan Tsu <inyaoo@gmail.com> To: Bernhard Froehlich <decke@FreeBSD.org> Cc: gecko@FreeBSD.org, Beat Gaetzi <beat@FreeBSD.org>, Kalten <kalten@gmx.at> Subject: Re: ports/155949: www/firefox: firefox 4, WITH_PGO, better Text against DISPLAY problem Message-ID: <86y63q9mwq.fsf@gmail.com> In-Reply-To: <af60d368b06964a62e07b628e939fd75@bluelife.at> (Bernhard Froehlich's message of "Mon, 04 Apr 2011 13:29:18 %2B0200") References: <201103290607.p2T674ob067019@freefall.freebsd.org> <af60d368b06964a62e07b628e939fd75@bluelife.at>
next in thread | previous in thread | raw e-mail | index | archive | help
Bernhard Froehlich <decke@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})
%%
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86y63q9mwq.fsf>
