/[gentoo-x86]/www-client/mozilla-firefox/mozilla-firefox-2.0_rc3.ebuild
Gentoo

Contents of /www-client/mozilla-firefox/mozilla-firefox-2.0_rc3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Oct 25 15:27:42 2006 UTC (14 years, 1 month ago) by cardoe
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Anarchy's Changes: Fixed bug #152641 for 1.5.0.7 & 2.0. Removed 1.0.x series. Removed 2.x RCs. Cleaned up old files.
(Portage version: 2.1.2_pre3-r8)
 (Signed Manifest commit)

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-client/mozilla-firefox/mozilla-firefox-2.0_rc3.ebuild,v 1.3 2006/10/18 13:59:36 joslwah Exp $
4
5 inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools
6
7 PATCH="mozilla-firefox-2.0_rc1-patches-1.4"
8 LANGS="ar be bg ca cs da de el en-GB es-AR es-ES eu fi fr fy-NL ga-IE gu-IN hu
9 it ja ko lt mk mn nb-NO nl nn-NO pa-IN pl pt-BR pt-PT ru sk sl sv-SE tr zh-CN
10 zh-TW"
11 NOSHORTLANGS="en-GB es-AR pt-BR zh-TW"
12 MY_PV=${PV/_}
13
14 DESCRIPTION="Firefox Web Browser"
15 HOMEPAGE="http://www.mozilla.org/projects/firefox/"
16
17 KEYWORDS="~alpha ~amd64 ~sparc ~x86 ~ppc"
18 SLOT="0"
19 LICENSE="MPL-1.1 NPL-1.1"
20 IUSE="java mozdevelop branding xforms"
21
22 MOZ_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${MY_PV}"
23 SRC_URI="${MOZ_URI}/source/firefox-${MY_PV}-source.tar.bz2
24 http://gentooexperimental.org/~genstef/dist/${PATCH}.tar.bz2"
25
26 # These are in
27 #
28 # http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${MY_PV}/linux-i686/xpi/
29 #
30 # for i in $LANGS $SHORTLANGS; do wget $i.xpi -O ${P}-$i.xpi; done
31 for X in ${LANGS} ; do
32 SRC_URI="${SRC_URI}
33 linguas_${X/-/_}? ( http://gentooexperimental.org/~genstef/dist/${P}-xpi/${P}-${X}.xpi )"
34 IUSE="${IUSE} linguas_${X/-/_}"
35 # english is handled internally
36 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
37 SRC_URI="${SRC_URI}
38 linguas_${X%%-*}? ( http://gentooexperimental.org/~genstef/dist/${P}-xpi/${P}-${X}.xpi )"
39 IUSE="${IUSE} linguas_${X%%-*}"
40 fi
41 done
42
43 RDEPEND="java? ( virtual/jre )
44 >=www-client/mozilla-launcher-1.39
45 >=sys-devel/binutils-2.16.1
46 >=dev-libs/nss-3.11.1-r1
47 >=dev-libs/nspr-4.6.1
48 ~sys-devel/autoconf-2.13"
49
50 DEPEND="${RDEPEND}
51 java? ( >=dev-java/java-config-0.2.0 )"
52
53 S="${WORKDIR}/mozilla"
54
55 linguas() {
56 local LANG SLANG
57 for LANG in ${LINGUAS}; do
58 if has ${LANG} en en_US; then
59 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
60 continue
61 elif has ${LANG} ${LANGS//-/_}; then
62 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
63 continue
64 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
65 for X in ${LANGS}; do
66 if [[ "${X}" == "${LANG}-"* ]] && \
67 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
68 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
69 continue 2
70 fi
71 done
72 fi
73 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
74 done
75 einfo "Selected language packs (first will be default): $linguas"
76 }
77
78 pkg_setup(){
79 if use branding; then
80 einfo "You are enabling official branding. You may not redistribute this build"
81 einfo "to any users on your network or the internet. Doing so puts yourself into"
82 einfo "a legal problem with mozilla foundation"
83 fi
84
85 [[ `uname -m` = "ppc64" ]] && die "Building on a ppc64 host requires linux32."
86
87
88 }
89
90 src_unpack() {
91
92 unpack ${A%bz2*}bz2
93
94 linguas
95 for X in ${linguas}; do
96 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
97 done
98
99 cd "${S}"
100
101 # Apply our patches
102 EPATCH_FORCE="yes" epatch "${WORKDIR}"/patch
103
104 # Fix a compilation issue using the 32-bit userland with 64-bit kernel on
105 # PowerPC, because with that configuration, it detects a ppc64 system.
106 # -- hansmi, 2005-11-13
107 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then
108 sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \
109 "${S}"/configure
110 sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \
111 "${S}"/security/coreconf/arch.mk
112 fi
113
114 WANT_AUTOCONF="2.1" eautoreconf
115 }
116
117 src_compile() {
118 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
119
120 mozconfig_init
121 mozconfig_config
122
123 mozconfig_annotate '' --enable-application=browser
124 mozconfig_annotate '' --enable-image-encoder=all
125 mozconfig_annotate '' --enable-canvas
126 mozconfig_annotate '' --with-system-nspr
127 mozconfig_annotate '' --with-system-nss
128
129 if use xforms; then
130 mozconfig_annotate '' --enable-extensions=default,xforms,schema-validation,typeaheadfind
131 else
132 mozconfig_annotate '' --enable-extensions=default,typeaheadfind
133 fi
134
135 if use branding; then
136 mozconfig_annotate '' --enable-official-branding
137 fi
138
139 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
140 # regardless of java setting.
141 mozconfig_annotate '' --enable-oji --enable-mathml
142
143 # Other ff-specific settings
144 mozconfig_use_enable mozdevelop jsd
145 mozconfig_use_enable mozdevelop xpctools
146 mozconfig_use_extension mozdevelop venkman
147 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
148
149 # Add build variables
150 mozconfig_build_opts
151
152 # Finalize and report settings
153 mozconfig_final
154
155 # -fstack-protector breaks us
156 if gcc-version ge 4 1; then
157 gcc-specs-ssp && append-flags -fno-stack-protector
158 else
159 gcc-specs-ssp && append-flags -fno-stack-protector-all
160 fi
161 filter-flags -fstack-protector -fstack-protector-all
162
163 ####################################
164 #
165 # Configure and build
166 #
167 ####################################
168
169 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
170 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
171 econf || die
172
173 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
174 # to econf, but the quotes cause configure to fail.
175 sed -i -e \
176 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
177 ${S}/config/autoconf.mk \
178 ${S}/xpfe/global/buildconfig.html
179
180 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
181 # requirements while compiling
182 edit_makefiles
183
184 emake || die
185 }
186
187 pkg_preinst() {
188 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
189
190 einfo "Removing old install to eliminate any problems during install."
191 rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
192 }
193
194 src_install() {
195 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
196
197 # Most of the installation happens here
198 dodir "${MOZILLA_FIVE_HOME}"
199 cp -RL "${S}"/dist/bin/* "${D}"/"${MOZILLA_FIVE_HOME}"/ || die "cp failed"
200
201 linguas
202 for X in ${linguas}; do
203 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
204 done
205
206 local LANG=${linguas%% *}
207 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
208 einfo "Setting default locale to ${LANG}"
209 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
210 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox.js \
211 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox-l10n.js || \
212 die "sed failed to change locale"
213 fi
214
215 # Create /usr/bin/firefox
216 install_mozilla_launcher_stub firefox "${MOZILLA_FIVE_HOME}"
217
218 # Install icon and .desktop for menu entry
219 doicon "${FILESDIR}"/icon/firefox-icon.png
220 newmenu "${FILESDIR}"/icon/mozillafirefox-1.5.desktop \
221 mozillafirefox-2.0.desktop
222
223 # Fix icons to look the same everywhere
224 insinto "${MOZILLA_FIVE_HOME}"/icons
225 doins "${S}"/dist/branding/mozicon16.xpm
226 doins "${S}"/dist/branding/mozicon50.xpm
227
228
229 # Install files necessary for applications to build against firefox
230 einfo "Installing includes and idl files..."
231 dodir "${MOZILLA_FIVE_HOME}"/idl "${MOZILLA_FIVE_HOME}"/include
232 cp -LfR "${S}"/dist/include/* "${D}"/"${MOZILLA_FIVE_HOME}"/include/ || \
233 die "cp failed"
234 cp -LfR "${S}"/dist/idl/* "${D}"/"${MOZILLA_FIVE_HOME}"/idl || \
235 die "cp failed"
236
237 # Dirty hack to get some applications using this header running
238 dosym "${MOZILLA_FIVE_HOME}"/include/necko/nsIURI.h \
239 "${MOZILLA_FIVE_HOME}"/include/nsIURI.h
240
241 # Install pkgconfig files
242 insinto /usr/"$(get_libdir)"/pkgconfig
243 doins "${S}"/build/unix/*.pc
244
245 insinto "${MOZILLA_FIVE_HOME}"/greprefs
246 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
247 insinto "${MOZILLA_FIVE_HOME}"/defaults/pref
248 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
249 }
250
251 pkg_postinst() {
252 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
253
254 # This should be called in the postinst and postrm of all the
255 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
256 # thunderbird-bin ebuilds.
257 update_mozilla_launcher_symlinks
258
259 # Update mimedb for the new .desktop file
260 fdo-mime_desktop_database_update
261
262 elog "Please remember to rebuild any packages that you have built"
263 elog "against firefox. Some packages might be broken by the upgrade; if this"
264 elog "is the case, please search at http://bugs.gentoo.org and open a new bug"
265 elog "if one does not exist. Before filing any bugs, please move or remove ~/.mozilla"
266 elog "and test with a clean profile directory."
267 }
268
269 pkg_postrm() {
270 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
271
272 update_mozilla_launcher_symlinks
273 }

  ViewVC Help
Powered by ViewVC 1.1.20