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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20