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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sat Aug 8 10:00:42 2015 UTC (4 years, 2 months ago) by ago
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
Stable for ppc, wrt bug #556942

(Portage version: 2.2.20/cvs/Linux x86_64, RepoMan options: --include-arches="ppc", signed Manifest commit with key 7194459F)

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-38.1.1.ebuild,v 1.3 2015/08/07 18:15:27 ago Exp $
4
5 EAPI="5"
6 VIRTUALX_REQUIRED="pgo"
7 WANT_AUTOCONF="2.1"
8 MOZ_ESR=1
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.38 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 "${WORKDIR}/firefox"
148 epatch "${FILESDIR}"/${PN}-38-hppa-js-syntax-error.patch #556196
149
150 # Allow user to apply any additional patches without modifing ebuild
151 epatch_user
152
153 # Enable gnomebreakpad
154 if use debug ; then
155 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
156 "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
157 fi
158
159 # Ensure that our plugins dir is enabled as default
160 sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
161 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
162 sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
163 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
164
165 # Fix sandbox violations during make clean, bug 372817
166 sed -e "s:\(/no-such-file\):${T}\1:g" \
167 -i "${S}"/config/rules.mk \
168 -i "${S}"/nsprpub/configure{.in,} \
169 || die
170
171 # Don't exit with error when some libs are missing which we have in
172 # system.
173 sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
174 -i "${S}"/browser/installer/Makefile.in || die
175
176 # Don't error out when there's no files to be removed:
177 sed 's@\(xargs rm\)$@\1 -f@' \
178 -i "${S}"/toolkit/mozapps/installer/packager.mk || die
179
180 eautoreconf
181
182 # Must run autoconf in js/src
183 cd "${S}"/js/src || die
184 eautoconf
185
186 # Need to update jemalloc's configure
187 cd "${S}"/memory/jemalloc/src || die
188 WANT_AUTOCONF= eautoconf
189 }
190
191 src_configure() {
192 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
193 MEXTENSIONS="default"
194 # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
195 # Note: These are for Gentoo Linux use ONLY. For your own distribution, please
196 # get your own set of keys.
197 _google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
198
199 ####################################
200 #
201 # mozconfig, CFLAGS and CXXFLAGS setup
202 #
203 ####################################
204
205 mozconfig_init
206 mozconfig_config
207
208 # It doesn't compile on alpha without this LDFLAGS
209 use alpha && append-ldflags "-Wl,--no-relax"
210
211 # Add full relro support for hardened
212 use hardened && append-ldflags "-Wl,-z,relro,-z,now"
213
214 if use neon ; then
215 mozconfig_annotate '' --with-fpu=neon
216 mozconfig_annotate '' --with-thumb=yes
217 mozconfig_annotate '' --with-thumb-interwork=no
218 fi
219
220 if [[ ${CHOST} == armv* ]] ; then
221 mozconfig_annotate '' --with-float-abi=hard
222 mozconfig_annotate '' --enable-skia
223
224 if ! use system-libvpx ; then
225 sed -i -e "s|softfp|hard|" \
226 "${S}"/media/libvpx/moz.build
227 fi
228 fi
229
230 use egl && mozconfig_annotate 'Enable EGL as GL provider' --with-gl-provider=EGL
231
232 # Setup api key for location services
233 echo -n "${_google_api_key}" > "${S}"/google-api-key
234 mozconfig_annotate '' --with-google-api-keyfile="${S}/google-api-key"
235
236 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
237 mozconfig_annotate '' --disable-mailnews
238
239 # Other ff-specific settings
240 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
241
242 # Allow for a proper pgo build
243 if use pgo; then
244 echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
245 fi
246
247 echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
248
249 # Finalize and report settings
250 mozconfig_final
251
252 if [[ $(gcc-major-version) -lt 4 ]]; then
253 append-cxxflags -fno-stack-protector
254 fi
255
256 # workaround for funky/broken upstream configure...
257 emake -f client.mk configure
258 }
259
260 src_compile() {
261 if use pgo; then
262 addpredict /root
263 addpredict /etc/gconf
264 # Reset and cleanup environment variables used by GNOME/XDG
265 gnome2_environment_reset
266
267 # Firefox tries to use dri stuff when it's run, see bug 380283
268 shopt -s nullglob
269 cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
270 if test -z "${cards}"; then
271 cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
272 if test -n "${cards}"; then
273 # Binary drivers seem to cause access violations anyway, so
274 # let's use indirect rendering so that the device files aren't
275 # touched at all. See bug 394715.
276 export LIBGL_ALWAYS_INDIRECT=1
277 fi
278 fi
279 shopt -u nullglob
280 addpredict "${cards}"
281
282 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
283 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
284 Xemake -f client.mk profiledbuild || die "Xemake failed"
285 else
286 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
287 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
288 emake -f client.mk realbuild
289 fi
290
291 }
292
293 src_install() {
294 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
295 DICTPATH="\"${EPREFIX}/usr/share/myspell\""
296
297 cd "${BUILD_OBJ_DIR}" || die
298
299 # Pax mark xpcshell for hardened support, only used for startupcache creation.
300 pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
301
302 # Add our default prefs for firefox
303 cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
304 "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
305 || die
306
307 # Set default path to search for dictionaries.
308 echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
309 >> "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
310 || die
311
312 echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
313 "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
314 || die
315
316 local plugin
317 use gmp-autoupdate || for plugin in \
318 gmp-gmpopenh264 ; do
319 echo "pref(\"media.${plugin}.autoupdate\", false);" >> \
320 "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
321 || die
322 done
323
324 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
325 emake DESTDIR="${D}" install
326
327 # Install language packs
328 mozlinguas_src_install
329
330 local size sizes icon_path icon name
331 if use bindist; then
332 sizes="16 32 48"
333 icon_path="${S}/browser/branding/aurora"
334 # Firefox's new rapid release cycle means no more codenames
335 # Let's just stick with this one...
336 icon="aurora"
337 name="Aurora"
338 else
339 sizes="16 22 24 32 256"
340 icon_path="${S}/browser/branding/official"
341 icon="${PN}"
342 name="Mozilla Firefox"
343 fi
344
345 # Install icons and .desktop for menu entry
346 for size in ${sizes}; do
347 insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
348 newins "${icon_path}/default${size}.png" "${icon}.png"
349 done
350 # The 128x128 icon has a different name
351 insinto "/usr/share/icons/hicolor/128x128/apps"
352 newins "${icon_path}/mozicon128.png" "${icon}.png"
353 # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
354 newicon "${icon_path}/content/icon48.png" "${icon}.png"
355 newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
356 sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
357 "${ED}/usr/share/applications/${PN}.desktop" || die
358
359 # Add StartupNotify=true bug 237317
360 if use startup-notification ; then
361 echo "StartupNotify=true"\
362 >> "${ED}/usr/share/applications/${PN}.desktop" \
363 || die
364 fi
365
366 # Required in order to use plugins and even run firefox on hardened.
367 if use jit; then
368 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin,plugin-container}
369 else
370 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/plugin-container
371 fi
372
373 if use minimal; then
374 rm -r "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} \
375 || die "Failed to remove sdk and headers"
376 fi
377
378 # very ugly hack to make firefox not sigbus on sparc
379 # FIXME: is this still needed??
380 use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
381 -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" \
382 || die "sparc sed failed"; }
383
384 # revdep-rebuild entry
385 insinto /etc/revdep-rebuild
386 echo "SEARCH_DIRS_MASK=${MOZILLA_FIVE_HOME}" >> ${T}/10firefox
387 doins "${T}"/10${PN} || die
388 }
389
390 pkg_preinst() {
391 gnome2_icon_savelist
392 }
393
394 pkg_postinst() {
395 # Update mimedb for the new .desktop file
396 fdo-mime_desktop_database_update
397 gnome2_icon_cache_update
398 }
399
400 pkg_postrm() {
401 gnome2_icon_cache_update
402 }

  ViewVC Help
Powered by ViewVC 1.1.20