Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Mar 2011 16:44:11 +0200
From:      Matthias Andree <mandree@FreeBSD.org>
To:        Beat Gaetzi <beat@FreeBSD.org>
Cc:        gecko@FreeBSD.org, bug-followup@FreeBSD.org, Pan Tsu <inyaoo@gmail.com>
Subject:   Re: ports/155971: [PATCH] databases/sqlite3: always enable EXTENSIONS
Message-ID:  <4D909EBB.6080800@FreeBSD.org>
In-Reply-To: <4D909E08.2080006@FreeBSD.org>
References:  <201103280800.p2S80NRT048809@freefall.freebsd.org> <4D90740E.9010305@FreeBSD.org> <0a97b224749efa1cae65845675036f4d.squirrel@wmail.chruetertee.ch> <4D909E08.2080006@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------070804080403060103020503
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Whoops, editorial error caused a bogus line fold that broke the file.
Back out the previous patch (if applied) and use this instead.

--------------070804080403060103020503
Content-Type: text/x-patch;
 name="fixed-check-www-firefox-PGO.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="fixed-check-www-firefox-PGO.patch"

REVISED:

--- firefox-4.0_1,1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/www/firefox/Makefile,v
retrieving revision 1.239
diff -u -u -r1.239 Makefile
--- Makefile	24 Mar 2011 11:04:17 -0000	1.239
+++ Makefile	28 Mar 2011 14:41:55 -0000
@@ -58,7 +58,7 @@
 
 WRKSRC:=	${WRKSRC}-2.0
 
-GECKO_PTHREAD_LIBS!=${CC} -dumpspecs | ${GREP} -m 1 '%{\!pg: %{pthread:' | ${SED} -e 's|^.*%{\!pg: %{pthread:|| ; s|}.*$$||' || ${TRUE}
+GECKO_PTHREAD_LIBS=	${CC} -dumpspecs | ${GREP} -m 1 '%{\!pg: %{pthread:' | ${SED} -e 's|^.*%{\!pg: %{pthread:|| ; s|}.*$$||' || ${TRUE}
 
 .if ${HAVE_GNOME:Mlibgnomeui}!=""
 USE_GNOME+=	libgnomeui
@@ -75,6 +75,7 @@
 .endif
 
 .if defined(WITH_PGO)
+www_firefox_check_sqlite3_extension=	${OBJDUMP} 2>&1 -R ${LOCALBASE}/lib/libsqlite3.so | ${EGREP} -w -q 'sqlite3_load_extension'
 BUILD_DEPENDS+=	${PYTHON_SITELIBDIR}/_sqlite3.so:${PORTSDIR}/databases/py-sqlite3
 USE_PYTHON_BUILD=	yes
 USE_DISPLAY=		yes
@@ -88,17 +89,45 @@
 BUILD_DEPENDS+=	yasm:${PORTSDIR}/devel/yasm
 .endif
 
+PGO_FAIL="\
+===============================================================\n\
+For profile-guided-optimized builds, sqlite3 in your system\n\
+needs to be built with the EXTENSION option enabled.\n\
+\n\
+Either re-run \"make config\" and build firefox without PGO, or\n\
+re-install databases/sqlite3 with EXTENSION enabled before\n\
+retrying the firefox build.\n\
+===============================================================\n"
+
+# these checks are quite early, but since sqlite3 may be neither
+# configured nor installed if this Makefile is being processed,
+# we need to re-check again.
+pre-everything::
+.if defined(WITH_PGO)
+	@fail=0 ; \
+	if test -e ${PORTS_DBDIR}/sqlite3/options ; then \
+		if ${EGREP} ^WITHOUT_EXTENSION= ${PORTS_DBDIR}/sqlite ; then fail=1 ; fi \
+	fi ; \
+	if test -e ${LOCALBASE}/lib/libsqlite3.so ; then \
+		${www_firefox_check_sqlite3_extension} || fail=1 ; \
+	fi ; \
+	if test $$fail = 1 ; then \
+		${ECHO_CMD} ${PGO_FAIL} ; \
+	fi
+.endif
+
 pre-extract:
 .if defined(WITH_PGO)
-	@${ECHO} "*****************************************************************"
-	@${ECHO} "**************************** attention **************************"
-	@${ECHO} "*****************************************************************"
-	@${ECHO} "To build Firefox with PGO support you need a running X server and"
-	@${ECHO} "   build this port with an user who could access the X server!   "
+	@${ECHO} "******************************************************************"
+	@${ECHO} "**************************** Attention ***************************"
+	@${ECHO} "******************************************************************"
+	@${ECHO} ""
+	@${ECHO} "To build Firefox with PGO support you need a running X server and "
+	@${ECHO} "build this port with a user who can access the X server!          "
 	@${ECHO} ""
-	@${ECHO} "During the build a Firefox instance will start and run some test."
-	@${ECHO} "      Do not interrupt or close Firefox during this tests!       "
-	@${ECHO} "*****************************************************************"
+	@${ECHO} "During the build a Firefox instance will start and run some tests."
+	@${ECHO} "Do not interrupt or close Firefox during these tests!             "
+	@${ECHO} "******************************************************************"
 	@sleep 10
 .endif
 
@@ -108,7 +137,7 @@
 		<${FILESDIR}/firefox.desktop.in >${WRKDIR}/${MOZILLA}.desktop
 
 post-patch:
-	${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS:C/-pthread/${GECKO_PTHREAD_LIBS}/}|' \
+	${REINPLACE_CMD} -e "s|%%PTHREAD_LIBS%%|${PTHREAD_LIBS:C/-pthread/\$(${GECKO_PTHREAD_LIBS})/}|" \
 		${WRKSRC}/storage/build/Makefile.in \
 		${WRKSRC}/toolkit/library/Makefile.in \
 		${WRKSRC}/db/sqlite3/src/Makefile.in
@@ -134,6 +163,15 @@
 	(cd ${WRKSRC} && ${GMAKE} distclean)
 .endif
 
+# run again - if sqlite3 or py-sqlite3 got installed in this port's
+# depends stage, the pre-everything check may have missed this.
+pre-build:
+.if defined(WITH_PGO)
+	@${www_firefox_check_sqlite3_extension} || { \
+	    ${ECHO_CMD} -e ${PGO_FAIL} ; \
+	}
+.endif
+
 port-pre-install:
 	${ECHO_CMD} 'share/applications/${MOZILLA}.desktop' >> ${PLISTF}
 	${ECHO_CMD} "@dirrmtry share/applications" >> ${PLISTD}
--- firefox-4.0_1,1.patch ends here ---


--------------070804080403060103020503--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D909EBB.6080800>