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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Apr 28 14:15:02 2009 UTC (11 years, 7 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bump
(Portage version: 2.1.6.7/cvs/Linux ia64)

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.9.ebuild,v 1.1 2009/04/22 18:06:12 armin76 Exp $
4 EAPI="1"
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 # These are in
31 #
32 # http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/linux-i686/xpi/
33 #
34 # for i in $LANGS $SHORTLANGS; do wget $i.xpi -O ${P}-$i.xpi; done
35 for X in ${LANGS} ; do
36 if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then
37 SRC_URI="${SRC_URI}
38 linguas_${X/-/_}? ( http://dev.gentoo.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
39 fi
40 IUSE="${IUSE} linguas_${X/-/_}"
41 # english is handled internally
42 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
43 if [ "${X}" != "en-US" ]; then
44 SRC_URI="${SRC_URI}
45 linguas_${X%%-*}? ( http://dev.gentoo.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
46 fi
47 IUSE="${IUSE} linguas_${X%%-*}"
48 fi
49 done
50
51 RDEPEND="java? ( virtual/jre )
52 >=sys-devel/binutils-2.16.1
53 >=dev-libs/nss-3.12.2
54 >=dev-libs/nspr-4.7.4
55 >=app-text/hunspell-1.1.9
56 >=media-libs/lcms-1.17
57 xulrunner? ( >=net-libs/xulrunner-1.9${MY_PV} )"
58
59 DEPEND="${RDEPEND}
60 dev-util/pkgconfig
61 java? ( >=dev-java/java-config-0.2.0 )"
62
63 PDEPEND="restrict-javascript? ( x11-plugins/noscript )"
64
65 S="${WORKDIR}/mozilla"
66
67 # Needed by src_compile() and src_install().
68 # Would do in pkg_setup but that loses the export attribute, they
69 # become pure shell variables.
70 export MOZ_CO_PROJECT=browser
71 export BUILD_OFFICIAL=1
72 export MOZILLA_OFFICIAL=1
73
74 linguas() {
75 local LANG SLANG
76 for LANG in ${LINGUAS}; do
77 if has ${LANG} en en_US; then
78 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
79 continue
80 elif has ${LANG} ${LANGS//-/_}; then
81 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
82 continue
83 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
84 for X in ${LANGS}; do
85 if [[ "${X}" == "${LANG}-"* ]] && \
86 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
87 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
88 continue 2
89 fi
90 done
91 fi
92 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
93 done
94 }
95
96 pkg_setup(){
97 if ! built_with_use x11-libs/cairo X; then
98 eerror "Cairo is not built with X useflag."
99 eerror "Please add 'X' to your USE flags, and re-emerge cairo."
100 die "Cairo needs X"
101 fi
102
103 if ! built_with_use --missing true x11-libs/pango X; then
104 eerror "Pango is not built with X useflag."
105 eerror "Please add 'X' to your USE flags, and re-emerge pango."
106 die "Pango needs X"
107 fi
108
109 if ! use bindist && ! use iceweasel; then
110 elog "You are enabling official branding. You may not redistribute this build"
111 elog "to any users on your network or the internet. Doing so puts yourself into"
112 elog "a legal problem with Mozilla Foundation"
113 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
114
115 fi
116 }
117
118 src_unpack() {
119 ! use xulrunner && unpack xulrunner-1.9${MY_PV}.tar.bz2
120 unpack ${P}.tar.bz2 ${PATCH}.tar.bz2
121
122 if use iceweasel; then
123 unpack iceweasel-icons-3.0.tar.bz2
124
125 cp -r iceweaselicons/browser mozilla/
126 fi
127
128 linguas
129 for X in ${linguas}; do
130 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
131 done
132 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
133 einfo "Selected language packs (first will be default): ${linguas}"
134 fi
135
136 # Remove the patches we don't need
137 use xulrunner && rm "${WORKDIR}"/patch/*noxul* || rm "${WORKDIR}"/patch/*xulonly*
138
139 # Apply our patches
140 cd "${S}" || die "cd failed"
141 EPATCH_SUFFIX="patch" \
142 EPATCH_FORCE="yes" \
143 epatch "${WORKDIR}"/patch
144
145 if use iceweasel; then
146 sed -i -e "s|Minefield|Iceweasel|" browser/locales/en-US/chrome/branding/brand.* \
147 browser/branding/nightly/configure.sh
148 fi
149
150 eautoreconf
151
152 # We need to re-patch this because autoreconf overwrites it
153 epatch "${WORKDIR}"/patch/000_flex-configure-LANG.patch
154 }
155
156 src_compile() {
157 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
158 MEXTENSIONS="default,typeaheadfind"
159
160 ####################################
161 #
162 # mozconfig, CFLAGS and CXXFLAGS setup
163 #
164 ####################################
165
166 mozconfig_init
167 mozconfig_config
168
169 # It doesn't compile on alpha without this LDFLAGS
170 use alpha && append-ldflags "-Wl,--no-relax"
171
172 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
173 mozconfig_annotate '' --disable-mailnews
174 mozconfig_annotate 'broken' --disable-mochitest
175 mozconfig_annotate 'broken' --disable-crashreporter
176 mozconfig_annotate '' --enable-system-hunspell
177 #mozconfig_annotate '' --enable-system-sqlite
178 mozconfig_annotate '' --enable-image-encoder=all
179 mozconfig_annotate '' --enable-canvas
180 mozconfig_annotate '' --with-system-nspr
181 mozconfig_annotate '' --with-system-nss
182 mozconfig_annotate '' --enable-system-lcms
183 mozconfig_annotate '' --enable-oji --enable-mathml
184 mozconfig_annotate 'places' --enable-storage --enable-places
185
186 # Other ff-specific settings
187 #mozconfig_use_enable mozdevelop jsd
188 #mozconfig_use_enable mozdevelop xpctools
189 mozconfig_use_extension mozdevelop venkman
190 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
191 if use xulrunner; then
192 # Add xulrunner variable
193 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-1.9
194 fi
195
196 if ! use bindist && ! use iceweasel; then
197 mozconfig_annotate '' --enable-official-branding
198 elif use bindist && ! use iceweasel; then
199 mozconfig_annotate 'bindist' --with-branding=browser/branding/unofficial
200 fi
201
202 # Finalize and report settings
203 mozconfig_final
204
205 if [[ $(gcc-major-version) -lt 4 ]]; then
206 append-cxxflags -fno-stack-protector
207 fi
208
209 ####################################
210 #
211 # Configure and build
212 #
213 ####################################
214
215 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
216 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
217 econf || die
218
219 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
220 # to econf, but the quotes cause configure to fail.
221 sed -i -e \
222 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
223 "${S}"/config/autoconf.mk \
224 "${S}"/toolkit/content/buildconfig.html
225
226 # Should the build use multiprocessing? Not enabled by default, as it tends to break
227 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
228 emake ${jobs} || die
229 }
230
231 pkg_preinst() {
232 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
233
234 einfo "Removing old installs with some really ugly code. It potentially"
235 einfo "eliminates any problems during the install, however suggestions to"
236 einfo "replace this are highly welcome. Send comments and suggestions to"
237 einfo "mozilla@gentoo.org."
238 rm -rf "${ROOT}"${MOZILLA_FIVE_HOME}
239 }
240
241 src_install() {
242 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
243
244 emake DESTDIR="${D}" install || die "emake install failed"
245 rm "${D}"/usr/bin/firefox
246
247 linguas
248 for X in ${linguas}; do
249 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
250 done
251
252 use xulrunner && prefs=preferences || prefs=pref
253 cp "${FILESDIR}"/gentoo-default-prefs.js "${D}"${MOZILLA_FIVE_HOME}/defaults/${prefs}/all-gentoo.js
254
255 local LANG=${linguas%% *}
256 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
257 elog "Setting default locale to ${LANG}"
258 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
259 ${MOZILLA_FIVE_HOME}/defaults/${prefs}/firefox.js \
260 ${MOZILLA_FIVE_HOME}/defaults/${prefs}/firefox-l10n.js || \
261 die "sed failed to change locale"
262 fi
263
264 # Install icon and .desktop for menu entry
265 if use iceweasel; then
266 newicon "${S}"/browser/base/branding/icon48.png iceweasel-icon.png
267 newmenu "${FILESDIR}"/icon/iceweasel.desktop \
268 mozilla-firefox-3.0.desktop
269 elif ! use bindist; then
270 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
271 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
272 mozilla-firefox-3.0.desktop
273 else
274 newicon "${S}"/browser/base/branding/icon48.png firefox-icon-unbranded.png
275 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
276 mozilla-firefox-3.0.desktop
277 sed -i -e "s/Bon Echo/Gran Paradiso/" "${D}"/usr/share/applications/mozilla-firefox-3.0.desktop
278 fi
279
280 if use xulrunner; then
281 # Create /usr/bin/firefox
282 cat <<EOF >"${D}"/usr/bin/firefox
283 #!/bin/sh
284 export LD_LIBRARY_PATH="${MOZILLA_FIVE_HOME}"
285 exec "${MOZILLA_FIVE_HOME}"/firefox "\$@"
286 EOF
287 fperms 0755 /usr/bin/firefox
288 else
289 # Create /usr/bin/firefox
290 make_wrapper firefox "${MOZILLA_FIVE_HOME}/firefox"
291
292 # Add vendor
293 echo "pref(\"general.useragent.vendor\",\"Gentoo\");" \
294 >> "${D}"${MOZILLA_FIVE_HOME}/defaults/pref/vendor.js
295 fi
296
297 }
298
299 pkg_postinst() {
300 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
301
302 ewarn "All the packages built against ${PN} won't compile,"
303 ewarn "if after installing firefox 3.0 you get some blockers,"
304 ewarn "please add 'xulrunner' to your USE-flags."
305
306 if use xulrunner; then
307 ln -s /usr/$(get_libdir)/xulrunner-1.9/defaults/autoconfig \
308 ${MOZILLA_FIVE_HOME}/defaults/autoconfig
309 fi
310
311 # Update mimedb for the new .desktop file
312 fdo-mime_desktop_database_update
313 }

  ViewVC Help
Powered by ViewVC 1.1.20