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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Sun Jul 25 16:21:47 2010 UTC (10 years, 4 months ago) by anarchy
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
cleanup stale builds
(Portage version: 2.1.8.3/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20