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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Sun Aug 26 10:10:54 2007 UTC (13 years, 3 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +1 -1 lines
FILE REMOVED
old
(Portage version: 2.1.2.12)

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

  ViewVC Help
Powered by ViewVC 1.1.20