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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Aug 7 16:42:25 2015 UTC (4 years, 2 months ago) by axs
Branch: MAIN
CVS Tags: HEAD
version bumps for security bug 556942

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 009C547C2B6559ED!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-client/firefox/firefox-39.0.ebuild,v 1.3 2015/07/30 19:48:10 axs Exp $
4
5 EAPI="5"
6 VIRTUALX_REQUIRED="pgo"
7 WANT_AUTOCONF="2.1"
8 MOZ_ESR=""
9
10 # This list can be updated with scripts/get_langs.sh from the mozilla overlay
11 # No official support as of fetch time
12 # csb
13 MOZ_LANGS=( af ar as ast be bg bn-BD bn-IN br bs ca cs cy da de el en
14 en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa fi fr fy-NL ga-IE gd
15 gl gu-IN he hi-IN hr hu hy-AM id is it ja kk km kn ko lt lv mai mk ml mr
16 nb-NO nl nn-NO or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta te
17 th tr uk vi xh zh-CN zh-TW )
18
19 # Convert the ebuild version to the upstream mozilla version, used by mozlinguas
20 MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
21 MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
22 MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
23
24 if [[ ${MOZ_ESR} == 1 ]]; then
25 # ESR releases have slightly version numbers
26 MOZ_PV="${MOZ_PV}esr"
27 fi
28
29 # Patch version
30 PATCH="${PN}-38.0-patches-0.3"
31 # Upstream ftp release URI that's used by mozlinguas.eclass
32 # We don't use the http mirror because it deletes old tarballs.
33 MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases"
34 MOZ_HTTP_URI="http://ftp.mozilla.org/pub/${PN}/releases"
35
36 MOZCONFIG_OPTIONAL_WIFI=1
37 MOZCONFIG_OPTIONAL_JIT="enabled"
38
39 inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v6.39 multilib pax-utils fdo-mime autotools virtualx mozlinguas
40
41 DESCRIPTION="Firefox Web Browser"
42 HOMEPAGE="http://www.mozilla.com/firefox"
43
44 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
45
46 SLOT="0"
47 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
48 IUSE="bindist egl hardened +minimal neon pgo selinux +gmp-autoupdate test"
49 RESTRICT="!bindist? ( bindist )"
50
51 # More URIs appended below...
52 SRC_URI="${SRC_URI}
53 http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
54 http://dev.gentoo.org/~axs/distfiles/${PATCH}.tar.xz
55 http://dev.gentoo.org/~polynomial-c/mozilla/patchsets/${PATCH}.tar.xz"
56
57 ASM_DEPEND=">=dev-lang/yasm-1.1"
58
59 # Mesa 7.10 needed for WebGL + bugfixes
60 RDEPEND="
61 >=dev-libs/nss-3.19.2
62 >=dev-libs/nspr-4.10.8
63 selinux? ( sec-policy/selinux-mozilla )"
64
65 DEPEND="${RDEPEND}
66 pgo? (
67 >=sys-devel/gcc-4.5 )
68 amd64? ( ${ASM_DEPEND}
69 virtual/opengl )
70 x86? ( ${ASM_DEPEND}
71 virtual/opengl )"
72
73 # No source releases for alpha|beta
74 if [[ ${PV} =~ alpha ]]; then
75 CHANGESET="8a3042764de7"
76 SRC_URI="${SRC_URI}
77 http://dev.gentoo.org/~nirbheek/mozilla/firefox/firefox-${MOZ_PV}_${CHANGESET}.source.tar.bz2"
78 S="${WORKDIR}/mozilla-aurora-${CHANGESET}"
79 elif [[ ${PV} =~ beta ]]; then
80 S="${WORKDIR}/mozilla-release"
81 SRC_URI="${SRC_URI}
82 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
83 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
84 else
85 SRC_URI="${SRC_URI}
86 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
87 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
88 if [[ ${MOZ_ESR} == 1 ]]; then
89 S="${WORKDIR}/mozilla-esr${PV%%.*}"
90 else
91 S="${WORKDIR}/mozilla-release"
92 fi
93 fi
94
95 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
96
97 BUILD_OBJ_DIR="${S}/ff"
98
99 pkg_setup() {
100 moz_pkgsetup
101
102 # Avoid PGO profiling problems due to enviroment leakage
103 # These should *always* be cleaned up anyway
104 unset DBUS_SESSION_BUS_ADDRESS \
105 DISPLAY \
106 ORBIT_SOCKETDIR \
107 SESSION_MANAGER \
108 XDG_SESSION_COOKIE \
109 XAUTHORITY
110
111 if ! use bindist; then
112 einfo
113 elog "You are enabling official branding. You may not redistribute this build"
114 elog "to any users on your network or the internet. Doing so puts yourself into"
115 elog "a legal problem with Mozilla Foundation"
116 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
117 fi
118
119 if use pgo; then
120 einfo
121 ewarn "You will do a double build for profile guided optimization."
122 ewarn "This will result in your build taking at least twice as long as before."
123 fi
124 }
125
126 pkg_pretend() {
127 # Ensure we have enough disk space to compile
128 if use pgo || use debug || use test ; then
129 CHECKREQS_DISK_BUILD="8G"
130 else
131 CHECKREQS_DISK_BUILD="4G"
132 fi
133 check-reqs_pkg_setup
134 }
135
136 src_unpack() {
137 unpack ${A}
138
139 # Unpack language packs
140 mozlinguas_src_unpack
141 }
142
143 src_prepare() {
144 # Apply our patches
145 EPATCH_SUFFIX="patch" \
146 EPATCH_FORCE="yes" \
147 EPATCH_EXCLUDE="8010_bug114311-freetype26.patch" \
148 epatch "${WORKDIR}/firefox"
149 epatch "${FILESDIR}"/${PN}-38-hppa-js-syntax-error.patch #556196
150
151 # Allow user to apply any additional patches without modifing ebuild
152 epatch_user
153
154 # Enable gnomebreakpad
155 if use debug ; then
156 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
157 "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
158 fi
159
160 # Ensure that our plugins dir is enabled as default
161 sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
162 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
163 sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
164 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
165
166 # Fix sandbox violations during make clean, bug 372817
167 sed -e "s:\(/no-such-file\):${T}\1:g" \
168 -i "${S}"/config/rules.mk \
169 -i "${S}"/nsprpub/configure{.in,} \
170 || die
171
172 # Don't exit with error when some libs are missing which we have in
173 # system.
174 sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
175 -i "${S}"/browser/installer/Makefile.in || die
176
177 # Don't error out when there's no files to be removed:
178 sed 's@\(xargs rm\)$@\1 -f@' \
179 -i "${S}"/toolkit/mozapps/installer/packager.mk || die
180
181 eautoreconf
182
183 # Must run autoconf in js/src
184 cd "${S}"/js/src || die
185 eautoconf
186
187 # Need to update jemalloc's configure
188 cd "${S}"/memory/jemalloc/src || die
189 WANT_AUTOCONF= eautoconf
190 }
191
192 src_configure() {
193 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
194 MEXTENSIONS="default"
195 # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
196 # Note: These are for Gentoo Linux use ONLY. For your own distribution, please
197 # get your own set of keys.
198 _google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
199
200 ####################################
201 #
202 # mozconfig, CFLAGS and CXXFLAGS setup
203 #
204 ####################################
205
206 mozconfig_init
207 mozconfig_config
208
209 # It doesn't compile on alpha without this LDFLAGS
210 use alpha && append-ldflags "-Wl,--no-relax"
211
212 # Add full relro support for hardened
213 use hardened && append-ldflags "-Wl,-z,relro,-z,now"
214
215 if use neon ; then
216 mozconfig_annotate '' --with-fpu=neon
217 mozconfig_annotate '' --with-thumb=yes
218 mozconfig_annotate '' --with-thumb-interwork=no
219 fi
220
221 if [[ ${CHOST} == armv* ]] ; then
222 mozconfig_annotate '' --with-float-abi=hard
223 mozconfig_annotate '' --enable-skia
224
225 if ! use system-libvpx ; then
226 sed -i -e "s|softfp|hard|" \
227 "${S}"/media/libvpx/moz.build
228 fi
229 fi
230
231 use egl && mozconfig_annotate 'Enable EGL as GL provider' --with-gl-provider=EGL
232
233 # Setup api key for location services
234 echo -n "${_google_api_key}" > "${S}"/google-api-key
235 mozconfig_annotate '' --with-google-api-keyfile="${S}/google-api-key"
236
237 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
238 mozconfig_annotate '' --disable-mailnews
239
240 # Other ff-specific settings
241 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
242
243 # Allow for a proper pgo build
244 if use pgo; then
245 echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
246 fi
247
248 echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
249
250 # Finalize and report settings
251 mozconfig_final
252
253 if [[ $(gcc-major-version) -lt 4 ]]; then
254 append-cxxflags -fno-stack-protector
255 fi
256
257 # workaround for funky/broken upstream configure...
258 emake -f client.mk configure
259 }
260
261 src_compile() {
262 if use pgo; then
263 addpredict /root
264 addpredict /etc/gconf
265 # Reset and cleanup environment variables used by GNOME/XDG
266 gnome2_environment_reset
267
268 # Firefox tries to use dri stuff when it's run, see bug 380283
269 shopt -s nullglob
270 cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
271 if test -z "${cards}"; then
272 cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
273 if test -n "${cards}"; then
274 # Binary drivers seem to cause access violations anyway, so
275 # let's use indirect rendering so that the device files aren't
276 # touched at all. See bug 394715.
277 export LIBGL_ALWAYS_INDIRECT=1
278 fi
279 fi
280 shopt -u nullglob
281 addpredict "${cards}"
282
283 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
284 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
285 Xemake -f client.mk profiledbuild || die "Xemake failed"
286 else
287 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
288 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
289 emake -f client.mk realbuild
290 fi
291
292 }
293
294 src_install() {
295 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
296 DICTPATH="\"${EPREFIX}/usr/share/myspell\""
297
298 cd "${BUILD_OBJ_DIR}" || die
299
300 # Pax mark xpcshell for hardened support, only used for startupcache creation.
301 pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
302
303 # Add our default prefs for firefox
304 cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
305 "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
306 || die
307
308 # Set default path to search for dictionaries.
309 echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
310 >> "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
311 || die
312
313 echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
314 "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
315 || die
316
317 local plugin
318 use gmp-autoupdate || for plugin in \
319 gmp-gmpopenh264 ; do
320 echo "pref(\"media.${plugin}.autoupdate\", false);" >> \
321 "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
322 || die
323 done
324
325 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
326 emake DESTDIR="${D}" install
327
328 # Install language packs
329 mozlinguas_src_install
330
331 local size sizes icon_path icon name
332 if use bindist; then
333 sizes="16 32 48"
334 icon_path="${S}/browser/branding/aurora"
335 # Firefox's new rapid release cycle means no more codenames
336 # Let's just stick with this one...
337 icon="aurora"
338 name="Aurora"
339 else
340 sizes="16 22 24 32 256"
341 icon_path="${S}/browser/branding/official"
342 icon="${PN}"
343 name="Mozilla Firefox"
344 fi
345
346 # Install icons and .desktop for menu entry
347 for size in ${sizes}; do
348 insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
349 newins "${icon_path}/default${size}.png" "${icon}.png"
350 done
351 # The 128x128 icon has a different name
352 insinto "/usr/share/icons/hicolor/128x128/apps"
353 newins "${icon_path}/mozicon128.png" "${icon}.png"
354 # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
355 newicon "${icon_path}/content/icon48.png" "${icon}.png"
356 newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
357 sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
358 "${ED}/usr/share/applications/${PN}.desktop" || die
359
360 # Add StartupNotify=true bug 237317
361 if use startup-notification ; then
362 echo "StartupNotify=true"\
363 >> "${ED}/usr/share/applications/${PN}.desktop" \
364 || die
365 fi
366
367 # Required in order to use plugins and even run firefox on hardened.
368 if use jit; then
369 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin,plugin-container}
370 else
371 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/plugin-container
372 fi
373
374 if use minimal; then
375 rm -r "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} \
376 || die "Failed to remove sdk and headers"
377 fi
378
379 # very ugly hack to make firefox not sigbus on sparc
380 # FIXME: is this still needed??
381 use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
382 -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" \
383 || die "sparc sed failed"; }
384
385 # revdep-rebuild entry
386 insinto /etc/revdep-rebuild
387 echo "SEARCH_DIRS_MASK=${MOZILLA_FIVE_HOME}" >> ${T}/10firefox
388 doins "${T}"/10${PN} || die
389 }
390
391 pkg_preinst() {
392 gnome2_icon_savelist
393 }
394
395 pkg_postinst() {
396 # Update mimedb for the new .desktop file
397 fdo-mime_desktop_database_update
398 gnome2_icon_cache_update
399 }
400
401 pkg_postrm() {
402 gnome2_icon_cache_update
403 }

  ViewVC Help
Powered by ViewVC 1.1.20