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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (show annotations) (download)
Sun Mar 11 13:42:39 2007 UTC (13 years, 8 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.17: +1 -1 lines
FILE REMOVED
Punt vulnerable and unused. Add arm back to stable in 2.0.0.2, which i removed
(Portage version: 2.1.2.2)

1 # Copyright 1999-2007 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.1.ebuild,v 1.17 2007/02/21 15:11:19 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-patches-0.9"
10 LANGS="ar 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 ru sk sl sv-SE tr 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 ppc ppc64 sparc x86"
17 SLOT="0"
18 LICENSE="MPL-1.1 GPL-2 LGPL-2.1"
19 IUSE="java mozdevelop mozbranding xforms restrict-javascript filepicker"
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 http://dev.gentooexperimental.org/~anarchy/dist/${PATCH}.tar.bz2
24 mirror://gentoo/${PATCH}.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://gentooexperimental.org/~genstef/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://gentooexperimental.org/~genstef/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.39
45 >=sys-devel/binutils-2.16.1
46 >=dev-libs/nss-3.11.1-r1
47 >=dev-libs/nspr-4.6.1"
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 linguas() {
57 local LANG SLANG
58 for LANG in ${LINGUAS}; do
59 if has ${LANG} en en_US; then
60 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
61 continue
62 elif has ${LANG} ${LANGS//-/_}; then
63 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
64 continue
65 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
66 for X in ${LANGS}; do
67 if [[ "${X}" == "${LANG}-"* ]] && \
68 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
69 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
70 continue 2
71 fi
72 done
73 fi
74 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
75 done
76 einfo "Selected language packs (first will be default): $linguas"
77 }
78
79 pkg_setup(){
80 if ! built_with_use x11-libs/cairo X; then
81 eerror "Cairo is not built with X useflag."
82 eerror "Please add 'X' to your USE flags, and re-emerge cairo."
83 die "Cairo needs X"
84 fi
85
86 if use mozbranding; then
87 einfo "You are enabling official branding. You may not redistribute this build"
88 einfo "to any users on your network or the internet. Doing so puts yourself into"
89 einfo "a legal problem with mozilla foundation"
90 fi
91
92 use moznopango && warn_mozilla_launcher_stub
93 }
94
95 src_unpack() {
96
97 unpack ${A%bz2*}bz2
98
99 linguas
100 for X in ${linguas}; do
101 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
102 done
103
104 cd "${S}"
105
106 # Apply our patches
107 EPATCH_FORCE="yes" epatch "${WORKDIR}"/patch
108
109 if use filepicker; then
110 epatch ${FILESDIR}/mozilla-filepicker.patch
111 fi
112
113 eautoreconf
114 }
115
116 src_compile() {
117 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
118
119 mozconfig_init
120 mozconfig_config
121
122 mozconfig_annotate '' --enable-application=browser
123 mozconfig_annotate '' --enable-image-encoder=all
124 mozconfig_annotate '' --enable-canvas
125 mozconfig_annotate '' --with-system-nspr
126 mozconfig_annotate '' --with-system-nss
127
128 if use xforms; then
129 mozconfig_annotate '' --enable-extensions=default,xforms,schema-validation,typeaheadfind
130 else
131 mozconfig_annotate '' --enable-extensions=default,typeaheadfind
132 fi
133
134 if use ia64; then
135 echo "ac_cv_visibility_pragma=no" >> "${S}/.mozconfig"
136 fi
137
138 if use mozbranding; then
139 mozconfig_annotate '' --enable-official-branding
140 fi
141
142 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
143 # regardless of java setting.
144 mozconfig_annotate '' --enable-oji --enable-mathml
145
146 # Other ff-specific settings
147 mozconfig_use_enable mozdevelop jsd
148 mozconfig_use_enable mozdevelop xpctools
149 mozconfig_use_extension mozdevelop venkman
150 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
151
152 # Add build variables
153 mozconfig_build_opts
154
155 # Finalize and report settings
156 mozconfig_final
157
158 # -fstack-protector breaks us
159 if gcc-version ge 4 1; then
160 gcc-specs-ssp && append-flags -fno-stack-protector
161 else
162 gcc-specs-ssp && append-flags -fno-stack-protector-all
163 fi
164 filter-flags -fstack-protector -fstack-protector-all
165
166 ####################################
167 #
168 # Configure and build
169 #
170 ####################################
171
172 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
173 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
174 econf || die
175
176 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
177 # to econf, but the quotes cause configure to fail.
178 sed -i -e \
179 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
180 ${S}/config/autoconf.mk \
181 ${S}/xpfe/global/buildconfig.html
182
183 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
184 # requirements while compiling
185 edit_makefiles
186
187 emake -j1 || die
188 }
189
190 pkg_preinst() {
191 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
192
193 einfo "Removing old installs though some really ugly code. It potentially"
194 einfo "eliminates any problems during the install, however suggestions to"
195 einfo "replace this are highly welcome. Send comments and suggestions to"
196 einfo "mozilla@gentoo.org."
197 rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
198 }
199
200 src_install() {
201 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
202
203 # Most of the installation happens here
204 dodir "${MOZILLA_FIVE_HOME}"
205 cp -RL "${S}"/dist/bin/* "${D}"/"${MOZILLA_FIVE_HOME}"/ || die "cp failed"
206
207 linguas
208 for X in ${linguas}; do
209 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
210 done
211
212 local LANG=${linguas%% *}
213 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
214 einfo "Setting default locale to ${LANG}"
215 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
216 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox.js \
217 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox-l10n.js || \
218 die "sed failed to change locale"
219 fi
220
221 # Create /usr/bin/firefox
222 install_mozilla_launcher_stub firefox "${MOZILLA_FIVE_HOME}"
223
224 # Install icon and .desktop for menu entry
225 if use mozbranding; then
226 doicon "${FILESDIR}"/icon/firefox-icon.png
227 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
228 mozillafirefox-2.0.desktop
229 else
230 doicon "${FILESDIR}"/icon/firefox-icon-unbranded.png
231 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
232 mozillafirefox-2.0.desktop
233 fi
234
235 # Fix icons to look the same everywhere
236 insinto "${MOZILLA_FIVE_HOME}"/icons
237 doins "${S}"/dist/branding/mozicon16.xpm
238 doins "${S}"/dist/branding/mozicon50.xpm
239
240 # Install files necessary for applications to build against firefox
241 einfo "Installing includes and idl files..."
242 cp -LfR "${S}"/dist/include "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
243 cp -LfR "${S}"/dist/idl "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
244
245 # Dirty hack to get some applications using this header running
246 dosym "${MOZILLA_FIVE_HOME}"/include/necko/nsIURI.h \
247 "${MOZILLA_FIVE_HOME}"/include/nsIURI.h
248
249 # Install pkgconfig files
250 insinto /usr/"$(get_libdir)"/pkgconfig
251 doins "${S}"/build/unix/*.pc
252
253 insinto "${MOZILLA_FIVE_HOME}"/greprefs
254 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
255 insinto "${MOZILLA_FIVE_HOME}"/defaults/pref
256 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
257 }
258
259 pkg_postinst() {
260 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
261
262 # This should be called in the postinst and postrm of all the
263 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
264 # thunderbird-bin ebuilds.
265 update_mozilla_launcher_symlinks
266
267 # Update mimedb for the new .desktop file
268 fdo-mime_desktop_database_update
269
270 elog "Please remember to rebuild any packages that you have built"
271 elog "against firefox. Some packages might be broken by the upgrade; if this"
272 elog "is the case, please search at http://bugs.gentoo.org and open a new bug"
273 elog "if one does not exist. Before filing any bugs, please move or remove ~/.mozilla"
274 elog "and test with a clean profile directory."
275 }
276
277 pkg_postrm() {
278 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
279
280 update_mozilla_launcher_symlinks
281 }

  ViewVC Help
Powered by ViewVC 1.1.20