summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Räty <betelgeuse@gentoo.org>2011-01-02 22:28:37 +0000
committerPetteri Räty <betelgeuse@gentoo.org>2011-01-02 22:28:37 +0000
commit08fbe2db294e0cfcb972218534278e00f45cd990 (patch)
treeab9229d061019320abdd73b75e6808b4a72752ef /net-libs
parentStable on amd64 wrt bug #349266 (diff)
downloadhistorical-08fbe2db294e0cfcb972218534278e00f45cd990.tar.gz
historical-08fbe2db294e0cfcb972218534278e00f45cd990.tar.bz2
historical-08fbe2db294e0cfcb972218534278e00f45cd990.zip
Revision to fix printing with latest version of cups. Fixes bug #325469. Committed for Anarchy.
Package-Manager: portage-2.2.0_alpha10/cvs/Linux i686
Diffstat (limited to 'net-libs')
-rw-r--r--net-libs/xulrunner/ChangeLog9
-rw-r--r--net-libs/xulrunner/Manifest14
-rw-r--r--net-libs/xulrunner/files/cups-1.4.4-fixup.patch161
-rw-r--r--net-libs/xulrunner/xulrunner-1.9.2.13-r1.ebuild248
4 files changed, 430 insertions, 2 deletions
diff --git a/net-libs/xulrunner/ChangeLog b/net-libs/xulrunner/ChangeLog
index adc706338583..a26c4556a18b 100644
--- a/net-libs/xulrunner/ChangeLog
+++ b/net-libs/xulrunner/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-libs/xulrunner
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-libs/xulrunner/ChangeLog,v 1.388 2011/01/01 19:56:17 armin76 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-libs/xulrunner/ChangeLog,v 1.389 2011/01/02 22:28:37 betelgeuse Exp $
+
+*xulrunner-1.9.2.13-r1 (02 Jan 2011)
+
+ 02 Jan 2011; Petteri Räty <betelgeuse@gentoo.org>
+ +files/cups-1.4.4-fixup.patch, +xulrunner-1.9.2.13-r1.ebuild:
+ Revision to fix printing with latest version of cups. Fixes bug #325469.
+ Committed for Anarchy.
01 Jan 2011; Raúl Porcel <armin76@gentoo.org> xulrunner-1.9.2.13.ebuild:
alpha/ia64 stable wrt #348316
diff --git a/net-libs/xulrunner/Manifest b/net-libs/xulrunner/Manifest
index 532618ada3f5..a6f1cd7041b8 100644
--- a/net-libs/xulrunner/Manifest
+++ b/net-libs/xulrunner/Manifest
@@ -1,5 +1,9 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
AUX 1009-armv4t-nanojit-v2.patch 12251 RMD160 9e9d862879d4897067605879245c1a6d50cf32fe SHA1 dcfe3da40dc822f2769e244571b721b59e59f322 SHA256 68c4df9c5313b93e8c5d7c7e8ed8375a88e9afa28c05e3965180058ba06cf05b
AUX bug-606109.patch 1243 RMD160 ec262eed0480d8a13c914c4781329e3ea1c23b0f SHA1 0c0cc40ee0a663422b107cc3ae5d1412b8c45ac7 SHA256 266d9c7218cc04c3badadc54f8f31b1238326b9c3052aed057ffce40c69541dc
+AUX cups-1.4.4-fixup.patch 5439 RMD160 e907f65012a88b0810979c0beda4244e817835e6 SHA1 4099626a22b61802c958faad8171d506a95f9fca SHA256 501f95e278c2fdf3dec2b5586a2dc5ae35d78557a0db9939a1501c4782e54be5
AUX fix-animated-gifs.patch 7789 RMD160 a8889110a2daea27e07f92a70df6cb1e39e05546 SHA1 05b335feeefff4f06004a20182f821d998b44879 SHA256 6d85d3c103b0dcdbb073302a4041a37bea97c715384d04d299c1fb49a5da7443
AUX fix_crash_in_windowwatcher.patch 1102 RMD160 d539f5d8d82b389a8b2969a294821fd2d1184dd4 SHA1 0c2a8a36cdff57ba45166c76def0950cce297470 SHA256 5dd5145c1f3c0de1267384f0d68aa48c7cf50ba080d5074144f5b706af85d737
AUX xulrunner-1.9.2-gtk+-2.21.patch 663 RMD160 20e2465da0e6c884527fd7cfebd3bdb2f8f015a9 SHA1 f2b9c26ed255bde672ccc8cb7ae4ae014f52d6f5 SHA256 79c11dc4304d748f3c2d6e451aa6d44dd1bb450d1db671e7fa4a83420c6f2c05
@@ -18,9 +22,17 @@ DIST xulrunner-1.9.2-patches-0.9.tar.bz2 15320 RMD160 2dfb86650c0a9a1f0c5bf86df7
EBUILD xulrunner-1.9.2.11.ebuild 7975 RMD160 91b239d8c77e3a858920df34ce1661d51f1f94e2 SHA1 e55e5de045705b84e2f7fc9340f5210ff86551c2 SHA256 fde53108d3ce8801782a7631a475f143b1d87bc200ab4e4ff5fb1c0ab0b10502
EBUILD xulrunner-1.9.2.12-r1.ebuild 8079 RMD160 aaadfa217b17a64e81ae3f462c5f71f61b83ce9e SHA1 27e28bbf84671d2b9be53acfcad79e1094104280 SHA256 614f5308be6ce7fbe0ac8b0931aea0e3c311cf62dca4a4979857d294c0336d40
EBUILD xulrunner-1.9.2.12.ebuild 8021 RMD160 1b28eb2345b8dab501e5aaf37925e8f2baa43808 SHA1 2436133a5e210cdc534aad857fa8c701b8f7eefe SHA256 da52d497a2dbf1612eb2e630348654ec461745d7aec6aeed941454f24138e415
+EBUILD xulrunner-1.9.2.13-r1.ebuild 8012 RMD160 26955afb1759c00b2d1f02cc6bd417abf5949431 SHA1 9b72a44e83ca329e19b90ece0e1f45a7dfb63fab SHA256 0bc24c7f43188871a5e7bb6dd3695ec9fd3264047224cfcd934216a11fac9c56
EBUILD xulrunner-1.9.2.13.ebuild 7953 RMD160 bf7a6f9dfacf3e873b4e63eb0a5ed5c90d5c2962 SHA1 989faad53b5ecadff3b4031ef59501a216549ba9 SHA256 e590ab1a9f177f37a27bf4fd9331cfa0c68a160830a9761be9e1f88f40b062e8
EBUILD xulrunner-1.9.2.8.ebuild 7748 RMD160 bc4d612d5416475f504776fc4d3f4a93bfbdc051 SHA1 2297747ed5f3813788ec675b4a2619ce2fb9458e SHA256 503bba36ddbb5c2b8d6165a4ed00a0075261d117a69064c8f520f627ef0238e9
EBUILD xulrunner-1.9.2.9-r1.ebuild 7937 RMD160 5786094ed4fa2429e5fc68286ff367f988a7c410 SHA1 52ccf08ede04abc9aa4004eb7f32ec5abf88e9f6 SHA256 56a6c6ebad31089c6fdc91b46882fdb70d8993f4dc31e222fa0a3a6ca3fdfeff
EBUILD xulrunner-1.9.2.9.ebuild 7870 RMD160 18f03150a797b81d51ebd2b0907f4ea3ad7420ef SHA1 fd6458a9c64e39ee43aeb3763211f26528f65c74 SHA256 62d9c1f226a1f1356f41bbef25871141ad40f427d30e201f0579e2ce728ce331
-MISC ChangeLog 53399 RMD160 2a548a406dc0919a5cd2d235ea8596c6dbd84312 SHA1 bd098dff4b7d5dff981545294b4d9141cf145fca SHA256 b0dc69ecee4221141f3ff21d494aea8f782fb8cee4ab6b80ea7605b609bee3c7
+MISC ChangeLog 53658 RMD160 c5e903a7e4e713f0da19163a2275911d63cc861a SHA1 e55d6f46677af9e203a4d5f43fc6392fac741cc1 SHA256 2af8af77d7f5b1353d6004c03cc243c6757bf5e22598ccab797dd1c829e7bd52
MISC metadata.xml 534 RMD160 6f9915565c51559c0e4726fed4e43cffce894306 SHA1 7ababd8846ab59b3ea43ac0153750584aa792055 SHA256 60f561d9e9846e96bfa0d6a9161058986c65dba93879073e7138477b6ce61978
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.16 (GNU/Linux)
+
+iEYEARECAAYFAk0g/CgACgkQcxLzpIGCsLRNSwCaA/tDT4gvz/StoUIyQHb52daa
+n9kAoJo67cRUozlPbzR206tuRDiX6S11
+=4qCG
+-----END PGP SIGNATURE-----
diff --git a/net-libs/xulrunner/files/cups-1.4.4-fixup.patch b/net-libs/xulrunner/files/cups-1.4.4-fixup.patch
new file mode 100644
index 000000000000..a0923e8906e9
--- /dev/null
+++ b/net-libs/xulrunner/files/cups-1.4.4-fixup.patch
@@ -0,0 +1,161 @@
+# HG changeset patch
+# User Matthew Gregan <kinetik@flim.org>
+# Date 1293624205 -3600
+# Node ID ffa1ef8ab52b4081e27aa2b24d14a550386f90db
+# Parent 9e561d402701f46eb56dbadb96b6963f4518cdd0
+Bug 573039 - Construct nsCUPSShim statically and avoid calling PR_UnloadLibrary on libcups after it has been initialized. r=karlt a=clegnitto
+
+diff --git a/mozilla/gfx/src/psshared/nsCUPSShim.cpp b/mozilla/gfx/src/psshared/nsCUPSShim.cpp
+--- a/mozilla/gfx/src/psshared/nsCUPSShim.cpp
++++ b/mozilla/gfx/src/psshared/nsCUPSShim.cpp
+@@ -83,14 +83,8 @@ nsCUPSShim::Init()
+ #endif
+ PR_UnloadLibrary(mCupsLib);
+ mCupsLib = nsnull;
+ return PR_FALSE;
+ }
+ }
+ return PR_TRUE;
+ }
+-
+-nsCUPSShim::~nsCUPSShim()
+-{
+- if (mCupsLib)
+- PR_UnloadLibrary(mCupsLib);
+-}
+diff --git a/mozilla/gfx/src/psshared/nsCUPSShim.h b/mozilla/gfx/src/psshared/nsCUPSShim.h
+--- a/mozilla/gfx/src/psshared/nsCUPSShim.h
++++ b/mozilla/gfx/src/psshared/nsCUPSShim.h
+@@ -81,17 +81,16 @@ typedef int (PR_CALLBACK *CupsAddOptionT
+ int num_options,
+ cups_option_t **options);
+
+ struct PRLibrary;
+
+ class NS_PSSHARED nsCUPSShim {
+ public:
+ nsCUPSShim() : mCupsLib(nsnull) { }
+- ~nsCUPSShim();
+
+ /**
+ * Initialize this object. Attempt to load the CUPS shared
+ * library and find function pointers for the supported
+ * functions (see below).
+ * @return PR_FALSE if the shared library could not be loaded, or if
+ * any of the functions could not be found.
+ * PR_TRUE for successful initialization.
+diff --git a/mozilla/gfx/src/psshared/nsPSPrinters.cpp b/mozilla/gfx/src/psshared/nsPSPrinters.cpp
+--- a/mozilla/gfx/src/psshared/nsPSPrinters.cpp
++++ b/mozilla/gfx/src/psshared/nsPSPrinters.cpp
+@@ -51,32 +51,34 @@
+ #include "plstr.h"
+
+ #define NS_CUPS_PRINTER "CUPS/"
+ #define NS_CUPS_PRINTER_LEN (sizeof(NS_CUPS_PRINTER) - 1)
+
+ /* dummy printer name for the gfx/src/ps driver */
+ #define NS_POSTSCRIPT_DRIVER_NAME "PostScript/"
+
++nsCUPSShim gCupsShim;
++
+ /* Initialize the printer manager object */
+ nsresult
+ nsPSPrinterList::Init()
+ {
+ nsresult rv;
+
+ mPrefSvc = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
+ if (NS_SUCCEEDED(rv))
+ rv = mPrefSvc->GetBranch("print.", getter_AddRefs(mPref));
+ NS_ENSURE_SUCCESS(rv, NS_ERROR_NOT_INITIALIZED);
+
+ // Should we try cups?
+ PRBool useCups = PR_TRUE;
+ rv = mPref->GetBoolPref("postscript.cups.enabled", &useCups);
+- if (useCups)
+- mCups.Init();
++ if (useCups && !gCupsShim.IsInitialized())
++ gCupsShim.Init();
+ return NS_OK;
+ }
+
+
+ /* Check whether the PostScript module has been disabled at runtime */
+ PRBool
+ nsPSPrinterList::Enabled()
+ {
+@@ -94,35 +96,35 @@ nsPSPrinterList::Enabled()
+ /* Fetch a list of printers handled by the PostsScript module */
+ void
+ nsPSPrinterList::GetPrinterList(nsTArray<nsCString>& aList)
+ {
+ aList.Clear();
+
+ // Query CUPS for a printer list. The default printer goes to the
+ // head of the output list; others are appended.
+- if (mCups.IsInitialized()) {
++ if (gCupsShim.IsInitialized()) {
+ cups_dest_t *dests;
+
+- int num_dests = (mCups.mCupsGetDests)(&dests);
++ int num_dests = (gCupsShim.mCupsGetDests)(&dests);
+ if (num_dests) {
+ for (int i = 0; i < num_dests; i++) {
+ nsCAutoString fullName(NS_CUPS_PRINTER);
+ fullName.Append(dests[i].name);
+ if (dests[i].instance != NULL) {
+ fullName.Append("/");
+ fullName.Append(dests[i].instance);
+ }
+ if (dests[i].is_default)
+ aList.InsertElementAt(0, fullName);
+ else
+ aList.AppendElement(fullName);
+ }
+ }
+- (mCups.mCupsFreeDests)(num_dests, dests);
++ (gCupsShim.mCupsFreeDests)(num_dests, dests);
+ }
+
+ // Build the "classic" list of printers -- those accessed by running
+ // an opaque command. This list always contains a printer named "default".
+ // In addition, we look for either an environment variable
+ // MOZILLA_POSTSCRIPT_PRINTER_LIST or a preference setting
+ // print.printer_list, which contains a space-separated list of printer
+ // names.
+diff --git a/mozilla/gfx/src/psshared/nsPSPrinters.h b/mozilla/gfx/src/psshared/nsPSPrinters.h
+--- a/mozilla/gfx/src/psshared/nsPSPrinters.h
++++ b/mozilla/gfx/src/psshared/nsPSPrinters.h
+@@ -37,17 +37,16 @@
+ * ***** END LICENSE BLOCK ***** */
+
+ #ifndef nsPSPrinters_h___
+ #define nsPSPrinters_h___
+
+ #include "nsString.h"
+ #include "nsTArray.h"
+ #include "prtypes.h"
+-#include "nsCUPSShim.h"
+ #include "psSharedCore.h"
+
+ class nsIPrefService;
+ class nsIPrefBranch;
+ class nsCUPSShim;
+
+ class NS_PSSHARED nsPSPrinterList {
+ public:
+@@ -91,12 +90,11 @@ class NS_PSSHARED nsPSPrinterList {
+ * the <type> portion as described for GetPrinterList().
+ * @return The PrinterType value for this name.
+ */
+ static PrinterType GetPrinterType(const nsACString& aName);
+
+ private:
+ nsCOMPtr<nsIPrefService> mPrefSvc;
+ nsCOMPtr<nsIPrefBranch> mPref;
+- nsCUPSShim mCups;
+ };
+
+ #endif /* nsPSPrinters_h___ */
+
+
diff --git a/net-libs/xulrunner/xulrunner-1.9.2.13-r1.ebuild b/net-libs/xulrunner/xulrunner-1.9.2.13-r1.ebuild
new file mode 100644
index 000000000000..8fccb8ea6cf0
--- /dev/null
+++ b/net-libs/xulrunner/xulrunner-1.9.2.13-r1.ebuild
@@ -0,0 +1,248 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/xulrunner/xulrunner-1.9.2.13-r1.ebuild,v 1.1 2011/01/02 22:28:37 betelgeuse Exp $
+
+EAPI="3"
+WANT_AUTOCONF="2.1"
+
+inherit flag-o-matic toolchain-funcs eutils mozconfig-3 makeedit multilib java-pkg-opt-2 autotools python prefix pax-utils
+
+MY_PV="${PV/_rc/rc}" # Handle beta
+MY_PV="${MY_PV/1.9.2/3.6}"
+MAJ_PV="1.9.2" # from mozilla-* branch name
+PATCH="${PN}-1.9.2-patches-0.9"
+
+DESCRIPTION="Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications"
+HOMEPAGE="http://developer.mozilla.org/en/docs/XULRunner"
+SRC_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${MY_PV}/source/firefox-${MY_PV}.source.tar.bz2
+ http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.bz2"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
+SLOT="1.9"
+LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
+IUSE="+alsa debug +ipc libnotify system-sqlite wifi"
+
+RDEPEND="
+ >=sys-devel/binutils-2.16.1
+ >=dev-libs/nss-3.12.8
+ >=dev-libs/nspr-4.8.6
+ system-sqlite? ( >=dev-db/sqlite-3.7.1[fts3,secure-delete] )
+ alsa? ( media-libs/alsa-lib )
+ >=app-text/hunspell-1.2
+ >=x11-libs/cairo-1.8.8[X]
+ x11-libs/pango[X]
+ x11-libs/libXt
+ x11-libs/pixman
+ >=dev-libs/libevent-1.4.7
+ wifi? ( net-wireless/wireless-tools )
+ libnotify? ( >=x11-libs/libnotify-0.4 )"
+
+DEPEND="java? ( >=virtual/jdk-1.4 )
+ ${RDEPEND}
+ =dev-lang/python-2*[threads]
+ dev-util/pkgconfig"
+
+# virtual/jre should not be in DEPEND. bug 325981
+RDEPEND="java? ( >=virtual/jre-1.4 ) ${RDEPEND}"
+
+S="${WORKDIR}/mozilla-${MAJ_PV}"
+
+pkg_setup() {
+ # Ensure we always build with C locale.
+ export LANG="C"
+ export LC_ALL="C"
+ export LC_MESSAGES="C"
+ export LC_CTYPE="C"
+
+ java-pkg-opt-2_pkg_setup
+
+ python_set_active_version 2
+}
+
+src_prepare() {
+ # Apply our patches
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"
+
+ epatch "${FILESDIR}/bug-606109.patch"
+ epatch "${FILESDIR}/fix-animated-gifs.patch"
+ epatch "${FILESDIR}/cups-1.4.4-fixup.patch"
+
+ eprefixify \
+ extensions/java/xpcom/interfaces/org/mozilla/xpcom/Mozilla.java \
+ xpcom/build/nsXPCOMPrivate.h \
+ xulrunner/installer/Makefile.in \
+ xulrunner/app/nsRegisterGREUnix.cpp
+
+ # fix double symbols due to double -ljemalloc
+ sed -i -e '/^LIBS += $(JEMALLOC_LIBS)/s/^/#/' \
+ xulrunner/stub/Makefile.in || die
+
+ # Allow user to apply additional patches without modifing ebuild
+ epatch_user
+
+ # Same as in config/autoconf.mk.in
+ MOZLIBDIR="/usr/$(get_libdir)/${PN}-${MAJ_PV}"
+ SDKDIR="/usr/$(get_libdir)/${PN}-devel-${MAJ_PV}/sdk"
+
+ # Gentoo install dirs
+ sed -i -e "s:@PV@:${MAJ_PV}:" "${S}"/config/autoconf.mk.in \
+ || die "${MAJ_PV} sed failed!"
+
+ # Enable gnomebreakpad
+ if use debug ; then
+ sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
+ "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
+ fi
+
+ eautoreconf
+
+ cd js/src
+ eautoreconf
+}
+
+src_configure() {
+ ####################################
+ #
+ # mozconfig, CFLAGS and CXXFLAGS setup
+ #
+ ####################################
+
+ mozconfig_init
+ mozconfig_config
+
+ MEXTENSIONS="default"
+
+ MOZLIBDIR="/usr/$(get_libdir)/${PN}-${MAJ_PV}"
+
+ # It doesn't compile on alpha without this LDFLAGS
+ use alpha && append-ldflags "-Wl,--no-relax"
+
+ mozconfig_annotate '' --with-default-mozilla-five-home="${MOZLIBDIR}"
+ mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
+ mozconfig_annotate '' --enable-application=xulrunner
+ mozconfig_annotate '' --disable-mailnews
+ mozconfig_annotate 'broken' --disable-crashreporter
+ mozconfig_annotate '' --enable-image-encoder=all
+ mozconfig_annotate '' --enable-canvas
+ mozconfig_annotate 'gtk' --enable-default-toolkit=cairo-gtk2
+ # Bug 60668: Galeon doesn't build without oji enabled, so enable it
+ # regardless of java setting.
+ mozconfig_annotate '' --enable-oji --enable-mathml
+ mozconfig_annotate 'places' --enable-storage --enable-places
+ mozconfig_annotate '' --enable-safe-browsing
+
+ # Build mozdevelop permately
+ mozconfig_annotate '' --enable-jsd --enable-xpctools
+
+ # System-wide install specs
+ mozconfig_annotate '' --disable-installer
+ mozconfig_annotate '' --disable-updater
+ mozconfig_annotate '' --disable-strip
+ mozconfig_annotate '' --disable-install-strip
+
+ # Use system libraries
+ mozconfig_annotate '' --enable-system-cairo
+ mozconfig_annotate '' --enable-system-hunspell
+ mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
+ mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
+ mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
+ mozconfig_annotate '' --with-system-bz2
+ mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
+
+ mozconfig_use_enable ipc # +ipc, upstream default
+ mozconfig_use_enable libnotify
+ mozconfig_use_enable java javaxpcom
+ mozconfig_use_enable wifi necko-wifi
+ mozconfig_use_enable alsa ogg
+ mozconfig_use_enable alsa wave
+ mozconfig_use_enable system-sqlite
+
+ # Debug
+ if use debug ; then
+ mozconfig_annotate 'debug' --disable-optimize
+ mozconfig_annotate 'debug' --enable-debug=-ggdb
+ mozconfig_annotate 'debug' --enable-debug-modules=all
+ mozconfig_annotate 'debug' --enable-debugger-info-modules
+ fi
+
+ # Finalize and report settings
+ mozconfig_final
+
+ if [[ $(gcc-major-version) -lt 4 ]]; then
+ append-flags -fno-stack-protector
+ fi
+
+ ####################################
+ #
+ # Configure and build
+ #
+ ####################################
+
+ # Disable no-print-directory
+ MAKEOPTS=${MAKEOPTS/--no-print-directory/}
+
+ # Ensure that are plugins dir is enabled as default
+ sed -i -e "s:/usr/lib/mozilla/plugins:/usr/$(get_libdir)/nsbrowser/plugins:" \
+ "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path!"
+
+ # hack added to workaround bug 299905 on hosts with libc that doesn't
+ # support tls, (probably will only hit this condition with Gentoo Prefix)
+ tc-has-tls -l || export ac_cv_thread_keyword=no
+
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" PYTHON="$(PYTHON)" econf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ rm "${ED}"/usr/bin/xulrunner
+
+ MOZLIBDIR="/usr/$(get_libdir)/${PN}-${MAJ_PV}"
+ SDKDIR="/usr/$(get_libdir)/${PN}-devel-${MAJ_PV}/sdk"
+
+ if has_multilib_profile; then
+ local config
+ for config in "${ED}"/etc/gre.d/*.system.conf ; do
+ mv "${config}" "${config%.conf}.${CHOST}.conf"
+ done
+ fi
+
+ dodir /usr/bin
+ dosym "${MOZLIBDIR}/xulrunner" "/usr/bin/xulrunner-${MAJ_PV}" || die
+
+ # env.d file for ld search path
+ dodir /etc/env.d
+ echo "LDPATH=${EPREFIX}/${MOZLIBDIR}" > "${ED}"/etc/env.d/08xulrunner || die "env.d failed"
+
+ # Add our defaults to xulrunner and out of firefox
+ cp "${FILESDIR}"/xulrunner-default-prefs.js \
+ "${ED}/${MOZLIBDIR}/defaults/pref/all-gentoo.js" || \
+ die "failed to cp xulrunner-default-prefs.js"
+
+ pax-mark m "${D}"/${MOZLIBDIR}/plugin-container
+
+ if use java ; then
+ java-pkg_regjar "${ED}/${MOZLIBDIR}/javaxpcom.jar"
+ java-pkg_regso "${ED}/${MOZLIBDIR}/libjavaxpcomglue.so"
+ java-pkg_regjar "${ED}/${SDKDIR}/lib/MozillaGlue.jar"
+ java-pkg_regjar "${ED}/${SDKDIR}/lib/MozillaInterfaces.jar"
+ fi
+}
+
+pkg_postinst() {
+ ewarn "If firefox fails to start with \"failed to load xpcom\", run revdep-rebuild"
+ ewarn "If that does not fix the problem, rebuild dev-libs/nss"
+ ewarn "Try dev-util/lafilefixer if you get build failures related to .la files"
+
+ einfo
+ einfo "All prefs can be overridden by the user. The preferences are to make"
+ einfo "use of xulrunner out of the box on an average system without the user"
+ einfo "having to go through and enable the basics."
+
+ einfo
+ ewarn "Any package that requires xulrunner:1.9 slot could and most likely will"
+ ewarn "have issues. These issues should be reported to maintainer, and mozilla herd"
+ ewarn "should be cc'd on the bug report. Thank you anarchy@gentoo.org ."
+}