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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.23 - (show annotations) (download)
Mon Dec 3 22:05:19 2007 UTC (12 years, 11 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.22: +1 -1 lines
FILE REMOVED
Raise nspr/nss depend and remove ancient
(Portage version: 2.1.3.19)

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

  ViewVC Help
Powered by ViewVC 1.1.20