summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJory Pratt <anarchy@gentoo.org>2010-12-03 12:55:59 +0000
committerJory Pratt <anarchy@gentoo.org>2010-12-03 12:55:59 +0000
commit3d12868effd13012815283959f461fd8078b1915 (patch)
treea0d23be4b79fbac18b88458e90a2d2f59cdf0cf0 /net-libs
parentAutomated update of use.local.desc (diff)
downloadhistorical-3d12868effd13012815283959f461fd8078b1915.tar.gz
historical-3d12868effd13012815283959f461fd8078b1915.tar.bz2
historical-3d12868effd13012815283959f461fd8078b1915.zip
Resovle anitmated gif rendering when using cairo-1.10.0, bug #337813
Package-Manager: portage-2.2.0_alpha6/cvs/Linux x86_64
Diffstat (limited to 'net-libs')
-rw-r--r--net-libs/xulrunner/ChangeLog8
-rw-r--r--net-libs/xulrunner/Manifest4
-rw-r--r--net-libs/xulrunner/files/fix-animated-gifs.patch246
-rw-r--r--net-libs/xulrunner/xulrunner-1.9.2.12-r1.ebuild249
4 files changed, 505 insertions, 2 deletions
diff --git a/net-libs/xulrunner/ChangeLog b/net-libs/xulrunner/ChangeLog
index f2bbe2971579..78a050f0dfab 100644
--- a/net-libs/xulrunner/ChangeLog
+++ b/net-libs/xulrunner/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-libs/xulrunner
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-libs/xulrunner/ChangeLog,v 1.378 2010/11/14 12:44:53 armin76 Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-libs/xulrunner/ChangeLog,v 1.379 2010/12/03 12:55:59 anarchy Exp $
+
+*xulrunner-1.9.2.12-r1 (03 Dec 2010)
+
+ 03 Dec 2010; Jory A. Pratt <anarchy@gentoo.org>
+ +xulrunner-1.9.2.12-r1.ebuild, +files/fix-animated-gifs.patch:
+ Resovle anitmated gif rendering when using cairo-1.10.0, bug #337813
14 Nov 2010; Raúl Porcel <armin76@gentoo.org> xulrunner-1.9.2.12.ebuild:
alpha/ia64/sparc stable wrt #342847
diff --git a/net-libs/xulrunner/Manifest b/net-libs/xulrunner/Manifest
index d3c423b9fb72..be1cec0e5312 100644
--- a/net-libs/xulrunner/Manifest
+++ b/net-libs/xulrunner/Manifest
@@ -1,5 +1,6 @@
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 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
AUX xulrunner-1.9.2-noalsa-fixup.patch 1031 RMD160 6eae45ee3e29fa47a7b31688cfcbfb594fcdd79b SHA1 845d4962708281bbd0cba45db82335739a50897b SHA256 1c4e017b6a8d81267a9d4b29b10cc4cfe69b090f8f8903a663f25b5e300eddd5
@@ -13,9 +14,10 @@ DIST firefox-3.6.9.source.tar.bz2 51240588 RMD160 530b1d64cc02ba0433c3a39d1c97c5
DIST xulrunner-1.9.2-patches-0.6.tar.bz2 16308 RMD160 6066ea0b01f8b6c9eae1a0692ad9a07f04ab7327 SHA1 ebba861e23ef36256dc29d7d04820222be8e4241 SHA256 6a9d709f9ee15d6c139a35f8a6826cd7b473188290bd5e81e56297d8f36e2235
DIST xulrunner-1.9.2-patches-0.7.tar.bz2 16366 RMD160 2bfa5f56d58d5bb4508512190cf07454814fb0b5 SHA1 2c6e2cfb0c50a5595795561126de26941dbed576 SHA256 3e25e9b8d5fe9109f03889bca9240f92acd502fd68efe0e7eda304f5487b6bf0
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.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 52264 RMD160 d8429688119e31f022e10b93c7a37860c7241545 SHA1 cede1f534b8e28d2c51e65252a7d9edbff033d40 SHA256 e80cc32c8d25e23ec969112aa6b3e50a6ee3c27dfb94f06649b85b3e2a6d93e4
+MISC ChangeLog 52489 RMD160 6218a5507698484f30c623d50567da999b1cd299 SHA1 81fb42e1e9cebf4e99d530fd11efd503cb9b6add SHA256 3a3fcb919eaa8d6d1946d2f34103de83bd53c1e23b61aefdf75c2784237e27d6
MISC metadata.xml 534 RMD160 6f9915565c51559c0e4726fed4e43cffce894306 SHA1 7ababd8846ab59b3ea43ac0153750584aa792055 SHA256 60f561d9e9846e96bfa0d6a9161058986c65dba93879073e7138477b6ce61978
diff --git a/net-libs/xulrunner/files/fix-animated-gifs.patch b/net-libs/xulrunner/files/fix-animated-gifs.patch
new file mode 100644
index 000000000000..58b994cdd871
--- /dev/null
+++ b/net-libs/xulrunner/files/fix-animated-gifs.patch
@@ -0,0 +1,246 @@
+# HG changeset patch
+# User Rafał Mużyło <galtgendo@o2.pl>
+# Parent 69e253891ca3839b6d4b8f5cb7c0e6950bb66902
+Fix animated gif flickering bug 597174
+
+diff --git a/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp b/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
+--- a/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
++++ b/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
+@@ -197,30 +197,29 @@ static NS_METHOD ReadDataOut(nsIInputStr
+ }
+
+ // Push any new rows according to mCurrentPass/mLastFlushedPass and
+ // mCurrentRow/mLastFlushedRow. Note: caller is responsible for
+ // updating mlastFlushed{Row,Pass}.
+ nsresult
+ nsGIFDecoder2::FlushImageData(PRUint32 fromRow, PRUint32 rows)
+ {
+- nsIntRect r(0, fromRow, mGIFStruct.width, rows);
++ nsIntRect r(mGIFStruct.x_offset, mGIFStruct.y_offset + fromRow, mGIFStruct.width, rows);
+
+ // Update image
+ nsresult rv = mImageContainer->FrameUpdated(mGIFStruct.images_decoded, r);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ // Offset to the frame position
+ // Only notify observer(s) for first frame
+ if (!mGIFStruct.images_decoded && mObserver) {
+ PRUint32 imgCurFrame;
+ mImageContainer->GetCurrentFrameIndex(&imgCurFrame);
+- r.y += mGIFStruct.y_offset;
+ mObserver->OnDataAvailable(nsnull, imgCurFrame == PRUint32(mGIFStruct.images_decoded), &r);
+ }
+ return NS_OK;
+ }
+
+ nsresult
+ nsGIFDecoder2::FlushImageData()
+ {
+diff --git a/modules/libpr0n/src/imgContainer.cpp b/modules/libpr0n/src/imgContainer.cpp
+--- a/modules/libpr0n/src/imgContainer.cpp
++++ b/modules/libpr0n/src/imgContainer.cpp
+@@ -415,16 +415,18 @@ nsresult imgContainer::InternalAddFrameH
+
+ nsAutoPtr<imgFrame> frame(aFrame);
+
+ if (paletteData && paletteLength)
+ frame->GetPaletteData(paletteData, paletteLength);
+
+ frame->GetImageData(imageData, imageLength);
+
++ frame->LockImageData();
++
+ mFrames.InsertElementAt(framenum, frame.forget());
+ mNumFrames++;
+
+ return NS_OK;
+ }
+
+ nsresult imgContainer::InternalAddFrame(PRUint32 framenum,
+ PRInt32 aX, PRInt32 aY,
+@@ -440,16 +442,21 @@ nsresult imgContainer::InternalAddFrame(
+ return NS_ERROR_INVALID_ARG;
+
+ nsAutoPtr<imgFrame> frame(new imgFrame());
+ NS_ENSURE_TRUE(frame, NS_ERROR_OUT_OF_MEMORY);
+
+ nsresult rv = frame->Init(aX, aY, aWidth, aHeight, aFormat, aPaletteDepth);
+ NS_ENSURE_SUCCESS(rv, rv);
+
++ if (mFrames.Length() > 0) {
++ imgFrame *prevframe = mFrames.ElementAt(mFrames.Length() - 1);
++ prevframe->UnlockImageData();
++ }
++
+ if (mFrames.Length() == 0) {
+ return InternalAddFrameHelper(framenum, frame.forget(), imageData, imageLength,
+ paletteData, paletteLength);
+ }
+
+ if (mFrames.Length() == 1) {
+ // Since we're about to add our second frame, initialize animation stuff
+ if (!ensureAnimExists())
+diff --git a/modules/libpr0n/src/imgFrame.cpp b/modules/libpr0n/src/imgFrame.cpp
+--- a/modules/libpr0n/src/imgFrame.cpp
++++ b/modules/libpr0n/src/imgFrame.cpp
+@@ -152,16 +152,17 @@ imgFrame::imgFrame() :
+ mBlendMethod(1), /* imgIContainer::kBlendOver */
+ mSinglePixel(PR_FALSE),
+ mNeverUseDeviceSurface(PR_FALSE),
+ mFormatChanged(PR_FALSE),
+ mCompositingFailed(PR_FALSE)
+ #ifdef USE_WIN_SURFACE
+ , mIsDDBSurface(PR_FALSE)
+ #endif
++ , mLocked(PR_FALSE)
+ {
+ static PRBool hasCheckedOptimize = PR_FALSE;
+ if (!hasCheckedOptimize) {
+ if (PR_GetEnv("MOZ_DISABLE_IMAGE_OPTIMIZE")) {
+ gDisableOptimize = PR_TRUE;
+ }
+ hasCheckedOptimize = PR_TRUE;
+ }
+@@ -413,18 +414,17 @@ void imgFrame::Draw(gfxContext *aContext
+ nsRefPtr<gfxASurface> surface;
+ gfxImageSurface::gfxImageFormat format;
+
+ NS_ASSERTION(!sourceRect.Intersect(subimage).IsEmpty(),
+ "We must be allowed to sample *some* source pixels!");
+
+ PRBool doTile = !imageRect.Contains(sourceRect);
+ if (doPadding || doPartialDecode) {
+- gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height) +
+- gfxPoint(aPadding.left, aPadding.top);
++ gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height);
+
+ if (!doTile && !mSinglePixel) {
+ // Not tiling, and we have a surface, so we can account for
+ // padding and/or a partial decode just by twiddling parameters.
+ // First, update our user-space fill rect.
+ sourceRect = sourceRect.Intersect(available);
+ gfxMatrix imageSpaceToUserSpace = userSpaceToImageSpace;
+ imageSpaceToUserSpace.Invert();
+@@ -708,17 +708,17 @@ nsresult imgFrame::ImageUpdated(const ns
+ mem->IsLowMemory(&lowMemory);
+ if (lowMemory)
+ return NS_ERROR_OUT_OF_MEMORY;
+
+ mDecoded.UnionRect(mDecoded, aUpdateRect);
+
+ // clamp to bounds, in case someone sends a bogus updateRect (I'm looking at
+ // you, gif decoder)
+- nsIntRect boundsRect(0, 0, mSize.width, mSize.height);
++ nsIntRect boundsRect(mOffset, mSize);
+ mDecoded.IntersectRect(mDecoded, boundsRect);
+
+ #ifdef XP_MACOSX
+ if (mQuartzSurface)
+ mQuartzSurface->Flush();
+ #endif
+ return NS_OK;
+ }
+@@ -806,17 +806,23 @@ void imgFrame::GetPaletteData(PRUint32 *
+ *aPalette = (PRUint32 *) mPalettedImageData;
+ *length = PaletteDataLength();
+ }
+ }
+
+ nsresult imgFrame::LockImageData()
+ {
+ if (mPalettedImageData)
+- return NS_OK;
++ return NS_ERROR_NOT_AVAILABLE;
++
++ NS_ABORT_IF_FALSE(!mLocked, "Trying to lock already locked image data.");
++ if (mLocked) {
++ return NS_ERROR_FAILURE;
++ }
++ mLocked = PR_TRUE;
+
+ if ((mOptSurface || mSinglePixel) && !mImageSurface) {
+ // Recover the pixels
+ mImageSurface = new gfxImageSurface(gfxIntSize(mSize.width, mSize.height),
+ gfxImageSurface::ImageFormatARGB32);
+ if (!mImageSurface || mImageSurface->CairoStatus())
+ return NS_ERROR_OUT_OF_MEMORY;
+
+@@ -832,23 +838,35 @@ nsresult imgFrame::LockImageData()
+ #ifdef USE_WIN_SURFACE
+ mWinSurface = nsnull;
+ #endif
+ #ifdef XP_MACOSX
+ mQuartzSurface = nsnull;
+ #endif
+ }
+
++ if (mImageSurface)
++ mImageSurface->Flush();
++
+ return NS_OK;
+ }
+
+ nsresult imgFrame::UnlockImageData()
+ {
+ if (mPalettedImageData)
+- return NS_OK;
++ return NS_ERROR_NOT_AVAILABLE;
++
++ NS_ABORT_IF_FALSE(mLocked, "Unlocking an unlocked image!");
++ if (!mLocked) {
++ return NS_ERROR_FAILURE;
++ }
++ mLocked = PR_FALSE;
++
++ if (mImageSurface)
++ mImageSurface->MarkDirty();
+
+ #ifdef XP_MACOSX
+ if (mQuartzSurface)
+ mQuartzSurface->Flush();
+ #endif
+ return NS_OK;
+ }
+
+@@ -895,17 +913,17 @@ PRInt32 imgFrame::GetBlendMethod() const
+
+ void imgFrame::SetBlendMethod(PRInt32 aBlendMethod)
+ {
+ mBlendMethod = (PRInt8)aBlendMethod;
+ }
+
+ PRBool imgFrame::ImageComplete() const
+ {
+- return mDecoded == nsIntRect(0, 0, mSize.width, mSize.height);
++ return mDecoded == nsIntRect(mOffset, mSize);
+ }
+
+ // A hint from the image decoders that this image has no alpha, even
+ // though we created is ARGB32. This changes our format to RGB24,
+ // which in turn will cause us to Optimize() to RGB24. Has no effect
+ // after Optimize() is called, though in all cases it will be just a
+ // performance win -- the pixels are still correct and have the A byte
+ // set to 0xff.
+diff --git a/modules/libpr0n/src/imgFrame.h b/modules/libpr0n/src/imgFrame.h
+--- a/modules/libpr0n/src/imgFrame.h
++++ b/modules/libpr0n/src/imgFrame.h
+@@ -167,16 +167,17 @@ private: // data
+
+ gfxASurface::gfxImageFormat mFormat;
+ PRInt8 mPaletteDepth;
+ PRInt8 mBlendMethod;
+ PRPackedBool mSinglePixel;
+ PRPackedBool mNeverUseDeviceSurface;
+ PRPackedBool mFormatChanged;
+ PRPackedBool mCompositingFailed;
++ PRPackedBool mLocked;
+
+ #ifdef XP_WIN
+ PRPackedBool mIsDDBSurface;
+ #endif
+
+ };
+
+ #endif /* imgFrame_h */
diff --git a/net-libs/xulrunner/xulrunner-1.9.2.12-r1.ebuild b/net-libs/xulrunner/xulrunner-1.9.2.12-r1.ebuild
new file mode 100644
index 000000000000..5f716520b96d
--- /dev/null
+++ b/net-libs/xulrunner/xulrunner-1.9.2.12-r1.ebuild
@@ -0,0 +1,249 @@
+# Copyright 1999-2010 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.12-r1.ebuild,v 1.1 2010/12/03 12:55:59 anarchy 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.7"
+
+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_EXCLUDE="2001_mozilla_ps_pdf_simplify_operators.patch" \
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"
+
+ epatch "${FILESDIR}/bug-606109.patch"
+ epatch "${FILESDIR}/${PN}-1.9.2-gtk+-2.21.patch"
+ epatch "${FILESDIR}/fix-animated-gifs.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 ."
+}