Gentoo Archives: gentoo-commits

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