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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Mon Aug 4 16:19:22 2008 UTC (12 years, 3 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
old
(Portage version: 2.1.4.4)

1 # Copyright 1999-2008 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.0.15.ebuild,v 1.6 2008/07/05 15:16:42 ranger Exp $
4
5 WANT_AUTOCONF="2.1"
6
7 inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools
8
9 PATCH="${P}-patches-0.1"
10 LANGS="af ar be bg ca cs da de el en-GB en-US es-AR es-ES eu fi fr fy-NL ga-IE gu-IN he hu it ja ka ko ku lt mk mn nb-NO nl nn-NO pa-IN pl pt-BR pt-PT ro ru sk sl sv-SE tr uk zh-CN zh-TW"
11 NOSHORTLANGS="en-GB es-AR pt-BR zh-TW"
12
13 DESCRIPTION="Firefox Web Browser"
14 HOMEPAGE="http://www.mozilla.com/firefox"
15
16 KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd"
17 SLOT="0"
18 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
19 IUSE="java mozdevelop bindist xforms restrict-javascript filepicker iceweasel"
20
21 MOZ_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PV}"
22 SRC_URI="${MOZ_URI}/source/firefox-${PV}-source.tar.bz2
23 mirror://gentoo/${PATCH}.tar.bz2
24 iceweasel? ( mirror://gentoo/iceweasel-icons-2.0.0.11.tar.bz2 )"
25
26 # These are in
27 #
28 # http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${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 if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then
33 SRC_URI="${SRC_URI}
34 linguas_${X/-/_}? ( http://dev.gentoo.org/~armin76/dist/${P}-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%%-*}? ( http://dev.gentoo.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
42 fi
43 IUSE="${IUSE} linguas_${X%%-*}"
44 fi
45 done
46
47 RDEPEND="java? ( virtual/jre )
48 >=www-client/mozilla-launcher-1.55
49 >=sys-devel/binutils-2.16.1
50 >=dev-libs/nss-3.11.8
51 >=dev-libs/nspr-4.6.8"
52
53 DEPEND="${RDEPEND}
54 java? ( >=dev-java/java-config-0.2.0 )"
55
56 PDEPEND="restrict-javascript? ( x11-plugins/noscript )"
57
58 S="${WORKDIR}/mozilla"
59
60 # Needed by src_compile() and src_install().
61 # Would do in pkg_setup but that loses the export attribute, they
62 # become pure shell variables.
63 export MOZ_CO_PROJECT=browser
64 export BUILD_OFFICIAL=1
65 export MOZILLA_OFFICIAL=1
66
67 linguas() {
68 local LANG SLANG
69 for LANG in ${LINGUAS}; do
70 if has ${LANG} en en_US; then
71 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
72 continue
73 elif has ${LANG} ${LANGS//-/_}; then
74 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
75 continue
76 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
77 for X in ${LANGS}; do
78 if [[ "${X}" == "${LANG}-"* ]] && \
79 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
80 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
81 continue 2
82 fi
83 done
84 fi
85 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
86 done
87 }
88
89 pkg_setup(){
90 if ! built_with_use x11-libs/cairo X; then
91 eerror "Cairo is not built with X useflag."
92 eerror "Please add 'X' to your USE flags, and re-emerge cairo."
93 die "Cairo needs X"
94 fi
95
96 if ! built_with_use --missing true x11-libs/pango X; then
97 eerror "Pango is not built with X useflag."
98 eerror "Please add 'X' to your USE flags, and re-emerge pango."
99 die "Pango needs X"
100 fi
101
102 if ! use bindist && ! use iceweasel; then
103 elog "You are enabling official branding. You may not redistribute this build"
104 elog "to any users on your network or the internet. Doing so puts yourself into"
105 elog "a legal problem with Mozilla Foundation"
106 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
107
108 fi
109
110 use moznopango && warn_mozilla_launcher_stub
111 }
112
113 src_unpack() {
114 unpack firefox-${PV}-source.tar.bz2 ${PATCH}.tar.bz2
115
116 if use iceweasel; then
117 unpack iceweasel-icons-2.0.0.11.tar.bz2
118
119 cp -r iceweaselicons/browser mozilla/
120 fi
121
122 linguas
123 for X in ${linguas}; do
124 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
125 done
126 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
127 einfo "Selected language packs (first will be default): ${linguas}"
128 fi
129
130 # Apply our patches
131 cd "${S}" || die "cd failed"
132 EPATCH_SUFFIX="patch" \
133 EPATCH_FORCE="yes" \
134 epatch "${WORKDIR}"/patch
135
136 if use filepicker; then
137 epatch "${FILESDIR}"/mozilla-filepicker.patch
138 fi
139
140 if use iceweasel; then
141 sed -i -e "s|Bon Echo|Iceweasel|" browser/locales/en-US/chrome/branding/brand.*
142 sed -i -e "s|BonEcho|Iceweasel|" configure.in
143 fi
144
145 #Don't strip extension
146 sed -i -e 's/STRIP_/#STRIP_/g' extensions/xforms/Makefile.in
147
148 eautoreconf
149 }
150
151 src_compile() {
152 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
153
154 mozconfig_init
155 mozconfig_config
156
157 mozconfig_annotate '' --enable-application=browser
158 mozconfig_annotate '' --enable-image-encoder=all
159 mozconfig_annotate '' --enable-canvas
160 mozconfig_annotate '' --with-system-nspr
161 mozconfig_annotate '' --with-system-nss
162
163 if use xforms; then
164 mozconfig_annotate '' --enable-extensions=default,xforms,schema-validation,typeaheadfind
165 else
166 mozconfig_annotate '' --enable-extensions=default,typeaheadfind
167 fi
168
169 if use ia64; then
170 echo "ac_cv_visibility_pragma=no" >> "${S}/.mozconfig"
171 fi
172
173 if ! use bindist && ! use iceweasel; then
174 mozconfig_annotate '' --enable-official-branding
175 fi
176
177 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
178 # regardless of java setting.
179 mozconfig_annotate '' --enable-oji --enable-mathml
180
181 # Other ff-specific settings
182 mozconfig_use_enable mozdevelop jsd
183 mozconfig_use_enable mozdevelop xpctools
184 mozconfig_use_extension mozdevelop venkman
185 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
186
187 # Finalize and report settings
188 mozconfig_final
189
190 # -fstack-protector breaks us
191 if gcc-version ge 4 1; then
192 gcc-specs-ssp && append-flags -fno-stack-protector
193 else
194 gcc-specs-ssp && append-flags -fno-stack-protector-all
195 fi
196 filter-flags -fstack-protector -fstack-protector-all
197
198 ####################################
199 #
200 # Configure and build
201 #
202 ####################################
203
204 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
205 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
206 econf || die
207
208 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
209 # to econf, but the quotes cause configure to fail.
210 sed -i -e \
211 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
212 "${S}"/config/autoconf.mk \
213 "${S}"/toolkit/content/buildconfig.html
214
215 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
216 # requirements while compiling
217 edit_makefiles
218
219 # Should the build use multiprocessing? Not enabled by default, as it tends to break
220 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
221 emake ${jobs} || die
222 }
223
224 pkg_preinst() {
225 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
226
227 einfo "Removing old installs with some really ugly code. It potentially"
228 einfo "eliminates any problems during the install, however suggestions to"
229 einfo "replace this are highly welcome. Send comments and suggestions to"
230 einfo "mozilla@gentoo.org."
231 rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
232 }
233
234 src_install() {
235 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
236
237 # Most of the installation happens here
238 dodir "${MOZILLA_FIVE_HOME}"
239 cp -RL "${S}"/dist/bin/* "${D}"/"${MOZILLA_FIVE_HOME}"/ || die "cp failed"
240
241 linguas
242 for X in ${linguas}; do
243 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
244 done
245
246 local LANG=${linguas%% *}
247 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
248 elog "Setting default locale to ${LANG}"
249 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
250 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox.js \
251 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox-l10n.js || \
252 die "sed failed to change locale"
253 fi
254
255 # Create /usr/bin/firefox
256 install_mozilla_launcher_stub firefox "${MOZILLA_FIVE_HOME}"
257
258 # Install icon and .desktop for menu entry
259 if use iceweasel; then
260 newicon "${S}"/browser/base/branding/icon48.png iceweasel-icon.png
261 newmenu "${FILESDIR}"/icon/iceweasel.desktop \
262 mozilla-firefox-2.0.desktop
263 elif ! use bindist; then
264 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
265 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
266 mozilla-firefox-2.0.desktop
267 else
268 newicon "${S}"/browser/base/branding/icon48.png firefox-icon-unbranded.png
269 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
270 mozilla-firefox-2.0.desktop
271 fi
272
273 # Fix icons to look the same everywhere
274 insinto "${MOZILLA_FIVE_HOME}"/icons
275 doins "${S}"/dist/branding/mozicon16.xpm
276 doins "${S}"/dist/branding/mozicon50.xpm
277
278 # Install files necessary for applications to build against firefox
279 einfo "Installing includes and idl files..."
280 cp -LfR "${S}"/dist/include "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
281 cp -LfR "${S}"/dist/idl "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
282
283 # Dirty hack to get some applications using this header running
284 dosym "${MOZILLA_FIVE_HOME}"/include/necko/nsIURI.h \
285 "${MOZILLA_FIVE_HOME}"/include/nsIURI.h
286
287 # Install pkgconfig files
288 insinto /usr/"$(get_libdir)"/pkgconfig
289 doins "${S}"/build/unix/*.pc
290
291 insinto "${MOZILLA_FIVE_HOME}"/greprefs
292 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
293 insinto "${MOZILLA_FIVE_HOME}"/defaults/pref
294 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
295 }
296
297 pkg_postinst() {
298 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
299
300 # This should be called in the postinst and postrm of all the
301 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
302 # thunderbird-bin ebuilds.
303 update_mozilla_launcher_symlinks
304
305 # Update mimedb for the new .desktop file
306 fdo-mime_desktop_database_update
307
308 elog "Please remember to rebuild any packages that you have built"
309 elog "against Firefox. Some packages might be broken by the upgrade; if this"
310 elog "is the case, please search at http://bugs.gentoo.org and open a new bug"
311 elog "if one does not exist. Before filing any bugs, please move or remove"
312 elog " ~/.mozilla and test with a clean profile directory."
313 }
314
315 pkg_postrm() {
316 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
317
318 update_mozilla_launcher_symlinks
319 }

  ViewVC Help
Powered by ViewVC 1.1.20