summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Le <r0bertz@gentoo.org>2009-12-17 09:56:25 +0800
committerZhang Le <r0bertz@gentoo.org>2009-12-17 09:56:25 +0800
commit9461add3cae4e813ed4d32b2764207e535af4d11 (patch)
treebd7d6c8cfe7241384a466bfca5db021ff5866597 /net-libs
parentadded xulrunner-1.9.1.5 (diff)
downloadloongson-9461add3cae4e813ed4d32b2764207e535af4d11.tar.gz
loongson-9461add3cae4e813ed4d32b2764207e535af4d11.tar.bz2
loongson-9461add3cae4e813ed4d32b2764207e535af4d11.zip
added xulrunner-1.9.2_beta4.ebuild
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
Diffstat (limited to 'net-libs')
-rw-r--r--net-libs/xulrunner/Manifest7
-rw-r--r--net-libs/xulrunner/files/301-xulrunner-xpctools.diff25
-rw-r--r--net-libs/xulrunner/files/xulrunner-1.9.2_beta4-mips-bus-error.patch24
-rw-r--r--net-libs/xulrunner/files/xulrunner-1.9.2_beta4-mips-n32.patch762
-rw-r--r--net-libs/xulrunner/xulrunner-1.9.2_beta4.ebuild225
5 files changed, 1042 insertions, 1 deletions
diff --git a/net-libs/xulrunner/Manifest b/net-libs/xulrunner/Manifest
index 56addb7..addc708 100644
--- a/net-libs/xulrunner/Manifest
+++ b/net-libs/xulrunner/Manifest
@@ -1,9 +1,11 @@
AUX 000_flex-configure-LANG.patch 1761 RMD160 638ae47607f582d6d264f7b6f4c3626ff60dbcb6 SHA1 db6d868d034b46b63ad292ab2e1c9b889fbeef75 SHA256 88719f2b3ab2be74a4d27173f7464f6fbc8e7697b84e3c32d19cf6e16170e532
AUX 067-fix-includedir-mozilla-plugin.patch 619 RMD160 43fa210f770e36e52c135ff3ea7f3efce548c719 SHA1 da46894e53fe3f046e4338ac89a36f2f04be064b SHA256 5eaf528993bc8cea8bfe209abb8241577322d419bdca19e3551b476756beb25f
AUX 067-force-bundled-ply.patch 560 RMD160 ed07a71c278e80546781387067435b779f3cc2d8 SHA1 040fbfa00135454b51dac33878bf787db5d1bbbe SHA256 a11818c09ab074145b3722bb53095f52d73a8ce84b14a696db01bd2d1eae4090
+AUX 301-xulrunner-xpctools.diff 550 RMD160 12d370d5473de5c54233a70533cd35e37305ef86 SHA1 e3812ce6a4446b0b9d496a9dd4760d03bf0de449 SHA256 6bf510f7df5a41f47501cbdbcffc46d0c04865e3597dc6a575cd4a9cfae1def4
AUX README 145 RMD160 e6b6991f1dc429a081f6f16a0a7a24909c2ee576 SHA1 10e9be7039df62377a2e2ba8358beeceffbbbb07 SHA256 9b7fac0b4b5834c404c392bd34408eb3cbcfc75be6335395f44f8953adc102df
-AUX mips-nanojit.patch 73250 RMD160 a05f165d362030c90032640dcd5e6f0f08394fb4 SHA1 1ab11d21c696c065a83c129c2e4502479b7a518a SHA256 44897089675c782f211e0713eaeafbb0a4c53d30819bfe57411b610cf03a4cde
AUX xulrunner-1.9.0.5-gcc4.4.patch 1893 RMD160 8510bc33a55a1d3580439ed510e4705c3e217e57 SHA1 fcc5577e290e20bfa6bfa052a343dc5fad774250 SHA256 c21cc87796f0f1c3ec0f82e2e907b5a12c800a77d3a909f0d293879df1a23f05
+AUX xulrunner-1.9.2_beta4-mips-bus-error.patch 957 RMD160 fab47698b8e22205d5b43ee3a5268b5776b32663 SHA1 d4bc49bc1d4871ec2001e72825cdf1e0035fd2fa SHA256 609c10f9f35fe039a472e802af8628c89c796f8d257687f05f43fde846d1a109
+AUX xulrunner-1.9.2_beta4-mips-n32.patch 24738 RMD160 63995685e4343420469fbb056e051afd28cc56db SHA1 e6435e8e9b15db8103b6d6d0c9213ce36ec88f94 SHA256 24ac461bffbd7c2978a2cd30dc4cbed95370a77a2db054ade2794e902620d3de
AUX xulrunner-default-prefs.js 677 RMD160 73ec130da332c1d6517a6f838d5fab0cc134289a SHA1 b9efc3ef5e95ad3081f6b68d771e32e848b4b9ac SHA256 53493080276f221f1619153c114caf268206a6fa107972b33a4eb7f1c1cf6fe8
AUX xulrunner-mips-bus-error.patch 1412 RMD160 2194194a38a1631450d199784b80c7f6d344ba16 SHA1 c6e3348db92811224529e119ff483d5d7883c850 SHA256 50afd8bf604c22a4a4f9862618a788b1288e834572955d42a4142a0f578263b5
AUX xulrunner-mips-n32.patch 24732 RMD160 d5020c88801e6647131c6c2d780a90ccc0717c7a SHA1 37be69001a75f62d51e84b8b22f1946c27e8baa1 SHA256 5cce08d42a0cf629717b34ec0310b86080640ff6fe5bc14988d1b046562e7254
@@ -13,14 +15,17 @@ DIST firefox-3.5.2-source.tar.bz2 46787928 RMD160 d5e0b5f0e8b19b216394584ccabf37
DIST firefox-3.5.3.source.tar.bz2 46766383 RMD160 c2487c90b4a9490840817c7b00dcccd68a0c4422 SHA1 83b2625eb74e81b473ac40ac52505e5fc9a497eb SHA256 e6327807ed1dd0c0685f7c2fba1427e7e38b5c92f36811f243861fbd9b7ad2d2
DIST firefox-3.5.4.source.tar.bz2 46905557 RMD160 e89ff54fef6d036538c9779176f5086a8eaa721e SHA1 ce250208371326d03e72a02d223bc136cd376e5d SHA256 b2b0a231aae105090948521a469c5019eb886f0562fa3315a49cebaf74f61be4
DIST firefox-3.5.5.source.tar.bz2 46907137 RMD160 3c2eb5542e2d34773dc52b07b46dcfcd656e5f0d SHA1 a2146fb6dc8e879a78fa13849f187c14d41442ca SHA256 2abe7b5561267c230df27951d1d8c6c5853d06ca2426997fdf0a63c5db689feb
+DIST firefox-3.6b4.source.tar.bz2 48323922 RMD160 b6f74b639bfcb3d34a9f8e8c4cb58bb58e511f6f SHA1 de3b649b54fb9b40b58c2f1b432c0beea39ad732 SHA256 b4d371cc4abf3df36c8cb9738b35ad8d3c4ff57d31c00085a29141fff4c407d7
DIST xulrunner-1.9.0.10-patches-0.1.tar.bz2 7077 RMD160 73612f1b619fef5d02e8c8f8318afe192e435e42 SHA1 8a48e53951216c330d4908def93a5c0201f5a890 SHA256 bc0c0d26258bc17ffa5cd513089fe94395ff8f6c17023cd363fac30cdd675410
DIST xulrunner-1.9.0.10.tar.bz2 34167778 RMD160 96ca5c569bbee78924c6e9cb5fea660870a8c096 SHA1 926d9042557e2d767db91b1d183327713fb090d3 SHA256 fe4091f4de50278567b4e26effea66a998dd41f455077e1e37cff8b3417a8f34
DIST xulrunner-1.9.1.2-patches-0.3.tar.bz2 8839 RMD160 aa1902800aedf3323e1836bb9befea41b2b0d90c SHA1 fc1689350cb3955ef6fceb942627003663464c64 SHA256 9c6bf20c29b0cddd06ba87943962a3870ea5a1beccf0d914bbd671404ea4105a
DIST xulrunner-1.9.1.4-patches-0.1.tar.bz2 8839 RMD160 5bb74a2ba19da3286b8945c01d1c6bbc648bf86a SHA1 a112fa5064362d63946b79168d6fbc1e71936ab8 SHA256 4dc2dde0ed6c1c91ecf38fea48af591ce0c177221751d0cb3a095aa061c12dfe
+DIST xulrunner-1.9.2-patches-0.1.tar.bz2 4605 RMD160 40ec8e43a4023ca13dde67393dca2985e7ada872 SHA1 4afea0024b4dcf674ec2d01ad16996b381d6f24e SHA256 ab2f52153af474c99bd22177653acec6b110b8790fcb7d597b7c95f678076bf5
EBUILD xulrunner-1.9.0.10.ebuild 4924 RMD160 812e4fb1216d76dd84c1041365001bb9291cb448 SHA1 1843a099e8dbf0475cc37ebd41c6e477165579db SHA256 d0fc674b97a2cf9d2a499ec5d7b915c570ca4e88873882c7cc4157500415d59e
EBUILD xulrunner-1.9.1.2-r2.ebuild 7474 RMD160 49e855b27a2e5fe5ff2d458c07565ba03938701f SHA1 047201b9b5666bb38be828e329e3625f4200fcec SHA256 5c6e3add56100feefb7495a04a20d92bd00dce4ba362608c3bb58a19b6515b8f
EBUILD xulrunner-1.9.1.3.ebuild 7514 RMD160 05c795e9800535bd9fd7e3a436a16eb9816b5a54 SHA1 c79f481e071a7ca599408b9bfc4f57c74bfcccb4 SHA256 beab3db2ce9df9868a6a03ba63c3674aee341cdb5a5722c039ed27ea5307181c
EBUILD xulrunner-1.9.1.4.ebuild 8202 RMD160 a45f6115650dbe331d1bcedf1c6aba668ef96707 SHA1 feaa2f533cf918aa4c0847444dc79f5b9ac8051e SHA256 0e85bd01ce7952150d3a2babd4dd9762da32430648c1ad24f8679d6fed0d1f73
EBUILD xulrunner-1.9.1.5.ebuild 8205 RMD160 e0cd323c04ced1b806cf7ab62c85a0f6dda24238 SHA1 5b75566966631290c52d2803ed9d93235d6a8ecc SHA256 57cf9614740fd43cf795e96f30dd641660bd28eaa39801d56a5c08467437dcf0
+EBUILD xulrunner-1.9.2_beta4.ebuild 7060 RMD160 76144fabc75e5a47038a63ad32cd948ad60343e1 SHA1 d71091c7f7a9abf2ad7eb97b7ca610be12b973ba SHA256 b5f20e35d07d09a0cf7f6d5b334271a325e405ef6761b0a98a24d059d070b994
MISC ChangeLog 20231 RMD160 53d013acdc632eee5a57c68cc91590a9d97d322b SHA1 50a8a72f61cdf952923a6c40d3ddbdafa10682fc SHA256 4dc8981ad9cda5b06ff6f5e7b826a01d32082c6a306879ee1e3923a8aa93a449
MISC metadata.xml 263 RMD160 9ed9d79d17d0a991e88c31ae6342996519ffef5b SHA1 0de183203298ce0f1c2ecc3fc8149842c4a0ec60 SHA256 64bfc93c4ab02ef2fe9b61b8157eb722d6cca5d552eecc18eaaf8e95980d2550
diff --git a/net-libs/xulrunner/files/301-xulrunner-xpctools.diff b/net-libs/xulrunner/files/301-xulrunner-xpctools.diff
new file mode 100644
index 0000000..2ff82a5
--- /dev/null
+++ b/net-libs/xulrunner/files/301-xulrunner-xpctools.diff
@@ -0,0 +1,25 @@
+--- js/src/xpconnect/src/Makefile.in~ 2009-09-20 13:13:15.508713367 -0500
++++ js/src/xpconnect/src/Makefile.in 2009-09-20 13:14:30.994713367 -0500
+@@ -77,6 +77,10 @@
+ widget \
+ $(NULL)
+
++ifdef MOZ_XPCTOOLS
++DEFINES += -DXPC_TOOLS_SUPPORT
++REQUIRES += xpctools
++endif
+
+ CPPSRCS = \
+ nsScriptError.cpp \
+@@ -174,11 +178,6 @@
+
+ endif # ENABLE_JIT
+
+-ifdef MOZ_XPCTOOLS
+-DEFINES += -DXPC_TOOLS_SUPPORT
+-REQUIRES += xpctools
+-endif
+-
+ ifdef XPC_IDISPATCH_SUPPORT
+ DEFINES += -DXPC_IDISPATCH_SUPPORT
+ ifdef XPC_COMOBJECT
diff --git a/net-libs/xulrunner/files/xulrunner-1.9.2_beta4-mips-bus-error.patch b/net-libs/xulrunner/files/xulrunner-1.9.2_beta4-mips-bus-error.patch
new file mode 100644
index 0000000..2bf51d7
--- /dev/null
+++ b/net-libs/xulrunner/files/xulrunner-1.9.2_beta4-mips-bus-error.patch
@@ -0,0 +1,24 @@
+--- ./xpcom/glue/nsTArray.h.orig 2009-04-26 01:21:58.000000000 +0800
++++ ./xpcom/glue/nsTArray.h 2009-04-26 01:21:33.000000000 +0800
+@@ -168,6 +168,7 @@
+
+ // The array's elements (prefixed with a Header). This pointer is never
+ // null. If the array is empty, then this will point to sEmptyHdr.
++ void *padding;
+ Header *mHdr;
+ };
+
+diff --git a/layout/svg/base/src/nsSVGGlyphFrame.cpp b/layout/svg/base/src/nsSVGGlyphFrame.cpp
+index 6d452d0..3ce4193 100644
+--- a/layout/svg/base/src/nsSVGGlyphFrame.cpp
++++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp
+@@ -169,8 +169,8 @@ private:
+ PRBool SetupForDirectTextRun(gfxContext *aContext, float aScale);
+ void SetupFor(gfxContext *aContext, float aScale);
+
+- nsSVGGlyphFrame *mSource;
+ nsAutoTArray<CharacterPosition,80> mPositions;
++ nsSVGGlyphFrame *mSource;
+ gfxMatrix mInitialMatrix;
+ // Textrun advance width from start to mCurrentChar, in appunits
+ gfxFloat mCurrentAdvance;
diff --git a/net-libs/xulrunner/files/xulrunner-1.9.2_beta4-mips-n32.patch b/net-libs/xulrunner/files/xulrunner-1.9.2_beta4-mips-n32.patch
new file mode 100644
index 0000000..c1a415d
--- /dev/null
+++ b/net-libs/xulrunner/files/xulrunner-1.9.2_beta4-mips-n32.patch
@@ -0,0 +1,762 @@
+From 1aa3577cf7e79b574bd2cff058ea00221194869b Mon Sep 17 00:00:00 2001
+From: Zhang Le <r0bertz@gentoo.org>
+Date: Thu, 12 Mar 2009 02:24:34 +0800
+Subject: [PATCH 2/2] xulrunner mips n32 ABI patch
+
+Signed-off-by: Zhang Le <r0bertz@gentoo.org>
+---
+ xpcom/reflect/xptcall/src/md/unix/Makefile.in | 5 +
+ .../xptcall/src/md/unix/xptcinvoke_asm_mips64.s | 159 ++++++++++++++
+ .../xptcall/src/md/unix/xptcinvoke_mips64.cpp | 173 ++++++++++++++++
+ .../xptcall/src/md/unix/xptcstubs_asm_mips64.s | 149 +++++++++++++
+ .../xptcall/src/md/unix/xptcstubs_mips64.cpp | 218 ++++++++++++++++++++
+ 5 files changed, 704 insertions(+), 0 deletions(-)
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
+
+diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+index 524174e..63586cf 100644
+--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in
++++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+@@ -274,8 +274,13 @@ endif
+
+ ifeq ($(OS_ARCH),Linux)
+ ifneq (,$(findstring mips, $(OS_TEST)))
++ifneq (,$(findstring mips64, $(OS_TEST)))
++CPPSRCS := xptcinvoke_mips64.cpp xptcstubs_mips64.cpp
++ASFILES := xptcinvoke_asm_mips64.s xptcstubs_asm_mips64.s
++else
+ CPPSRCS := xptcinvoke_mips.cpp xptcstubs_mips.cpp
+ ASFILES := xptcinvoke_asm_mips.s xptcstubs_asm_mips.s
++endif
+ ASFLAGS += -I$(DIST)/include -x assembler-with-cpp
+ endif
+ endif
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
+new file mode 100644
+index 0000000..f146ad8
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
+@@ -0,0 +1,159 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1998
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++#include <sys/regdef.h>
++#include <sys/asm.h>
++
++.text
++.globl invoke_count_words
++.globl invoke_copy_to_stack
++
++LOCALSZ=7 # a0, a1, a2, a3, s0, ra, gp
++FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
++
++RAOFF=FRAMESZ-(1*SZREG)
++A0OFF=FRAMESZ-(2*SZREG)
++A1OFF=FRAMESZ-(3*SZREG)
++A2OFF=FRAMESZ-(4*SZREG)
++A3OFF=FRAMESZ-(5*SZREG)
++S0OFF=FRAMESZ-(6*SZREG)
++GPOFF=FRAMESZ-(7*SZREG)
++
++#
++# _NS_InvokeByIndex_P(that, methodIndex, paramCount, params)
++# a0 a1 a2 a3
++
++NESTED(_NS_InvokeByIndex_P, FRAMESZ, ra)
++ PTR_SUBU sp, FRAMESZ
++ SETUP_GP64(GPOFF, _NS_InvokeByIndex_P)
++
++ REG_S ra, RAOFF(sp)
++ REG_S a0, A0OFF(sp)
++ REG_S a1, A1OFF(sp)
++ REG_S a2, A2OFF(sp)
++ REG_S a3, A3OFF(sp)
++ REG_S s0, S0OFF(sp)
++
++ # invoke_count_words(paramCount, params)
++ move a0, a2
++ move a1, a3
++ jal invoke_count_words
++
++ # invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount,
++ # nsXPTCVariant* s, PRUint32 *reg)
++
++ REG_L a1, A2OFF(sp) # a1 - paramCount
++ REG_L a2, A3OFF(sp) # a2 - params
++
++ # save sp before we copy the params to the stack
++ move t0, sp
++
++ # assume full size of 16 bytes per param to be safe
++ sll v0, 4 # 16 bytes * num params
++ subu sp, sp, v0 # make room
++ move a0, sp # a0 - param stack address
++
++ # create temporary stack space to write int and fp regs
++ subu sp, 64 # 64 = 8 regs of 8 bytes
++ move a3, sp
++
++ # save the old sp and save the arg stack
++ subu sp, sp, 16
++ REG_S t0, 0(sp)
++ REG_S a0, 8(sp)
++
++ # copy the param into the stack areas
++ jal invoke_copy_to_stack
++
++ REG_L t3, 8(sp) # get previous a0
++ REG_L sp, 0(sp) # get orig sp back
++
++ REG_L a0, A0OFF(sp) # a0 - that
++ REG_L a1, A1OFF(sp) # a1 - methodIndex
++
++ # t1 = methodIndex * pow(2, PTRLOG)
++ # (use shift instead of mult)
++ sll t1, a1, PTRLOG
++
++ # calculate the function we need to jump to,
++ # which must then be saved in t9
++ lw t9, 0(a0)
++ addu t9, t9, t1
++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
++ lw t9, (t9)
++#else /* not G++ V3 ABI */
++ lw t9, 2*PTRSIZE(t9)
++#endif /* G++ V3 ABI */
++
++ # get register save area from invoke_copy_to_stack
++ subu t1, t3, 64
++
++ # a1..a7 and f13..f19 should now be set to what
++ # invoke_copy_to_stack told us. skip a0 and f12
++ # because that's the "this" pointer
++
++ REG_L a1, 0(t1)
++ REG_L a2, 8(t1)
++ REG_L a3, 16(t1)
++ REG_L a4, 24(t1)
++ REG_L a5, 32(t1)
++ REG_L a6, 40(t1)
++ REG_L a7, 48(t1)
++
++ l.d $f13, 0(t1)
++ l.d $f14, 8(t1)
++ l.d $f15, 16(t1)
++ l.d $f16, 24(t1)
++ l.d $f17, 32(t1)
++ l.d $f18, 40(t1)
++ l.d $f19, 48(t1)
++
++ # save away our stack pointer and create
++ # the stack pointer for the function
++ move s0, sp
++ move sp, t3
++
++ jalr t9
++
++ move sp, s0
++
++ RESTORE_GP64
++ REG_L ra, RAOFF(sp)
++ REG_L s0, S0OFF(sp)
++ PTR_ADDU sp, FRAMESZ
++ j ra
++.end _NS_InvokeByIndex_P
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
+new file mode 100644
+index 0000000..d1d1a7d
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
+@@ -0,0 +1,173 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1998
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++/* Platform specific code to invoke XPCOM methods on native objects */
++
++#include "xptcprivate.h"
++
++#if (_MIPS_SIM != _ABIN32)
++#error "This code is for MIPS N32 only"
++#endif
++
++extern "C" uint32
++invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s)
++{
++ return paramCount;
++}
++
++extern "C" void
++invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount,
++ nsXPTCVariant* s, PRUint64 *regs)
++{
++#define N_ARG_REGS 7 /* 8 regs minus 1 for "this" ptr */
++
++ for (PRUint32 i = 0; i < paramCount; i++, s++)
++ {
++ if (s->IsPtrData()) {
++ if (i < N_ARG_REGS)
++ regs[i] = (PRUint64)s->ptr;
++ else
++ *d++ = (PRUint64)s->ptr;
++ continue;
++ }
++ switch (s->type) {
++ //
++ // signed types first
++ //
++ case nsXPTType::T_I8:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i8;
++ else
++ *d++ = s->val.i8;
++ break;
++ case nsXPTType::T_I16:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i16;
++ else
++ *d++ = s->val.i16;
++ break;
++ case nsXPTType::T_I32:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i32;
++ else
++ *d++ = s->val.i32;
++ break;
++ case nsXPTType::T_I64:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i64;
++ else
++ *d++ = s->val.i64;
++ break;
++ //
++ // unsigned types next
++ //
++ case nsXPTType::T_U8:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u8;
++ else
++ *d++ = s->val.u8;
++ break;
++ case nsXPTType::T_U16:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u16;
++ else
++ *d++ = s->val.u16;
++ break;
++ case nsXPTType::T_U32:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u32;
++ else
++ *d++ = s->val.u32;
++ break;
++ case nsXPTType::T_U64:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u64;
++ else
++ *d++ = s->val.u64;
++ break;
++ case nsXPTType::T_FLOAT:
++ if (i < N_ARG_REGS)
++ *(float*)&regs[i] = s->val.f;
++ else
++ *(float*)d++ = s->val.f;
++ break;
++ case nsXPTType::T_DOUBLE:
++ if (i < N_ARG_REGS)
++ *(double*)&regs[i] = s->val.d;
++ else
++ *(double*)d++ = s->val.d;
++ break;
++ case nsXPTType::T_BOOL:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.b;
++ else
++ *d++ = s->val.b;
++ break;
++ case nsXPTType::T_CHAR:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.c;
++ else
++ *d++ = s->val.c;
++ break;
++ case nsXPTType::T_WCHAR:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.wc;
++ else
++ *d++ = s->val.wc;
++ break;
++ default:
++ // all the others are plain pointer types
++ if (i < N_ARG_REGS)
++ regs[i] = (PRUint64)s->val.p;
++ else
++ *d++ = (PRUint64)s->val.p;
++ break;
++ }
++ }
++}
++
++extern "C" nsresult _NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
++ PRUint32 paramCount,
++ nsXPTCVariant* params);
++
++EXPORT_XPCOM_API(nsresult)
++NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
++ PRUint32 paramCount, nsXPTCVariant* params)
++{
++ return _NS_InvokeByIndex_P(that, methodIndex, paramCount, params);
++}
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
+new file mode 100644
+index 0000000..dfee24b
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
+@@ -0,0 +1,149 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1998
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++#include <sys/regdef.h>
++#include <sys/asm.h>
++
++LOCALSZ=16
++FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
++
++A1OFF=FRAMESZ-(9*SZREG)
++A2OFF=FRAMESZ-(8*SZREG)
++A3OFF=FRAMESZ-(7*SZREG)
++A4OFF=FRAMESZ-(6*SZREG)
++A5OFF=FRAMESZ-(5*SZREG)
++A6OFF=FRAMESZ-(4*SZREG)
++A7OFF=FRAMESZ-(3*SZREG)
++GPOFF=FRAMESZ-(2*SZREG)
++RAOFF=FRAMESZ-(1*SZREG)
++
++F13OFF=FRAMESZ-(16*SZREG)
++F14OFF=FRAMESZ-(15*SZREG)
++F15OFF=FRAMESZ-(14*SZREG)
++F16OFF=FRAMESZ-(13*SZREG)
++F17OFF=FRAMESZ-(12*SZREG)
++F18OFF=FRAMESZ-(11*SZREG)
++F19OFF=FRAMESZ-(10*SZREG)
++
++#define SENTINEL_ENTRY(n) /* defined in cpp file, not here */
++
++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
++#define STUB_ENTRY(x) \
++ .if x < 10; \
++ MAKE_STUB(x, _ZN14nsXPTCStubBase5Stub ##x ##Ev); \
++ .elseif x < 100; \
++ MAKE_STUB(x, _ZN14nsXPTCStubBase6Stub ##x ##Ev); \
++ .elseif x < 1000; \
++ MAKE_STUB(x, _ZN14nsXPTCStubBase7Stub ##x ##Ev); \
++ .else; \
++ .err; \
++ .endif
++#else /* not G++ V3 ABI */
++#define STUB_ENTRY(x) \
++ MAKE_STUB(x, Stub ##x ##__14nsXPTCStubBase)
++#endif /* G++ V3 ABI */
++
++#define MAKE_STUB(x, name) \
++ .globl name; \
++ .type name,@function; \
++ .aent name,0; \
++name:; \
++ PTR_SUBU sp,FRAMESZ; \
++ SETUP_GP64(GPOFF, name); \
++ li t0,x; \
++ b sharedstub; \
++
++#
++# open a dummy frame for the function entries
++#
++ .text
++ .align 2
++ .type dummy,@function
++ .ent dummy, 0
++dummy:
++ .frame sp, FRAMESZ, ra
++ .mask 0x90000FF0, RAOFF-FRAMESZ
++ .fmask 0x000FF000, F19OFF-FRAMESZ
++
++#include "xptcstubsdef.inc"
++
++sharedstub:
++
++ REG_S a1, A1OFF(sp)
++ REG_S a2, A2OFF(sp)
++ REG_S a3, A3OFF(sp)
++ REG_S a4, A4OFF(sp)
++ REG_S a5, A5OFF(sp)
++ REG_S a6, A6OFF(sp)
++ REG_S a7, A7OFF(sp)
++ REG_S ra, RAOFF(sp)
++
++ s.d $f13, F13OFF(sp)
++ s.d $f14, F14OFF(sp)
++ s.d $f15, F15OFF(sp)
++ s.d $f16, F16OFF(sp)
++ s.d $f17, F17OFF(sp)
++ s.d $f18, F18OFF(sp)
++ s.d $f19, F19OFF(sp)
++
++ # t0 is methodIndex
++ move a1, t0
++
++ # a2 is stack address where extra function params
++ # are stored that do not fit in registers
++ move a2, sp
++ addi a2, FRAMESZ
++
++ # a3 is stack address of a1..a7
++ move a3, sp
++ addi a3, A1OFF
++
++ # a4 is stack address of f13..f19
++ move a4, sp
++ addi a4, F13OFF
++
++ # PrepareAndDispatch(that, methodIndex, args, gprArgs, fpArgs)
++ # a0 a1 a2 a3 a4
++ #
++ jal PrepareAndDispatch
++
++ REG_L ra, RAOFF(sp)
++ RESTORE_GP64
++
++ PTR_ADDU sp, FRAMESZ
++ j ra
++ END(dummy)
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
+new file mode 100644
+index 0000000..c404065
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
+@@ -0,0 +1,218 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1999
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++#include "xptcprivate.h"
++#include "xptiprivate.h"
++
++#if (_MIPS_SIM != _ABIN32)
++#error "This code is for MIPS N32 only"
++#endif
++
++/*
++ * This is for MIPS N32 ABI
++ *
++ * When we're called, the "gp" registers are stored in gprData and
++ * the "fp" registers are stored in fprData. There are 8 regs
++ * available which coorespond to the first 7 parameters of the
++ * function and the "this" pointer. If there are additional parms,
++ * they are stored on the stack at address "args".
++ *
++ */
++extern "C" nsresult
++PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint64* args,
++ PRUint64 *gprData, double *fprData)
++{
++#define PARAM_BUFFER_COUNT 16
++#define PARAM_GPR_COUNT 7
++#define PARAM_FPR_COUNT 7
++
++ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
++ nsXPTCMiniVariant* dispatchParams = NULL;
++ const nsXPTMethodInfo* info;
++ PRUint8 paramCount;
++ PRUint8 i;
++ nsresult result = NS_ERROR_FAILURE;
++
++ NS_ASSERTION(self,"no self");
++
++ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
++ NS_ASSERTION(info,"no method info");
++
++ paramCount = info->GetParamCount();
++
++ // setup variant array pointer
++ if(paramCount > PARAM_BUFFER_COUNT)
++ dispatchParams = new nsXPTCMiniVariant[paramCount];
++ else
++ dispatchParams = paramBuffer;
++ NS_ASSERTION(dispatchParams,"no place for params");
++
++ PRUint64* ap = args;
++ PRUint32 iCount = 0;
++ for(i = 0; i < paramCount; i++)
++ {
++ const nsXPTParamInfo& param = info->GetParam(i);
++ const nsXPTType& type = param.GetType();
++ nsXPTCMiniVariant* dp = &dispatchParams[i];
++
++ if(param.IsOut() || !type.IsArithmetic())
++ {
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.p = (void*)gprData[iCount++];
++ else
++ dp->val.p = (void*)*ap++;
++ continue;
++ }
++ // else
++ switch(type)
++ {
++ case nsXPTType::T_I8:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i8 = (PRInt8)gprData[iCount++];
++ else
++ dp->val.i8 = (PRInt8)*ap++;
++ break;
++
++ case nsXPTType::T_I16:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i16 = (PRInt16)gprData[iCount++];
++ else
++ dp->val.i16 = (PRInt16)*ap++;
++ break;
++
++ case nsXPTType::T_I32:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i32 = (PRInt32)gprData[iCount++];
++ else
++ dp->val.i32 = (PRInt32)*ap++;
++ break;
++
++ case nsXPTType::T_I64:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i64 = (PRInt64)gprData[iCount++];
++ else
++ dp->val.i64 = (PRInt64)*ap++;
++ break;
++
++ case nsXPTType::T_U8:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u8 = (PRUint8)gprData[iCount++];
++ else
++ dp->val.u8 = (PRUint8)*ap++;
++ break;
++
++ case nsXPTType::T_U16:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u16 = (PRUint16)gprData[iCount++];
++ else
++ dp->val.u16 = (PRUint16)*ap++;
++ break;
++
++ case nsXPTType::T_U32:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u32 = (PRUint32)gprData[iCount++];
++ else
++ dp->val.u32 = (PRUint32)*ap++;
++ break;
++
++ case nsXPTType::T_U64:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u64 = (PRUint64)gprData[iCount++];
++ else
++ dp->val.u64 = (PRUint64)*ap++;
++ break;
++
++ case nsXPTType::T_FLOAT:
++ if (iCount < PARAM_FPR_COUNT)
++ dp->val.f = (double)fprData[iCount++];
++ else
++ dp->val.f = *((double*)ap++);
++ break;
++
++ case nsXPTType::T_DOUBLE:
++ if (iCount < PARAM_FPR_COUNT)
++ dp->val.d = (double)fprData[iCount++];
++ else
++ dp->val.d = *((double*)ap++);
++ break;
++
++ case nsXPTType::T_BOOL:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.b = (PRBool)gprData[iCount++];
++ else
++ dp->val.b = (PRBool)*ap++;
++ break;
++
++ case nsXPTType::T_CHAR:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.c = (char)gprData[iCount++];
++ else
++ dp->val.c = (char)*ap++;
++ break;
++
++ case nsXPTType::T_WCHAR:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.wc = (wchar_t)gprData[iCount++];
++ else
++ dp->val.wc = (wchar_t)*ap++;
++ break;
++
++ default:
++ NS_ASSERTION(0, "bad type");
++ break;
++ }
++ }
++
++ result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
++
++ if(dispatchParams != paramBuffer)
++ delete [] dispatchParams;
++
++ return result;
++}
++
++#define STUB_ENTRY(n) /* defined in the assembly file */
++
++#define SENTINEL_ENTRY(n) \
++nsresult nsXPTCStubBase::Sentinel##n() \
++{ \
++ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
++ return NS_ERROR_NOT_IMPLEMENTED; \
++}
++
++#include "xptcstubsdef.inc"
+--
+1.6.2
+
diff --git a/net-libs/xulrunner/xulrunner-1.9.2_beta4.ebuild b/net-libs/xulrunner/xulrunner-1.9.2_beta4.ebuild
new file mode 100644
index 0000000..5c35db7
--- /dev/null
+++ b/net-libs/xulrunner/xulrunner-1.9.2_beta4.ebuild
@@ -0,0 +1,225 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+WANT_AUTOCONF="2.1"
+
+inherit flag-o-matic toolchain-funcs eutils mozconfig-3 makeedit multilib java-pkg-opt-2 autotools
+
+MY_PV="${PV/_beta/b}" # 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.1"
+
+DESCRIPTION="Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications"
+HOMEPAGE="http://developer.mozilla.org/en/docs/XULRunner"
+SRC_URI="http://dev.gentoo.org/~anarchy/dist/firefox-${MY_PV}.source.tar.bz2
+ http://dev.gentoo.org/~anarchy/dist/${PATCH}.tar.bz2"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 -sparc ~x86"
+SLOT="1.9"
+LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
+IUSE="+alsa debug libnotify mozdevelop sqlite +networkmanager"
+
+RDEPEND="java? ( >=virtual/jre-1.4 )
+ >=dev-lang/python-2.3[threads]
+ >=sys-devel/binutils-2.16.1
+ >=dev-libs/nss-3.12.4
+ >=dev-libs/nspr-4.8
+ sqlite? ( >=dev-db/sqlite-3.6.10 )
+ alsa? ( media-libs/alsa-lib )
+ >=app-text/hunspell-1.2
+ >=media-libs/lcms-1.17
+ >=x11-libs/cairo-1.8.8[X]
+ x11-libs/pango[X]
+ x11-libs/libXt
+ networkmanager? ( net-wireless/wireless-tools )
+ libnotify? ( >=x11-libs/libnotify-0.4 )"
+
+DEPEND="java? ( >=virtual/jdk-1.4 )
+ ${RDEPEND}
+ dev-util/pkgconfig"
+
+S="${WORKDIR}/mozilla-${MAJ_PV}"
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+
+ if use sqlite ; then
+ einfo
+ elog "You are enabling system sqlite. Do not file a bug with gentoo if you have"
+ elog "issues that arise from enabling system sqlite. All bugs will be concidered"
+ elog "invalid. All patches are welcomed to fix any issues that might be found with"
+ elog "system sqlite. If you are starting with a fresh profile you can enable sqlite"
+ elog "without any major issues."
+ epause 5
+ fi
+}
+
+src_prepare() {
+ # Apply our patches
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"
+
+ if use mips; then
+ epatch "${FILESDIR}"/${P}-mips-n32.patch
+ epatch "${FILESDIR}"/${P}-mips-bus-error.patch
+ fi
+
+ # Fix build error for xpctools
+ epatch ${FILESDIR}/301-xulrunner-xpctools.diff
+
+ # 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
+
+ # Patch in support to reset all LANG variables to C
+ # Do NOT add to patchset as it must be applied after eautoreconf
+ epatch "${FILESDIR}/000_flex-configure-LANG.patch"
+}
+
+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
+
+ # 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
+ mozconfig_annotate '' --with-system-nss
+ mozconfig_annotate '' --enable-system-lcms
+ mozconfig_annotate '' --with-system-bz2
+
+ mozconfig_use_enable sqlite system-sqlite
+ mozconfig_use_enable libnotify
+ mozconfig_use_enable java javaxpcom
+ mozconfig_use_enable networkmanager necko-wifi
+ # Enable/Disable based on useflag
+ mozconfig_use_enable mozdevelop jsd
+ mozconfig_use_enable mozdevelop xpctools
+ mozconfig_use_enable alsa ogg
+ mozconfig_use_enable alsa wave
+
+ # 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!"
+
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" econf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ rm "${D}"/usr/bin/xulrunner
+
+ MOZLIBDIR="/usr/$(get_libdir)/${PN}-${MAJ_PV}"
+ SDKDIR="/usr/$(get_libdir)/${PN}-devel-${MAJ_PV}/sdk"
+
+ 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=${MOZLIBDIR}" > "${D}"/etc/env.d/08xulrunner || die "env.d failed"
+
+ # Add our defaults to xulrunner and out of firefox
+ cp "${FILESDIR}"/xulrunner-default-prefs.js \
+ "${D}/${MOZLIBDIR}/defaults/pref/all-gentoo.js" || \
+ die "failed to cp xulrunner-default-prefs.js"
+
+ if use java ; then
+ java-pkg_regjar "${D}/${MOZLIBDIR}/javaxpcom.jar"
+ java-pkg_regjar "${D}/${SDKDIR}/lib/MozillaGlue.jar"
+ java-pkg_regjar "${D}/${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 ."
+}