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

Contents of /www-client/mozilla-firefox/mozilla-firefox-2.0-r1.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-r1.ebuild,v 1.2 2006/11/21 06:42:19 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.1"
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 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 linguas() {
56 local LANG SLANG
57 for LANG in ${LINGUAS}; do
58 if has ${LANG} en en_US; then
59 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
60 continue
61 elif has ${LANG} ${LANGS//-/_}; then
62 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
63 continue
64 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
65 for X in ${LANGS}; do
66 if [[ "${X}" == "${LANG}-"* ]] && \
67 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
68 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
69 continue 2
70 fi
71 done
72 fi
73 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
74 done
75 einfo "Selected language packs (first will be default): $linguas"
76 }
77
78 pkg_setup(){
79 if ! built_with_use x11-libs/cairo X; then
80 eerror "Cairo is not built with X useflag."
81 eerror "Please add 'X' to your USE flags, and re-emerge cairo."
82 die "Cairo needs X"
83 fi
84
85 if use mozbranding; then
86 einfo "You are enabling official branding. You may not redistribute this build"
87 einfo "to any users on your network or the internet. Doing so puts yourself into"
88 einfo "a legal problem with mozilla foundation"
89 fi
90
91 [[ `uname -m` = "ppc64" ]] && die "Building on a ppc64 host requires linux32."
92
93 use moznopango && warn_mozilla_launcher_stub
94 }
95
96 src_unpack() {
97
98 unpack ${A%bz2*}bz2
99
100 linguas
101 for X in ${linguas}; do
102 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
103 done
104
105 cd "${S}"
106
107 # Apply our patches
108 EPATCH_FORCE="yes" epatch "${WORKDIR}"/patch
109
110 # Fix a compilation issue using the 32-bit userland with 64-bit kernel on
111 # PowerPC, because with that configuration, it detects a ppc64 system.
112 # -- hansmi, 2005-11-13
113 if use ppc && [[ "${PROFILE_ARCH}" == ppc64 ]]; then
114 sed -i -e "s#OS_TEST=\`uname -m\`\$#OS_TEST=${ARCH}#" \
115 "${S}"/configure
116 sed -i -e "s#OS_TEST :=.*uname -m.*\$#OS_TEST:=${ARCH}#" \
117 "${S}"/security/coreconf/arch.mk
118 fi
119
120 eautoreconf
121 }
122
123 src_compile() {
124 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
125
126 mozconfig_init
127 mozconfig_config
128
129 mozconfig_annotate '' --enable-application=browser
130 mozconfig_annotate '' --enable-image-encoder=all
131 mozconfig_annotate '' --enable-canvas
132 mozconfig_annotate '' --with-system-nspr
133 mozconfig_annotate '' --with-system-nss
134
135 if use xforms; then
136 mozconfig_annotate '' --enable-extensions=default,xforms,schema-validation,typeaheadfind
137 else
138 mozconfig_annotate '' --enable-extensions=default,typeaheadfind
139 fi
140
141 if use mozbranding; then
142 mozconfig_annotate '' --enable-official-branding
143 fi
144
145 # Bug 60668: Galeon doesn't build without oji enabled, so enable it
146 # regardless of java setting.
147 mozconfig_annotate '' --enable-oji --enable-mathml
148
149 # Other ff-specific settings
150 mozconfig_use_enable mozdevelop jsd
151 mozconfig_use_enable mozdevelop xpctools
152 mozconfig_use_extension mozdevelop venkman
153 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
154
155 # Add build variables
156 mozconfig_build_opts
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 mozbranding; then
229 doicon "${FILESDIR}"/icon/firefox-icon.png
230 newmenu "${FILESDIR}"/icon/mozillafirefox-1.5.desktop \
231 mozillafirefox-2.0.desktop
232 else
233 doicon "${FILESDIR}"/icon/firefox-icon-unbranded.png
234 newmenu "${FILESDIR}"/icon/mozillafirefox-1.5-unbranded.desktop \
235 mozillafirefox-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
244 # Install files necessary for applications to build against firefox
245 einfo "Installing includes and idl files..."
246 cp -LfR "${S}"/dist/include "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
247 cp -LfR "${S}"/dist/idl "${D}"/"${MOZILLA_FIVE_HOME}" || die "cp failed"
248
249 # Dirty hack to get some applications using this header running
250 dosym "${MOZILLA_FIVE_HOME}"/include/necko/nsIURI.h \
251 "${MOZILLA_FIVE_HOME}"/include/nsIURI.h
252
253 # Install pkgconfig files
254 insinto /usr/"$(get_libdir)"/pkgconfig
255 doins "${S}"/build/unix/*.pc
256
257 insinto "${MOZILLA_FIVE_HOME}"/greprefs
258 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
259 insinto "${MOZILLA_FIVE_HOME}"/defaults/pref
260 newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
261 }
262
263 pkg_postinst() {
264 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
265
266 # This should be called in the postinst and postrm of all the
267 # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
268 # thunderbird-bin ebuilds.
269 update_mozilla_launcher_symlinks
270
271 # Update mimedb for the new .desktop file
272 fdo-mime_desktop_database_update
273
274 elog "Please remember to rebuild any packages that you have built"
275 elog "against firefox. Some packages might be broken by the upgrade; if this"
276 elog "is the case, please search at http://bugs.gentoo.org and open a new bug"
277 elog "if one does not exist. Before filing any bugs, please move or remove ~/.mozilla"
278 elog "and test with a clean profile directory."
279 }
280
281 pkg_postrm() {
282 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
283
284 update_mozilla_launcher_symlinks
285 }

  ViewVC Help
Powered by ViewVC 1.1.20