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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Tue Nov 21 06:42:34 2006 UTC (14 years ago) by genstef
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
Fix autoconf usage ad remove old 2.0 thanks to anarchy
(Portage version: 2.1.2_rc2-r1)
 (Unsigned Manifest commit)

1 # Copyright 1999-2006 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.ebuild,v 1.10 2006/11/12 03:29:58 vapier Exp $
4
5 inherit flag-o-matic toolchain-funcs eutils mozconfig-2 mozilla-launcher makeedit multilib fdo-mime mozextension autotools
6
7 PATCH="${PN}-2.0_rc1-patches-1.4"
8 LANGS="ar bg ca cs da de el en-GB es-AR es-ES eu fi fr fy-NL ga-IE gu-IN hu it ja ko lt mk mn nb-NO nl nn-NO pl pt-BR pt-PT ru sk sl sv-SE tr zh-CN zh-TW"
9 NOSHORTLANGS="en-GB es-AR pt-BR zh-TW"
10
11 DESCRIPTION="Firefox Web Browser"
12 HOMEPAGE="http://www.mozilla.org/projects/firefox/"
13
14 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~sparc ~x86"
15 SLOT="0"
16 LICENSE="MPL-1.1 NPL-1.1"
17 IUSE="java mozdevelop mozbranding xforms restrict-javascript"
18
19 MOZ_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PV}"
20 SRC_URI="${MOZ_URI}/source/firefox-${PV}-source.tar.bz2
21 http://gentooexperimental.org/~genstef/dist/${PATCH}.tar.bz2"
22
23 # These are in
24 #
25 # http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/linux-i686/xpi/
26 #
27 # for i in $LANGS $SHORTLANGS; do wget $i.xpi -O ${P}-$i.xpi; done
28 for X in ${LANGS} ; do
29 SRC_URI="${SRC_URI}
30 linguas_${X/-/_}? ( http://gentooexperimental.org/~genstef/dist/${P}-xpi/${P}-${X}.xpi )"
31 IUSE="${IUSE} linguas_${X/-/_}"
32 # english is handled internally
33 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
34 SRC_URI="${SRC_URI}
35 linguas_${X%%-*}? ( http://gentooexperimental.org/~genstef/dist/${P}-xpi/${P}-${X}.xpi )"
36 IUSE="${IUSE} linguas_${X%%-*}"
37 fi
38 done
39
40 RDEPEND="java? ( virtual/jre )
41 >=www-client/mozilla-launcher-1.39
42 >=sys-devel/binutils-2.16.1
43 >=dev-libs/nss-3.11.1-r1
44 >=dev-libs/nspr-4.6.1
45 ~sys-devel/autoconf-2.13"
46
47 DEPEND="${RDEPEND}
48 java? ( >=dev-java/java-config-0.2.0 )"
49
50 PDEPEND="restrict-javascript? ( x11-plugins/noscript )"
51
52 S="${WORKDIR}/mozilla"
53
54 linguas() {
55 local LANG SLANG
56 for LANG in ${LINGUAS}; do
57 if has ${LANG} en en_US; then
58 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
59 continue
60 elif has ${LANG} ${LANGS//-/_}; then
61 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
62 continue
63 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
64 for X in ${LANGS}; do
65 if [[ "${X}" == "${LANG}-"* ]] && \
66 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
67 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
68 continue 2
69 fi
70 done
71 fi
72 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
73 done
74 einfo "Selected language packs (first will be default): $linguas"
75 }
76
77 pkg_setup(){
78 if ! built_with_use x11-libs/cairo X; then
79 eerror "Cairo is not built with X useflag."
80 eerror "Please add 'X' to your USE flags, and re-emerge cairo."
81 die "Cairo needs X"
82 fi
83
84 if use mozbranding; then
85 einfo "You are enabling official branding. You may not redistribute this build"
86 einfo "to any users on your network or the internet. Doing so puts yourself into"
87 einfo "a legal problem with mozilla foundation"
88 fi
89
90 [[ `uname -m` = "ppc64" ]] && die "Building on a ppc64 host requires linux32."
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 # Fix a compilation issue using the 32-bit userland with 64-bit kernel on
110 # PowerPC, because with that configuration, it detects a ppc64 system.
111 # -- hansmi, 2005-11-13
112 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then
113 sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \
114 "${S}"/configure
115 sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \
116 "${S}"/security/coreconf/arch.mk
117 fi
118
119 WANT_AUTOCONF="2.1" 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 mozbranding; then
141 mozconfig_annotate '' --enable-official-branding
142 fi
143
144 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
145 # regardless of java setting.
146 mozconfig_annotate '' --enable-oji --enable-mathml
147
148 # Other ff-specific settings
149 mozconfig_use_enable mozdevelop jsd
150 mozconfig_use_enable mozdevelop xpctools
151 mozconfig_use_extension mozdevelop venkman
152 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
153
154 # Add build variables
155 mozconfig_build_opts
156
157 # Finalize and report settings
158 mozconfig_final
159
160 # -fstack-protector breaks us
161 if gcc-version ge 4 1; then
162 gcc-specs-ssp && append-flags -fno-stack-protector
163 else
164 gcc-specs-ssp && append-flags -fno-stack-protector-all
165 fi
166 filter-flags -fstack-protector -fstack-protector-all
167
168 ####################################
169 #
170 # Configure and build
171 #
172 ####################################
173
174 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
175 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
176 econf || die
177
178 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
179 # to econf, but the quotes cause configure to fail.
180 sed -i -e \
181 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
182 ${S}/config/autoconf.mk \
183 ${S}/xpfe/global/buildconfig.html
184
185 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
186 # requirements while compiling
187 edit_makefiles
188
189 emake -j1 || die
190 }
191
192 pkg_preinst() {
193 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
194
195 einfo "Removing old installs though some really ugly code. It potentially"
196 einfo "eliminates any problems during the install, however suggestions to"
197 einfo "replace this are highly welcome. Send comments and suggestions to"
198 einfo "mozilla@gentoo.org."
199 rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
200 }
201
202 src_install() {
203 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
204
205 # Most of the installation happens here
206 dodir "${MOZILLA_FIVE_HOME}"
207 cp -RL "${S}"/dist/bin/* "${D}"/"${MOZILLA_FIVE_HOME}"/ || die "cp failed"
208
209 linguas
210 for X in ${linguas}; do
211 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
212 done
213
214 local LANG=${linguas%% *}
215 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
216 einfo "Setting default locale to ${LANG}"
217 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
218 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox.js \
219 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox-l10n.js || \
220 die "sed failed to change locale"
221 fi
222
223 # Create /usr/bin/firefox
224 install_mozilla_launcher_stub firefox "${MOZILLA_FIVE_HOME}"
225
226 # Install icon and .desktop for menu entry
227 if use mozbranding; then
228 doicon "${FILESDIR}"/icon/firefox-icon.png
229 newmenu "${FILESDIR}"/icon/mozillafirefox-1.5.desktop \
230 mozillafirefox-2.0.desktop
231 else
232 doicon "${FILESDIR}"/icon/firefox-icon-unbranded.png
233 newmenu "${FILESDIR}"/icon/mozillafirefox-1.5-unbranded.desktop \
234 mozillafirefox-2.0.desktop
235 fi
236
237 # Fix icons to look the same everywhere
238 insinto "${MOZILLA_FIVE_HOME}"/icons
239 doins "${S}"/dist/branding/mozicon16.xpm
240 doins "${S}"/dist/branding/mozicon50.xpm
241
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 ~/.mozilla"
277 elog "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