From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Nov 15 08:30:18 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57AB716A41F for ; Tue, 15 Nov 2005 08:30:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C464543D4C for ; Tue, 15 Nov 2005 08:30:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id jAF8UHOH081919 for ; Tue, 15 Nov 2005 08:30:17 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id jAF8UHPI081917; Tue, 15 Nov 2005 08:30:17 GMT (envelope-from gnats) Resent-Date: Tue, 15 Nov 2005 08:30:17 GMT Resent-Message-Id: <200511150830.jAF8UHPI081917@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Volker Stolz Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADC2116A41F for ; Tue, 15 Nov 2005 08:26:25 +0000 (GMT) (envelope-from stolz@i2.informatik.rwth-aachen.de) Received: from atlas.informatik.rwth-aachen.de (atlas.informatik.RWTH-Aachen.DE [137.226.194.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 21A5D43D4C for ; Tue, 15 Nov 2005 08:26:24 +0000 (GMT) (envelope-from stolz@i2.informatik.rwth-aachen.de) Received: from i2.informatik.rwth-aachen.de (menelaos.informatik.RWTH-Aachen.DE [137.226.194.73]) by atlas.informatik.rwth-aachen.de (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id jAF8QNXB004137 for ; Tue, 15 Nov 2005 09:26:23 +0100 Received: (from stolz@localhost) by i2.informatik.rwth-aachen.de (8.13.1/8.13.1/Submit) id jAF8QNgh087703; Tue, 15 Nov 2005 09:26:23 +0100 (CET) (envelope-from stolz) Message-Id: <200511150826.jAF8QNgh087703@i2.informatik.rwth-aachen.de> Date: Tue, 15 Nov 2005 09:26:23 +0100 (CET) From: Volker Stolz To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/89052: [patch] www/mozilla: Fix ld-run-path issue in libraries X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2005 08:30:18 -0000 >Number: 89052 >Category: ports >Synopsis: [patch] www/mozilla: Fix ld-run-path issue in libraries >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Nov 15 08:30:17 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Volker Stolz >Release: FreeBSD 4.11-STABLE i386 >Organization: Lehrstuhl für Informatik II; RWTH Aachen (c) Universität >Environment: System: FreeBSD menelaos.informatik.rwth-aachen.de 4.11-STABLE FreeBSD 4.11-STABLE #23: Fri Jan 14 09:26:11 CET 2005 root@menelaos.informatik.rwth-aachen.de:/usr/obj/usr/src/sys/MENELAOS i386 >Description: The following patch addresses the issues mentioned in Mozilla Bug #304655 https://bugzilla.mozilla.org/show_bug.cgi?id=304655 To quote the important part: "The problem of course is that the libembedmoz.so doesn't know how to find the other mozilla libs that it needs. Distros hack around this issue by adding ${moz_libdir} to the global ldconfig path. Which of course means that it works with either mozilla or firefox but not both (because one or the other must come first in the ld library search path). Of course the correct solution is simply to link libembedmoz.so using -Wl,-rpath,${moz_libdir}. That way it can find the other libs that it needs." >How-To-Repeat: - Install mozilla - Check devel/devhelp: It runs ldconfig on mozlibdir, which isn't The Right Thing to do and will no longer be required after the patch. - Check x11/yelp: It requires a shell-wrapper setting LD_LIBRARY_PATH, which is no longer necessary - Check x11-toolkits/hs-gtk2hs: There's no way to get the gtkembedmoz-part to work without applying the same hacks as above. Also there seems to be some interference with devel/nspr, but IANAE and cannot grasp the implications of mozilla picking up nspr-config from the port. >Fix: The attached patch sets LDFLAGS appropriately. Some manual intervention for nspr is required. --- moz.diff begins here --- Index: Makefile =================================================================== RCS file: /usr/freebsdcvs/cvs-ports/ports/www/mozilla/Makefile,v retrieving revision 1.206 diff -u -r1.206 Makefile --- Makefile 5 Nov 2005 06:20:20 -0000 1.206 +++ Makefile 15 Nov 2005 08:02:00 -0000 @@ -78,7 +78,7 @@ PLIST= ${WRKDIR}/pkg-plist MOZ_EXTENSIONS= default -CONFIGURE_ENV= LOCALBASE=${LOCALBASE} +CONFIGURE_ENV+= LOCALBASE=${LOCALBASE} LDFLAGS="${LDFLAGS} -Wl,-rpath,${X11BASE}/lib/mozilla" PKGINSTALL= ${WRKDIR}/pkg-install PKGDEINSTALL= ${WRKDIR}/pkg-deinstall FREETYPE_LIB= libfreetype.so.9 @@ -244,6 +244,8 @@ ${WRKSRC}/xpcom/io/nsNativeCharsetUtils.cpp @${REINPLACE_CMD} -E -e 's|libfreetype\.so\.[0-9]+|${FREETYPE_LIB}|g' \ ${WRKSRC}/modules/libpref/src/init/all.js + @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \ + ${WRKSRC}/nsprpub/config/nspr-config.in ${WRKSRC}/nsprpub/config/autoconf.mk.in @for pcfile in ${PKGCONFIG_FILES}; do \ ${REINPLACE_CMD} -e 's|mozilla-xpcom|mozilla-xpcom${MOZ_SUFX}${PKGNAMESUFFIX}|g ; \ s|mozilla-nspr|mozilla-nspr${MOZ_SUFX}${PKGNAMESUFFIX}|g' \ @@ -269,6 +271,9 @@ ${ECHO_CMD} "${PKGNAME}: bind installed with PORT_REPLACES_BASE_BIND causes build problems."; \ ${FALSE}; \ fi + +post-build: + ${REINPLACE_CMD} -e "s|\(Libs:.*\)\($$\)|\1 -Wl,-rpath,${PREFIX}/lib/mozilla\2|" ${WRKSRC}/build/unix/*.pc pre-install: ${RM} -rf ${FAKEDIR} ${PLIST} Index: files/patch-nsprpub_config_autoconf.mk.in =================================================================== RCS file: files/patch-nsprpub_config_autoconf.mk.in diff -N files/patch-nsprpub_config_autoconf.mk.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-nsprpub_config_autoconf.mk.in 14 Nov 2005 17:42:43 -0000 @@ -0,0 +1,16 @@ + +$FreeBSD$ + +--- nsprpub/config/autoconf.mk.in.orig ++++ nsprpub/config/autoconf.mk.in +@@ -32,8 +32,8 @@ + MOD_MINOR_VERSION = @MOD_MINOR_VERSION@ + MOD_PATCH_VERSION = @MOD_PATCH_VERSION@ + +-LIBNSPR = @LIBNSPR@ +-LIBPLC = @LIBPLC@ ++LIBNSPR = -Wl,-rpath,%%PREFIX%%/lib/mozilla @LIBNSPR@ ++LIBPLC = -Wl,-rpath,%%PREFIX%%/lib/mozilla @LIBPLC@ + + CROSS_COMPILE = @CROSS_COMPILE@ + BUILD_OPT = @MOZ_OPTIMIZE@ Index: files/patch-nsprpub_config_nspr-config.in =================================================================== RCS file: files/patch-nsprpub_config_nspr-config.in diff -N files/patch-nsprpub_config_nspr-config.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-nsprpub_config_nspr-config.in 14 Nov 2005 17:46:22 -0000 @@ -0,0 +1,14 @@ + +$FreeBSD$ + +--- nsprpub/config/nspr-config.in.orig ++++ nsprpub/config/nspr-config.in +@@ -95,7 +95,7 @@ + fi + + if test "$echo_libs" = "yes"; then +- libdirs=-L${exec_prefix}/lib ++ libdirs="-Wl,-rpath,%%PREFIX%%/lib/mozilla -L${exec_prefix}/lib" + if test -n "$lib_plds"; then + libdirs="$libdirs -lplds${major_version}" + fi --- moz.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: