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

Contents of /www-client/firefox/firefox-4.0.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon May 2 23:33:17 2011 UTC (3 years, 4 months ago) by anarchy
Branch: MAIN
Security bump for Firefox-4.x

(Portage version: 2.1.9.46/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-client/firefox/firefox-4.0-r1.ebuild,v 1.1 2011/03/23 00:45:30 nirbheek Exp $
4
5 EAPI="3"
6 WANT_AUTOCONF="2.1"
7
8 inherit flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-3 makeedit multilib pax-utils fdo-mime autotools mozextension versionator python
9
10 MAJ_XUL_PV="2.0"
11 MAJ_FF_PV="$(get_version_component_range 1-2)" # 3.5, 3.6, 4.0, etc.
12 XUL_PV="${MAJ_XUL_PV}${PV/${MAJ_FF_PV}/}" # 1.9.3_alpha6, 1.9.2.3, etc.
13 FF_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
14 FF_PV="${FF_PV/_beta/b}" # Handle beta for SRC_URI
15 FF_PV="${FF_PV/_rc/rc}" # Handle rc for SRC_URI
16 CHANGESET="e56ecd8b3a68"
17 PATCH="${PN}-4.0-patches-0.9"
18
19 DESCRIPTION="Firefox Web Browser"
20 HOMEPAGE="http://www.mozilla.com/firefox"
21
22 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
23 SLOT="0"
24 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
25 IUSE="bindist +ipc system-sqlite +webm"
26
27 REL_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases"
28 # More URIs appended below...
29 SRC_URI="http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.bz2"
30
31 RDEPEND="
32 >=sys-devel/binutils-2.16.1
33 >=dev-libs/nss-3.12.9
34 >=dev-libs/nspr-4.8.7
35 >=dev-libs/glib-2.26
36 >=media-libs/libpng-1.4.7[apng]
37 x11-libs/pango[X]
38 system-sqlite? ( >=dev-db/sqlite-3.7.4[fts3,secure-delete,unlock-notify,debug=] )
39 ~net-libs/xulrunner-${XUL_PV}[wifi=,libnotify=,system-sqlite=,webm=]
40 webm? ( media-libs/libvpx
41 media-libs/alsa-lib )"
42
43 DEPEND="${RDEPEND}
44 dev-util/pkgconfig
45 webm? ( dev-lang/yasm )"
46
47 # No source releases for alpha|beta
48 if [[ ${PV} =~ alpha|beta ]]; then
49 SRC_URI="${SRC_URI}
50 http://dev.gentoo.org/~anarchy/mozilla/firefox/firefox-${FF_PV}_${CHANGESET}.source.tar.bz2"
51 S="${WORKDIR}/mozilla-central"
52 else
53 SRC_URI="${SRC_URI}
54 ${REL_URI}/${FF_PV}/source/firefox-${FF_PV}.source.tar.bz2"
55 S="${WORKDIR}/mozilla-${MAJ_XUL_PV}"
56 fi
57
58 # No language packs for alphas
59 if ! [[ ${PV} =~ alpha|beta ]]; then
60 # This list can be updated with scripts/get_langs.sh from mozilla overlay
61 LANGS="af ak ar ast be bg bn-BD bn-IN br bs ca cs cy da de
62 el en en-ZA eo es-ES et eu fa fi fr fy-NL ga-IE gd gl gu-IN
63 he hi-IN hr hu hy-AM id is it ja kk kn ko ku lg lt lv mai mk
64 ml mr nb-NO nl nn-NO nso or pa-IN pl pt-PT rm ro ru si sk sl
65 son sq sr sv-SE ta ta-LK te th tr uk vi zu"
66 NOSHORTLANGS="en-GB es-AR es-CL es-MX pt-BR zh-CN zh-TW"
67
68 for X in ${LANGS} ; do
69 if [ "${X}" != "en" ] && [ "${X}" != "en-US" ]; then
70 SRC_URI="${SRC_URI}
71 linguas_${X/-/_}? ( ${REL_URI}/${FF_PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
72 fi
73 IUSE="${IUSE} linguas_${X/-/_}"
74 # english is handled internally
75 if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
76 if [ "${X}" != "en-US" ]; then
77 SRC_URI="${SRC_URI}
78 linguas_${X%%-*}? ( ${REL_URI}/${FF_PV}/linux-i686/xpi/${X}.xpi -> ${P}-${X}.xpi )"
79 fi
80 IUSE="${IUSE} linguas_${X%%-*}"
81 fi
82 done
83 fi
84
85 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
86
87 linguas() {
88 local LANG SLANG
89 for LANG in ${LINGUAS}; do
90 if has ${LANG} en en_US; then
91 has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
92 continue
93 elif has ${LANG} ${LANGS//-/_}; then
94 has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
95 continue
96 elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
97 for X in ${LANGS}; do
98 if [[ "${X}" == "${LANG}-"* ]] && \
99 [[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
100 has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
101 continue 2
102 fi
103 done
104 fi
105 ewarn "Sorry, but ${P} does not support the ${LANG} LINGUA"
106 done
107 }
108
109 pkg_setup() {
110 moz_pkgsetup
111
112 if ! use bindist ; then
113 einfo
114 elog "You are enabling official branding. You may not redistribute this build"
115 elog "to any users on your network or the internet. Doing so puts yourself into"
116 elog "a legal problem with Mozilla Foundation"
117 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
118 fi
119 }
120
121 src_unpack() {
122 unpack ${A}
123
124 linguas
125 for X in ${linguas}; do
126 # FIXME: Add support for unpacking xpis to portage
127 [[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
128 done
129 }
130
131 src_prepare() {
132 # Apply our patches
133 EPATCH_SUFFIX="patch" \
134 EPATCH_FORCE="yes" \
135 epatch "${WORKDIR}"
136
137 epatch "${FILESDIR}"/fix-preferences-gentoo.patch
138
139 # Allow user to apply any additional patches without modifing ebuild
140 epatch_user
141
142 # Disable gnomevfs extension
143 sed -i -e "s:gnomevfs::" "${S}/"browser/confvars.sh \
144 || die "Failed to remove gnomevfs extension"
145
146 eautoreconf
147
148 cd js/src
149 eautoreconf
150 }
151
152 src_configure() {
153 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
154 MEXTENSIONS="default"
155
156 ####################################
157 #
158 # mozconfig, CFLAGS and CXXFLAGS setup
159 #
160 ####################################
161
162 mozconfig_init
163 mozconfig_config
164
165 # It doesn't compile on alpha without this LDFLAGS
166 use alpha && append-ldflags "-Wl,--no-relax"
167
168 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
169 mozconfig_annotate '' --disable-mailnews
170 mozconfig_annotate '' --enable-canvas
171 mozconfig_annotate '' --enable-safe-browsing
172 mozconfig_annotate '' --with-system-png
173 mozconfig_annotate '' --with-system-libxul
174 mozconfig_annotate '' --with-libxul-sdk="${EPREFIX}"/usr/$(get_libdir)/xulrunner-devel-${MAJ_XUL_PV}
175
176 # Other ff-specific settings
177 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
178
179 mozconfig_use_enable system-sqlite
180
181 # Finalize and report settings
182 mozconfig_final
183
184 if [[ $(gcc-major-version) -lt 4 ]]; then
185 append-cxxflags -fno-stack-protector
186 fi
187
188 ####################################
189 #
190 # Configure and build
191 #
192 ####################################
193
194 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" PYTHON="$(PYTHON)" econf
195 }
196
197 src_install() {
198 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
199
200 # Enable very specific settings not inherited from xulrunner
201 cp "${FILESDIR}"/firefox-default-prefs.js \
202 "${S}/dist/bin/defaults/preferences/all-gentoo.js" || \
203 die "failed to cp firefox-default-prefs.js"
204
205 emake DESTDIR="${D}" install || die "emake install failed"
206
207 linguas
208 for X in ${linguas}; do
209 [[ ${X} != "en" ]] && xpi_install "${WORKDIR}/${P}-${X}"
210 done
211
212 local size sizes icon_path icon name
213 if use bindist; then
214 sizes="16 32 48"
215 icon_path="${S}/browser/branding/unofficial"
216 icon="tumucumaque"
217 name="Tumucumaque"
218 else
219 sizes="16 22 24 32 256"
220 icon_path="${S}/other-licenses/branding/firefox"
221 icon="${PN}"
222 name="Mozilla Firefox"
223 fi
224
225 # Install icons and .desktop for menu entry
226 for size in ${sizes}; do
227 insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
228 newins "${icon_path}/default${size}.png" "${icon}.png" || die
229 done
230 # The 128x128 icon has a different name
231 insinto "/usr/share/icons/hicolor/128x128/apps"
232 newins "${icon_path}/mozicon128.png" "${icon}.png" || die
233 # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
234 newicon "${icon_path}/content/icon48.png" "${icon}.png" || die
235 newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop" || die
236 sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
237 "${ED}/usr/share/applications/${PN}.desktop" || die
238
239 # Add StartupNotify=true bug 237317
240 if use startup-notification ; then
241 echo "StartupNotify=true" >> "${ED}/usr/share/applications/${PN}.desktop"
242 fi
243
244 pax-mark m "${ED}"/${MOZILLA_FIVE_HOME}/firefox
245
246 # Plugins dir
247 dosym ../nsbrowser/plugins "${MOZILLA_FIVE_HOME}"/plugins \
248 || die "failed to symlink"
249
250 # very ugly hack to make firefox not sigbus on sparc
251 use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
252 -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" || \
253 die "sparc sed failed"; }
254 }
255
256 pkg_preinst() {
257 gnome2_icon_savelist
258 }
259
260 pkg_postinst() {
261 # Update mimedb for the new .desktop file
262 fdo-mime_desktop_database_update
263 gnome2_icon_cache_update
264 }
265
266 pkg_postrm() {
267 gnome2_icon_cache_update
268 }

  ViewVC Help
Powered by ViewVC 1.1.20