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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (show annotations) (download)
Sat Sep 27 10:20:30 2008 UTC (12 years, 2 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.18: +1 -1 lines
FILE REMOVED
Version bump, add ~arm 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.11.ebuild,v 1.18 2008/05/15 18:40:29 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="${P}-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.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 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 fi
133
134 eautoreconf
135 }
136
137 src_compile() {
138 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
139
140 mozconfig_init
141 mozconfig_config
142
143 mozconfig_annotate '' --enable-application=browser
144 mozconfig_annotate '' --enable-image-encoder=all
145 mozconfig_annotate '' --enable-canvas
146 mozconfig_annotate '' --with-system-nspr
147 mozconfig_annotate '' --with-system-nss
148
149 if use xforms; then
150 mozconfig_annotate '' --enable-extensions=default,xforms,schema-validation,typeaheadfind
151 else
152 mozconfig_annotate '' --enable-extensions=default,typeaheadfind
153 fi
154
155 if use ia64; then
156 echo "ac_cv_visibility_pragma=no" >> "${S}/.mozconfig"
157 fi
158
159 if ! use bindist && ! use iceweasel; then
160 mozconfig_annotate '' --enable-official-branding
161 fi
162
163 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
164 # regardless of java setting.
165 mozconfig_annotate '' --enable-oji --enable-mathml
166
167 # Other ff-specific settings
168 mozconfig_use_enable mozdevelop jsd
169 mozconfig_use_enable mozdevelop xpctools
170 mozconfig_use_extension mozdevelop venkman
171 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
172
173 # Finalize and report settings
174 mozconfig_final
175
176 # -fstack-protector breaks us
177 if gcc-version ge 4 1; then
178 gcc-specs-ssp && append-flags -fno-stack-protector
179 else
180 gcc-specs-ssp && append-flags -fno-stack-protector-all
181 fi
182 filter-flags -fstack-protector -fstack-protector-all
183
184 ####################################
185 #
186 # Configure and build
187 #
188 ####################################
189
190 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
191 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
192 econf || die
193
194 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
195 # to econf, but the quotes cause configure to fail.
196 sed -i -e \
197 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
198 "${S}"/config/autoconf.mk \
199 "${S}"/toolkit/content/buildconfig.html
200
201 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
202 # requirements while compiling
203 edit_makefiles
204
205 # Should the build use multiprocessing? Not enabled by default, as it tends to break
206 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
207 emake ${jobs} || die
208 }
209
210 pkg_preinst() {
211 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
212
213 einfo "Removing old installs with some really ugly code. It potentially"
214 einfo "eliminates any problems during the install, however suggestions to"
215 einfo "replace this are highly welcome. Send comments and suggestions to"
216 einfo "mozilla@gentoo.org."
217 rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
218 }
219
220 src_install() {
221 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
222
223 # Most of the installation happens here
224 dodir "${MOZILLA_FIVE_HOME}"
225 cp -RL "${S}"/dist/bin/* "${D}"/"${MOZILLA_FIVE_HOME}"/ || die "cp failed"
226
227 linguas
228 for X in ${linguas}; do
229 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
230 done
231
232 local LANG=${linguas%% *}
233 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
234 elog "Setting default locale to ${LANG}"
235 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
236 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox.js \
237 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox-l10n.js || \
238 die "sed failed to change locale"
239 fi
240
241 # Create /usr/bin/firefox
242 install_mozilla_launcher_stub firefox "${MOZILLA_FIVE_HOME}"
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-2.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-2.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-2.0.desktop
257 fi
258
259 # Fix icons to look the same everywhere
260 insinto "${MOZILLA_FIVE_HOME}"/icons
261 doins "${S}"/dist/branding/mozicon16.xpm
262 doins "${S}"/dist/branding/mozicon50.xpm
263
264 # Install files necessary for applications to build against firefox
265 einfo "Installing includes and idl files..."
266 cp -LfR "${S}"/dist/include "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
267 cp -LfR "${S}"/dist/idl "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
268
269 # Dirty hack to get some applications using this header running
270 dosym "${MOZILLA_FIVE_HOME}"/include/necko/nsIURI.h \
271 "${MOZILLA_FIVE_HOME}"/include/nsIURI.h
272
273 # Install pkgconfig files
274 insinto /usr/"$(get_libdir)"/pkgconfig
275 doins "${S}"/build/unix/*.pc
276
277 insinto "${MOZILLA_FIVE_HOME}"/greprefs
278 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
279 insinto "${MOZILLA_FIVE_HOME}"/defaults/pref
280 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
281 }
282
283 pkg_postinst() {
284 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
285
286 # This should be called in the postinst and postrm of all the
287 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
288 # thunderbird-bin ebuilds.
289 update_mozilla_launcher_symlinks
290
291 # Update mimedb for the new .desktop file
292 fdo-mime_desktop_database_update
293
294 elog "Please remember to rebuild any packages that you have built"
295 elog "against Firefox. Some packages might be broken by the upgrade; if this"
296 elog "is the case, please search at http://bugs.gentoo.org and open a new bug"
297 elog "if one does not exist. Before filing any bugs, please move or remove"
298 elog " ~/.mozilla and test with a clean profile directory."
299 }
300
301 pkg_postrm() {
302 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
303
304 update_mozilla_launcher_symlinks
305 }

  ViewVC Help
Powered by ViewVC 1.1.20