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

Contents of /www-client/mozilla-firefox/mozilla-firefox-3.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Sun Nov 30 16:05:32 2008 UTC (12 years ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
Remove old, unfortunately 3.0-r1 also sigbuses on sparc, so no working version there
(Portage version: 2.1.4.5)

1 # Copyright 1999-2008 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-3.0-r1.ebuild,v 1.5 2008/11/15 18:27:40 armin76 Exp $
4 EAPI="1"
5 WANT_AUTOCONF="2.1"
6
7 inherit flag-o-matic toolchain-funcs eutils mozconfig-3 makeedit multilib fdo-mime autotools mozextension
8 PATCH="${P}-patches-0.2"
9
10 LANGS="af ar be ca cs da de el en-GB en-US es-AR es-ES eu fi fr fy-NL ga-IE gu-IN he hu id it ja ka ko ku lt mk mn nb-NO nl nn-NO pa-IN pl pt-BR pt-PT ro ru si sk sl sq sr sv-SE tr uk zh-CN zh-TW"
11 NOSHORTLANGS="en-GB es-AR pt-BR zh-CN"
12
13 MY_PV=${PV/3.0/}
14
15 DESCRIPTION="Firefox Web Browser"
16 HOMEPAGE="http://www.mozilla.com/firefox"
17
18 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
19 SLOT="0"
20 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
21 IUSE="java mozdevelop bindist restrict-javascript iceweasel +xulrunner"
22
23 SRC_URI="mirror://gentoo/${P}.tar.bz2
24 http://dev.gentoo.org/~armin76/${P}.tar.bz2
25 mirror://gentoo/${PATCH}.tar.bz2
26 iceweasel? ( mirror://gentoo/iceweasel-icons-2.0.0.11.tar.bz2 )
27 !xulrunner? ( mirror://gentoo/xulrunner-1.9${MY_PV}.tar.bz2 )"
28
29 # These are in
30 #
31 # http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/linux-i686/xpi/
32 #
33 # for i in $LANGS $SHORTLANGS; do wget $i.xpi -O ${P}-$i.xpi; done
34 for X in ${LANGS} ; do
35 if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then
36 SRC_URI="${SRC_URI}
37 linguas_${X/-/_}? ( http://dev.gentooexperimental.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
38 fi
39 IUSE="${IUSE} linguas_${X/-/_}"
40 # english is handled internally
41 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
42 if [ "${X}" != "en-US" ]; then
43 SRC_URI="${SRC_URI}
44 linguas_${X%%-*}? ( http://dev.gentooexperimental.org/~armin76/dist/${P}-xpi/${P}-${X}.xpi )"
45 fi
46 IUSE="${IUSE} linguas_${X%%-*}"
47 fi
48 done
49
50 RDEPEND="java? ( virtual/jre )
51 >=sys-devel/binutils-2.16.1
52 >=dev-libs/nss-3.12
53 >=dev-libs/nspr-4.7.1
54 >=media-libs/lcms-1.17
55 >=app-text/hunspell-1.1.9
56 xulrunner? ( =net-libs/xulrunner-1.9${MY_PV}-r3 )"
57
58 DEPEND="${RDEPEND}
59 dev-util/pkgconfig
60 java? ( >=dev-java/java-config-0.2.0 )"
61
62 PDEPEND="restrict-javascript? ( x11-plugins/noscript )"
63
64 S="${WORKDIR}/mozilla"
65
66 # Needed by src_compile() and src_install().
67 # Would do in pkg_setup but that loses the export attribute, they
68 # become pure shell variables.
69 export MOZ_CO_PROJECT=browser
70 export BUILD_OFFICIAL=1
71 export MOZILLA_OFFICIAL=1
72
73 linguas() {
74 local LANG SLANG
75 for LANG in ${LINGUAS}; do
76 if has ${LANG} en en_US; then
77 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
78 continue
79 elif has ${LANG} ${LANGS//-/_}; then
80 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
81 continue
82 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
83 for X in ${LANGS}; do
84 if [[ "${X}" == "${LANG}-"* ]] && \
85 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
86 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
87 continue 2
88 fi
89 done
90 fi
91 ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
92 done
93 }
94
95 pkg_setup(){
96 if ! built_with_use x11-libs/cairo X; then
97 eerror "Cairo is not built with X useflag."
98 eerror "Please add 'X' to your USE flags, and re-emerge cairo."
99 die "Cairo needs X"
100 fi
101
102 if ! built_with_use --missing true x11-libs/pango X; then
103 eerror "Pango is not built with X useflag."
104 eerror "Please add 'X' to your USE flags, and re-emerge pango."
105 die "Pango needs X"
106 fi
107
108 if ! use bindist && ! use iceweasel; then
109 elog "You are enabling official branding. You may not redistribute this build"
110 elog "to any users on your network or the internet. Doing so puts yourself into"
111 elog "a legal problem with Mozilla Foundation"
112 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
113
114 fi
115 }
116
117 src_unpack() {
118 ! use xulrunner && unpack xulrunner-1.9${MY_PV}.tar.bz2
119 unpack ${P}.tar.bz2 ${PATCH}.tar.bz2
120
121 if use iceweasel; then
122 unpack iceweasel-icons-2.0.0.11.tar.bz2
123
124 cp -r iceweaselicons/browser mozilla/
125 fi
126
127 linguas
128 for X in ${linguas}; do
129 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
130 done
131 if [[ ${linguas} != "" && ${linguas} != "en" ]]; then
132 einfo "Selected language packs (first will be default): ${linguas}"
133 fi
134
135 # Remove the patches we don't need
136 use xulrunner && rm "${WORKDIR}"/patch/*noxul* || rm "${WORKDIR}"/patch/*xulonly*
137
138 # Apply our patches
139 cd "${S}" || die "cd failed"
140 EPATCH_SUFFIX="patch" \
141 EPATCH_FORCE="yes" \
142 epatch "${WORKDIR}"/patch
143
144 if use iceweasel; then
145 sed -i -e "s|Minefield|Iceweasel|" browser/locales/en-US/chrome/branding/brand.* \
146 browser/branding/nightly/configure.sh
147 fi
148
149 eautoreconf
150
151 # We need to re-patch this because autoreconf overwrites it
152 epatch "${WORKDIR}"/patch/000_flex-configure-LANG.patch
153 }
154
155 src_compile() {
156 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
157 MEXTENSIONS="default,typeaheadfind"
158
159 ####################################
160 #
161 # mozconfig, CFLAGS and CXXFLAGS setup
162 #
163 ####################################
164
165 mozconfig_init
166 mozconfig_config
167
168 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
169 mozconfig_annotate '' --disable-mailnews
170 mozconfig_annotate 'broken' --disable-mochitest
171 mozconfig_annotate 'broken' --disable-crashreporter
172 mozconfig_annotate '' --enable-system-hunspell
173 #mozconfig_annotate '' --enable-system-sqlite
174 mozconfig_annotate '' --enable-image-encoder=all
175 mozconfig_annotate '' --enable-canvas
176 mozconfig_annotate '' --with-system-nspr
177 mozconfig_annotate '' --with-system-nss
178 mozconfig_annotate '' --enable-system-lcms
179 mozconfig_annotate '' --enable-oji --enable-mathml
180 mozconfig_annotate 'places' --enable-storage --enable-places --enable-places_bookmarks
181
182 # Other ff-specific settings
183 #mozconfig_use_enable mozdevelop jsd
184 #mozconfig_use_enable mozdevelop xpctools
185 mozconfig_use_extension mozdevelop venkman
186 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
187 if use xulrunner; then
188 # Add xulrunner variable
189 mozconfig_annotate '' --with-libxul-sdk=/usr/$(get_libdir)/xulrunner-1.9
190 fi
191
192 if ! use bindist && ! use iceweasel; then
193 mozconfig_annotate '' --enable-official-branding
194 fi
195
196 # Finalize and report settings
197 mozconfig_final
198
199 # -fstack-protector breaks us
200 if gcc-version ge 4 1; then
201 gcc-specs-ssp && append-flags -fno-stack-protector
202 else
203 gcc-specs-ssp && append-flags -fno-stack-protector-all
204 fi
205 filter-flags -fstack-protector -fstack-protector-all
206
207 ####################################
208 #
209 # Configure and build
210 #
211 ####################################
212
213 CPPFLAGS="${CPPFLAGS} -DARON_WAS_HERE" \
214 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
215 econf || die
216
217 # It would be great if we could pass these in via CPPFLAGS or CFLAGS prior
218 # to econf, but the quotes cause configure to fail.
219 sed -i -e \
220 's|-DARON_WAS_HERE|-DGENTOO_NSPLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsplugins\\\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\\\"/usr/'"$(get_libdir)"'/nsbrowser/plugins\\\"|' \
221 "${S}"/config/autoconf.mk \
222 "${S}"/toolkit/content/buildconfig.html
223
224 # This removes extraneous CFLAGS from the Makefiles to reduce RAM
225 # requirements while compiling
226 edit_makefiles
227
228 # Should the build use multiprocessing? Not enabled by default, as it tends to break
229 [ "${WANT_MP}" = "true" ] && jobs=${MAKEOPTS} || jobs="-j1"
230 emake ${jobs} || die
231 }
232
233 pkg_preinst() {
234 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
235
236 einfo "Removing old installs with some really ugly code. It potentially"
237 einfo "eliminates any problems during the install, however suggestions to"
238 einfo "replace this are highly welcome. Send comments and suggestions to"
239 einfo "mozilla@gentoo.org."
240 rm -rf "${ROOT}"${MOZILLA_FIVE_HOME}
241 }
242
243 src_install() {
244 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
245
246 emake DESTDIR="${D}" install || die "emake install failed"
247 rm "${D}"/usr/bin/firefox
248
249 linguas
250 for X in ${linguas}; do
251 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
252 done
253
254 use xulrunner && prefs=preferences || prefs=pref
255 cp "${FILESDIR}"/gentoo-default-prefs.js "${D}"${MOZILLA_FIVE_HOME}/defaults/${prefs}/all-gentoo.js
256
257 local LANG=${linguas%% *}
258 if [[ -n ${LANG} && ${LANG} != "en" ]]; then
259 elog "Setting default locale to ${LANG}"
260 dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
261 ${MOZILLA_FIVE_HOME}/defaults/${prefs}/firefox.js \
262 ${MOZILLA_FIVE_HOME}/defaults/${prefs}/firefox-l10n.js || \
263 die "sed failed to change locale"
264 fi
265
266 # Install icon and .desktop for menu entry
267 if use iceweasel; then
268 newicon "${S}"/browser/base/branding/icon48.png iceweasel-icon.png
269 newmenu "${FILESDIR}"/icon/iceweasel.desktop \
270 mozilla-firefox-2.0.desktop
271 elif ! use bindist; then
272 newicon "${S}"/other-licenses/branding/firefox/content/icon48.png firefox-icon.png
273 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5.desktop \
274 mozilla-firefox-3.0.desktop
275 else
276 newicon "${S}"/browser/base/branding/icon48.png firefox-icon-unbranded.png
277 newmenu "${FILESDIR}"/icon/mozilla-firefox-1.5-unbranded.desktop \
278 mozilla-firefox-3.0.desktop
279 sed -i -e "s/Bon Echo/Minefield/" "${D}"/usr/share/applications/mozilla-firefox-3.0.desktop
280 fi
281
282 if use xulrunner; then
283 PKG_CONFIG=`which pkg-config`
284 X_DATE=`date +%Y%m%d`
285 XULRUNNER_VERSION=`${PKG_CONFIG} --modversion libxul`
286
287 #set the application.ini
288 sed -i -e "s|BuildID=.*$|BuildID=${X_DATE}GentooMozillaFirefox|" "${D}"${MOZILLA_FIVE_HOME}/application.ini
289 sed -i -e "s|MinVersion=.*$|MinVersion=${XULRUNNER_VERSION}|" "${D}"${MOZILLA_FIVE_HOME}/application.ini
290 sed -i -e "s|MaxVersion=.*$|MaxVersion=${XULRUNNER_VERSION}|" "${D}"${MOZILLA_FIVE_HOME}/application.ini
291 # Create /usr/bin/firefox
292 cat <<EOF >"${D}"/usr/bin/firefox
293 #!/bin/sh
294 export LD_LIBRARY_PATH="/usr/$(get_libdir)/mozilla-firefox"
295 exec /usr/$(get_libdir)/mozilla-firefox/firefox "\$@"
296 EOF
297 fperms 0755 /usr/bin/firefox
298 else
299 # Create /usr/bin/firefox
300 make_wrapper firefox "${MOZILLA_FIVE_HOME}/firefox"
301 fi
302
303 }
304
305 pkg_postinst() {
306 declare MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
307
308 ewarn "All the packages built against ${PN} won't compile,"
309 ewarn "if after installing firefox 3.0 you get some blockers,"
310 ewarn "please add 'xulrunner' to your USE-flags."
311
312 # Update mimedb for the new .desktop file
313 fdo-mime_desktop_database_update
314 }

  ViewVC Help
Powered by ViewVC 1.1.20