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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20