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

Contents of /www-client/mozilla-firefox/mozilla-firefox-3.0.10.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Sun Aug 2 16:27:01 2009 UTC (11 years, 4 months ago) by tommy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
Drop mozilla-firefox-3.0.10, force dep on xulrunner-1.9.0* for mozilla-firefox-3.0.* (proxy commit for mozilla)
(Portage version: 2.2_rc33-r5/cvs/Linux x86_64)

1 # Copyright 1999-2009 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-3.0.10.ebuild,v 1.8 2009/07/21 15:11:05 nirbheek Exp $
4 EAPI="2"
5 WANT_AUTOCONF="2.1"
6
7 inherit flag-o-matic toolchain-funcs eutils mozconfig-3 makeedit multilib fdo-mime autotools mozextension
8 PATCH="${P}-patches-0.1"
9
10 LANGS="af ar be bg bn-IN ca cs cy da de el en-GB en-US eo es-AR es-ES et eu fi fr fy-NL ga-IE gl gu-IN he hi-IN hu id is it ja ka kn ko ku lt lv mk mn mr nb-NO nl nn-NO oc pa-IN pl pt-BR pt-PT ro ru si sk sl sq sr sv-SE te th tr uk zh-CN zh-TW"
11 NOSHORTLANGS="en-GB es-AR pt-BR zh-CN"
12
13 MY_PV=${PV/3/}
14
15 DESCRIPTION="Firefox Web Browser"
16 HOMEPAGE="http://www.mozilla.com/firefox"
17
18 KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86"
19 SLOT="0"
20 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
21 IUSE="java mozdevelop bindist restrict-javascript iceweasel +xulrunner"
22
23 SRC_URI="mirror://gentoo/${P}.tar.bz2
24 http://dev.gentoo.org/~armin76/dist/${P}.tar.bz2
25 mirror://gentoo/${PATCH}.tar.bz2
26 http://dev.gentoo.org/~armin76/dist/${PATCH}.tar.bz2
27 iceweasel? ( mirror://gentoo/iceweasel-icons-3.0.tar.bz2 )
28 !xulrunner? ( mirror://gentoo/xulrunner-1.9${MY_PV}.tar.bz2 )"
29
30 REL_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases"
31 for X in ${LANGS} ; do
32 if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then
33 SRC_URI="${SRC_URI}
34 linguas_${X/-/_}? ( ${REL_URI}/${PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
35 fi
36 IUSE="${IUSE} linguas_${X/-/_}"
37 # english is handled internally
38 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
39 if [ "${X}" != "en-US" ]; then
40 SRC_URI="${SRC_URI}
41 linguas_${X%%-*}? ( ${REL_URI}/${PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
42 fi
43 IUSE="${IUSE} linguas_${X%%-*}"
44 fi
45 done
46
47 RDEPEND="java? ( virtual/jre )
48 >=sys-devel/binutils-2.16.1
49 >=dev-libs/nss-3.12.2
50 >=dev-libs/nspr-4.7.4
51 >=app-text/hunspell-1.1.9
52 >=media-libs/lcms-1.17
53 x11-libs/cairo[X]
54 x11-libs/pango[X]
55 xulrunner? ( >=net-libs/xulrunner-1.9${MY_PV} )"
56
57 DEPEND="${RDEPEND}
58 dev-util/pkgconfig
59 java? ( >=dev-java/java-config-0.2.0 )"
60
61 PDEPEND="restrict-javascript? ( www-plugins/noscript )"
62
63 S="${WORKDIR}/mozilla"
64
65 # Needed by src_compile() and src_install().
66 # Would do in pkg_setup but that loses the export attribute, they
67 # become pure shell variables.
68 export MOZ_CO_PROJECT=browser
69 export BUILD_OFFICIAL=1
70 export MOZILLA_OFFICIAL=1
71
72 linguas() {
73 local LANG SLANG
74 for LANG in ${LINGUAS}; do
75 if has ${LANG} en en_US; then
76 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
77 continue
78 elif has ${LANG} ${LANGS//-/_}; then
79 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
80 continue
81 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
82 for X in ${LANGS}; do
83 if [[ "${X}" == "${LANG}-"* ]] && \
84 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
85 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
86 continue 2
87 fi
88 done
89 fi
90 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
91 done
92 }
93
94 pkg_setup(){
95 if ! use bindist && ! use iceweasel; then
96 elog "You are enabling official branding. You may not redistribute this build"
97 elog "to any users on your network or the internet. Doing so puts yourself into"
98 elog "a legal problem with Mozilla Foundation"
99 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
100
101 fi
102 }
103
104 src_unpack() {
105 ! use xulrunner && unpack xulrunner-1.9${MY_PV}.tar.bz2
106 unpack ${P}.tar.bz2 ${PATCH}.tar.bz2
107
108 if use iceweasel; then
109 unpack iceweasel-icons-3.0.tar.bz2
110
111 cp -r iceweaselicons/browser mozilla/
112 fi
113
114 linguas
115 for X in ${linguas}; do
116 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
117 done
118 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
119 einfo "Selected language packs (first will be default): ${linguas}"
120 fi
121 }
122
123 src_prepare() {
124 # Remove the patches we don't need
125 use xulrunner && rm "${WORKDIR}"/patch/*noxul* || rm "${WORKDIR}"/patch/*xulonly*
126
127 # Apply our patches
128 cd "${S}" || die "cd failed"
129 EPATCH_SUFFIX="patch" \
130 EPATCH_FORCE="yes" \
131 epatch "${WORKDIR}"/patch
132
133 if use iceweasel; then
134 sed -i -e "s|Minefield|Iceweasel|" browser/locales/en-US/chrome/branding/brand.* \
135 browser/branding/nightly/configure.sh
136 fi
137
138 eautoreconf
139
140 # We need to re-patch this because autoreconf overwrites it
141 epatch "${WORKDIR}"/patch/000_flex-configure-LANG.patch
142 }
143
144 src_configure() {
145 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
146 MEXTENSIONS="default,typeaheadfind"
147
148 ####################################
149 #
150 # mozconfig, CFLAGS and CXXFLAGS setup
151 #
152 ####################################
153
154 mozconfig_init
155 mozconfig_config
156
157 # It doesn't compile on alpha without this LDFLAGS
158 use alpha && append-ldflags "-Wl,--no-relax"
159
160 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
161 mozconfig_annotate '' --disable-mailnews
162 mozconfig_annotate 'broken' --disable-mochitest
163 mozconfig_annotate 'broken' --disable-crashreporter
164 mozconfig_annotate '' --enable-system-hunspell
165 #mozconfig_annotate '' --enable-system-sqlite
166 mozconfig_annotate '' --enable-image-encoder=all
167 mozconfig_annotate '' --enable-canvas
168 mozconfig_annotate '' --with-system-nspr
169 mozconfig_annotate '' --with-system-nss
170 mozconfig_annotate '' --enable-system-lcms
171 mozconfig_annotate '' --enable-oji --enable-mathml
172 mozconfig_annotate 'places' --enable-storage --enable-places
173
174 # Other ff-specific settings
175 #mozconfig_use_enable mozdevelop jsd
176 #mozconfig_use_enable mozdevelop xpctools
177 mozconfig_use_extension mozdevelop venkman
178 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
179 if use xulrunner; then
180 # Add xulrunner variable
181 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-1.9
182 fi
183
184 if ! use bindist && ! use iceweasel; then
185 mozconfig_annotate '' --enable-official-branding
186 elif use bindist && ! use iceweasel; then
187 mozconfig_annotate 'bindist' --with-branding=browser/branding/unofficial
188 fi
189
190 # Finalize and report settings
191 mozconfig_final
192
193 ####################################
194 #
195 # Configure and build
196 #
197 ####################################
198
199 if [[ $(gcc-major-version) -lt 4 ]]; then
200 append-cxxflags -fno-stack-protector
201 fi
202
203 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
204 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
205 econf || die
206
207 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
208 # to econf, but the quotes cause configure to fail.
209 sed -i -e \
210 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
211 "${S}"/config/autoconf.mk \
212 "${S}"/toolkit/content/buildconfig.html
213 }
214
215 src_compile() {
216 # Should the build use multiprocessing? Not enabled by default, as it tends to break
217 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
218 emake ${jobs} || die
219 }
220
221 src_install() {
222 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
223
224 emake DESTDIR="${D}" install || die "emake install failed"
225 rm "${D}"/usr/bin/firefox
226
227 linguas
228 for X in ${linguas}; do
229 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
230 done
231
232 use xulrunner && prefs=preferences || prefs=pref
233 cp "${FILESDIR}"/gentoo-default-prefs.js "${D}"${MOZILLA_FIVE_HOME}/defaults/${prefs}/all-gentoo.js
234
235 local LANG=${linguas%% *}
236 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
237 elog "Setting default locale to ${LANG}"
238 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
239 ${MOZILLA_FIVE_HOME}/defaults/${prefs}/firefox.js \
240 ${MOZILLA_FIVE_HOME}/defaults/${prefs}/firefox-l10n.js || \
241 die "sed failed to change locale"
242 fi
243
244 # Install icon and .desktop for menu entry
245 if use iceweasel; then
246 newicon "${S}"/browser/base/branding/icon48.png iceweasel-icon.png
247 newmenu "${FILESDIR}"/icon/iceweasel.desktop \
248 mozilla-firefox-3.0.desktop
249 elif ! use bindist; then
250 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
251 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
252 mozilla-firefox-3.0.desktop
253 else
254 newicon "${S}"/browser/base/branding/icon48.png firefox-icon-unbranded.png
255 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
256 mozilla-firefox-3.0.desktop
257 sed -i -e "s/Bon Echo/Gran Paradiso/" "${D}"/usr/share/applications/mozilla-firefox-3.0.desktop
258 fi
259
260 if use xulrunner; then
261 # Create /usr/bin/firefox
262 cat <<EOF >"${D}"/usr/bin/firefox
263 #!/bin/sh
264 export LD_LIBRARY_PATH="${MOZILLA_FIVE_HOME}"
265 exec "${MOZILLA_FIVE_HOME}"/firefox "\$@"
266 EOF
267 fperms 0755 /usr/bin/firefox
268 else
269 # Create /usr/bin/firefox
270 make_wrapper firefox "${MOZILLA_FIVE_HOME}/firefox"
271
272 # Add vendor
273 echo "pref(\"general.useragent.vendor\",\"Gentoo\");" \
274 >> "${D}"${MOZILLA_FIVE_HOME}/defaults/pref/vendor.js
275 fi
276
277 }
278
279 pkg_postinst() {
280 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
281
282 ewarn "All the packages built against ${PN} won't compile,"
283 ewarn "if after installing firefox 3.0 you get some blockers,"
284 ewarn "please add 'xulrunner' to your USE-flags."
285
286 if use xulrunner; then
287 ln -s /usr/$(get_libdir)/xulrunner-1.9/defaults/autoconfig \
288 ${MOZILLA_FIVE_HOME}/defaults/autoconfig
289 fi
290
291 # Update mimedb for the new .desktop file
292 fdo-mime_desktop_database_update
293 }

  ViewVC Help
Powered by ViewVC 1.1.20