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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Jan 9 16:53:05 2007 UTC (13 years, 10 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Remove old
(Portage version: 2.1.1-r2)
 (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-r2.ebuild,v 1.2 2006/12/03 17:02:55 genstef 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.4"
10 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"
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 ~sparc ~x86"
17 SLOT="0"
18 LICENSE="MPL-1.1 NPL-1.1"
19 IUSE="java mozdevelop mozbranding xforms restrict-javascript"
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 [[ `uname -m` = "ppc64" ]] && die "Building on a ppc64 host requires linux32."
93
94 use moznopango && warn_mozilla_launcher_stub
95 }
96
97 src_unpack() {
98
99 unpack ${A%bz2*}bz2
100
101 linguas
102 for X in ${linguas}; do
103 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
104 done
105
106 cd "${S}"
107
108 # Apply our patches
109 EPATCH_FORCE="yes" epatch "${WORKDIR}"/patch
110
111 # Fix a compilation issue using the 32-bit userland with 64-bit kernel on
112 # PowerPC, because with that configuration, it detects a ppc64 system.
113 # -- hansmi, 2005-11-13
114 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then
115 sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \
116 "${S}"/configure
117 sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \
118 "${S}"/security/coreconf/arch.mk
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 mozbranding; then
143 mozconfig_annotate '' --enable-official-branding
144 fi
145
146 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
147 # regardless of java setting.
148 mozconfig_annotate '' --enable-oji --enable-mathml
149
150 # Other ff-specific settings
151 mozconfig_use_enable mozdevelop jsd
152 mozconfig_use_enable mozdevelop xpctools
153 mozconfig_use_extension mozdevelop venkman
154 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
155
156 # Add build variables
157 mozconfig_build_opts
158
159 # Finalize and report settings
160 mozconfig_final
161
162 # -fstack-protector breaks us
163 if gcc-version ge 4 1; then
164 gcc-specs-ssp && append-flags -fno-stack-protector
165 else
166 gcc-specs-ssp && append-flags -fno-stack-protector-all
167 fi
168 filter-flags -fstack-protector -fstack-protector-all
169
170 ####################################
171 #
172 # Configure and build
173 #
174 ####################################
175
176 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
177 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
178 econf || die
179
180 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
181 # to econf, but the quotes cause configure to fail.
182 sed -i -e \
183 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
184 ${S}/config/autoconf.mk \
185 ${S}/xpfe/global/buildconfig.html
186
187 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
188 # requirements while compiling
189 edit_makefiles
190
191 emake -j1 || die
192 }
193
194 pkg_preinst() {
195 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
196
197 einfo "Removing old installs though some really ugly code. It potentially"
198 einfo "eliminates any problems during the install, however suggestions to"
199 einfo "replace this are highly welcome. Send comments and suggestions to"
200 einfo "mozilla@gentoo.org."
201 rm -rf "${ROOT}"/"${MOZILLA_FIVE_HOME}"
202 }
203
204 src_install() {
205 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
206
207 # Most of the installation happens here
208 dodir "${MOZILLA_FIVE_HOME}"
209 cp -RL "${S}"/dist/bin/* "${D}"/"${MOZILLA_FIVE_HOME}"/ || die "cp failed"
210
211 linguas
212 for X in ${linguas}; do
213 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
214 done
215
216 local LANG=${linguas%% *}
217 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
218 einfo "Setting default locale to ${LANG}"
219 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
220 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox.js \
221 "${MOZILLA_FIVE_HOME}"/defaults/pref/firefox-l10n.js || \
222 die "sed failed to change locale"
223 fi
224
225 # Create /usr/bin/firefox
226 install_mozilla_launcher_stub firefox "${MOZILLA_FIVE_HOME}"
227
228 # Install icon and .desktop for menu entry
229 if use mozbranding; then
230 doicon "${FILESDIR}"/icon/firefox-icon.png
231 newmenu "${FILESDIR}"/icon/mozillafirefox-1.5.desktop \
232 mozillafirefox-2.0.desktop
233 else
234 doicon "${FILESDIR}"/icon/firefox-icon-unbranded.png
235 newmenu "${FILESDIR}"/icon/mozillafirefox-1.5-unbranded.desktop \
236 mozillafirefox-2.0.desktop
237 fi
238
239 # Fix icons to look the same everywhere
240 insinto "${MOZILLA_FIVE_HOME}"/icons
241 doins "${S}"/dist/branding/mozicon16.xpm
242 doins "${S}"/dist/branding/mozicon50.xpm
243
244
245 # Install files necessary for applications to build against firefox
246 einfo "Installing includes and idl files..."
247 cp -LfR "${S}"/dist/include "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
248 cp -LfR "${S}"/dist/idl "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
249
250 # Dirty hack to get some applications using this header running
251 dosym "${MOZILLA_FIVE_HOME}"/include/necko/nsIURI.h \
252 "${MOZILLA_FIVE_HOME}"/include/nsIURI.h
253
254 # Install pkgconfig files
255 insinto /usr/"$(get_libdir)"/pkgconfig
256 doins "${S}"/build/unix/*.pc
257
258 insinto "${MOZILLA_FIVE_HOME}"/greprefs
259 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
260 insinto "${MOZILLA_FIVE_HOME}"/defaults/pref
261 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
262 }
263
264 pkg_postinst() {
265 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
266
267 # This should be called in the postinst and postrm of all the
268 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
269 # thunderbird-bin ebuilds.
270 update_mozilla_launcher_symlinks
271
272 # Update mimedb for the new .desktop file
273 fdo-mime_desktop_database_update
274
275 elog "Please remember to rebuild any packages that you have built"
276 elog "against firefox. Some packages might be broken by the upgrade; if this"
277 elog "is the case, please search at http://bugs.gentoo.org and open a new bug"
278 elog "if one does not exist. Before filing any bugs, please move or remove ~/.mozilla"
279 elog "and test with a clean profile directory."
280 }
281
282 pkg_postrm() {
283 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
284
285 update_mozilla_launcher_symlinks
286 }

  ViewVC Help
Powered by ViewVC 1.1.20