portage-overlay

personal portage ebuild repository
git clone anongit@rnpnr.xyz:portage-overlay.git
Log | Files | Refs | Feed | README

Commit: b1813b9f6d1a648317ce81fca7b4b45a4158250b
Parent: 9d16ca08ae5819022c626ce3660e273b3ef3ce6d
Author: opask
Date:   Wed, 27 Feb 2019 09:44:23 -0700

clean up some useless features in firefox ebuild,
add modified mozconfig eclass

Diffstat:
Aeclass/mozconfig-v6.52.eclass | 288+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mwww-client/firefox/firefox-52.9.0.ebuild | 85++++---------------------------------------------------------------------------
2 files changed, 292 insertions(+), 81 deletions(-)

diff --git a/eclass/mozconfig-v6.52.eclass b/eclass/mozconfig-v6.52.eclass @@ -0,0 +1,288 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# +# @ECLASS: mozconfig-v6.52.eclass +# @MAINTAINER: +# mozilla team <mozilla@gentoo.org> +# @SUPPORTED_EAPIS: 5 6 7 +# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v6 +# @DESCRIPTION: +# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey) +# to provide a single common place for the common mozilla engine compoments. +# +# The eclass provides all common dependencies as well as common use flags. +# +# Some use flags which may be optional in particular mozilla packages can be +# supported through setting eclass variables. +# +# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3, +# and so ebuilds inheriting this eclass do not need to inherit that. + +inherit flag-o-matic toolchain-funcs mozcoreconf-v5 + +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3 +# @DEFAULT_UNSET +# @DESCRIPTION: +# Set this variable before the inherit line, when an ebuild can provide +# optional gtk3 support via IUSE="force-gtk3". Currently this would include +# thunderbird and seamonkey in the future, once support is ready for testing. +# +# Leave the variable UNSET if gtk3 support should not be optionally available. +# Set the variable to "enabled" if the use flag should be enabled by default. +# Set the variable to any value if the use flag should exist but not be default-enabled. +# If gtk+:3 is to be the standard toolkit, do not use this and instead use +# MOZCONFIG_OPTIONAL_GTK2ONLY. + +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK2ONLY +# @DEFAULT_UNSET +# @DESCRIPTION: +# Set this variable before the inherit line, when an ebuild can provide +# optional gtk2-only support via IUSE="gtk2". +# +# Note that this option conflicts directly with MOZCONFIG_OPTIONAL_GTK3, both +# variables cannot be set at the same time and this variable will be ignored if +# MOZCONFIG_OPTIONAL_GTK3 is set. +# +# Leave the variable UNSET if gtk2-only support should not be available. +# Set the variable to "enabled" if the use flag should be enabled by default. +# Set the variable to any value if the use flag should exist but not be default-enabled. + +# use-flags common among all mozilla ebuilds +IUSE="${IUSE} debug neon pulseaudio selinux startup-notification system-cairo + system-harfbuzz system-icu system-jpeg system-libevent system-sqlite system-libvpx" + +# some notes on deps: +# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14 +# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau + +RDEPEND=">=app-text/hunspell-1.2:= + dev-libs/atk + dev-libs/expat + >=x11-libs/cairo-1.10[X] + >=x11-libs/gtk+-2.18:2 + x11-libs/gdk-pixbuf + >=x11-libs/pango-1.22.0 + >=media-libs/libpng-1.6.25:0=[apng] + >=media-libs/mesa-10.2:* + media-libs/fontconfig + >=media-libs/freetype-2.4.10 + kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) ) + pulseaudio? ( || ( media-sound/pulseaudio + >=media-sound/apulse-0.1.9 ) ) + virtual/freedesktop-icon-theme + startup-notification? ( >=x11-libs/startup-notification-0.8 ) + >=dev-libs/glib-2.26:2 + >=sys-libs/zlib-1.2.3 + >=virtual/libffi-3.0.10 + virtual/ffmpeg + x11-libs/libX11 + x11-libs/libXcomposite + x11-libs/libXdamage + x11-libs/libXext + x11-libs/libXfixes + x11-libs/libXrender + x11-libs/libXt + system-cairo? ( >=x11-libs/cairo-1.12[X,xcb] >=x11-libs/pixman-0.19.2 ) + system-icu? ( >=dev-libs/icu-58.1:= ) + system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 ) + system-libevent? ( >=dev-libs/libevent-2.0:0= ) + system-sqlite? ( >=dev-db/sqlite-3.17.0:3[secure-delete,debug=] ) + system-libvpx? ( >=media-libs/libvpx-1.5.0:0=[postproc] ) + system-harfbuzz? ( >=media-libs/harfbuzz-1.3.3:0= >=media-gfx/graphite2-1.3.8 ) +" + +if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then + MOZCONFIG_OPTIONAL_GTK2ONLY= + if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then + IUSE+=" +force-gtk3" + else + IUSE+=" force-gtk3" + fi + RDEPEND+=" force-gtk3? ( >=x11-libs/gtk+-3.4.0:3 )" +elif [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then + if [[ ${MOZCONFIG_OPTIONAL_GTK2ONLY} = "enabled" ]]; then + IUSE+=" +gtk2" + else + IUSE+=" gtk2" + fi + RDEPEND+=" !gtk2? ( >=x11-libs/gtk+-3.4.0:3 )" +fi + +DEPEND="app-arch/zip + app-arch/unzip + >=sys-devel/binutils-2.16.1 + sys-apps/findutils + pulseaudio? ( media-sound/pulseaudio ) + ${RDEPEND}" + +RDEPEND+=" + pulseaudio? ( || ( media-sound/pulseaudio + >=media-sound/apulse-0.1.9 ) ) + selinux? ( sec-policy/selinux-mozilla )" + +# @FUNCTION: mozconfig_config +# @DESCRIPTION: +# Set common configure options for mozilla packages. +# Call this within src_configure() phase, after mozconfig_init +# +# Example: +# +# inherit mozconfig-v6.46 +# +# src_configure() { +# mozconfig_init +# mozconfig_config +# # ... misc ebuild-unique settings via calls to +# # ... mozconfig_{annotate,use_with,use_enable} +# mozconfig_final +# } + +mozconfig_config() { + # Migrated from mozcoreconf-2 + mozconfig_annotate 'system_libs' \ + --with-system-zlib \ + --with-system-bz2 + + if has bindist ${IUSE}; then + mozconfig_use_enable !bindist official-branding + if [[ ${PN} == firefox ]] && use bindist ; then + mozconfig_annotate '' --with-branding=browser/branding/aurora + fi + fi + + # Enable position independent executables + mozconfig_annotate 'enabled by Gentoo' --enable-pie + mozconfig_use_enable debug + mozconfig_use_enable debug tests + + if ! use debug ; then + mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols + else + mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols + fi + + mozconfig_use_enable startup-notification + + # These are enabled by default in all mozilla applications + mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr + mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr + mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir) + if use system-libevent; then + mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr + fi + mozconfig_annotate '' --prefix="${EPREFIX}"/usr + mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir) + mozconfig_annotate 'Gentoo default' --enable-system-hunspell + mozconfig_annotate '' --disable-gnomeui + mozconfig_annotate '' --enable-gio + mozconfig_annotate '' --disable-crashreporter + mozconfig_annotate 'Gentoo default' --with-system-png + mozconfig_annotate '' --enable-system-ffi + mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold + mozconfig_annotate '' --disable-gconf + + # default toolkit is cairo-gtk2, optional use flags can change this + local toolkit="cairo-gtk2" + local toolkit_comment="" + if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then + if use force-gtk3; then + toolkit="cairo-gtk3" + toolkit_comment="force-gtk3 use flag" + fi + fi + if [[ -n ${MOZCONFIG_OPTIONAL_GTK2ONLY} ]]; then + if ! use gtk2 ; then + toolkit="cairo-gtk3" + else + toolkit_comment="gtk2 use flag" + fi + fi + mozconfig_annotate "${toolkit_comment}" --enable-default-toolkit=${toolkit} + + # Disable malloc wrappers + mozconfig_annotate '' --disable-jemalloc + mozconfig_annotate '' --disable-replace-malloc + + mozconfig_annotate '' --disable-elf-hack + + # Disable bad features + mozconfig_annotate '' --disable-webrtc + mozconfig_annotate '' --disable-necko-wifi + mozconfig_annotate '' --disable-dbus + + # Instead of the standard --build= and --host=, mozilla uses --host instead + # of --build, and --target intstead of --host. + # Note, mozilla also has --build but it does not do what you think it does. + # Set both --target and --host as mozilla uses python to guess values otherwise + mozconfig_annotate '' --target="${CHOST}" + mozconfig_annotate '' --host="${CBUILD:-${CHOST}}" + + mozconfig_use_enable pulseaudio + # force the deprecated alsa sound code if pulseaudio is disabled + if use kernel_linux && ! use pulseaudio ; then + mozconfig_annotate '-pulseaudio' --enable-alsa + fi + + mozconfig_use_enable system-cairo + mozconfig_use_enable system-sqlite + mozconfig_use_with system-jpeg + mozconfig_use_with system-icu + mozconfig_use_with system-libvpx + mozconfig_use_with system-harfbuzz + mozconfig_use_with system-harfbuzz system-graphite2 + + # Modifications to better support ARM, bug 553364 + if use neon ; then + mozconfig_annotate '' --with-fpu=neon + mozconfig_annotate '' --with-thumb=yes + mozconfig_annotate '' --with-thumb-interwork=no + fi + if [[ ${CHOST} == armv* ]] ; then + mozconfig_annotate '' --with-float-abi=hard + if ! use system-libvpx ; then + sed -i -e "s|softfp|hard|" \ + "${S}"/media/libvpx/moz.build + fi + fi +} + +# @FUNCTION: mozconfig_install_prefs +# @DESCRIPTION: +# Set preferences into the prefs.js file specified as a parameter to +# the function. This sets both some common prefs to all mozilla +# packages, and any prefs that may relate to the use flags administered +# by mozconfig_config(). +# +# Call this within src_install() phase, after copying the template +# prefs file (if any) from ${FILESDIR} +# +# Example: +# +# inherit mozconfig-v6.46 +# +# src_install() { +# cp "${FILESDIR}"/gentoo-default-prefs.js \ +# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \ +# || die +# +# mozconfig_install_prefs \ +# "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" +# +# ... +# } + +mozconfig_install_prefs() { + local prefs_file="${1}" + + einfo "Adding prefs from mozconfig to ${prefs_file}" + + # set dictionary path, to use system hunspell + echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \ + >>"${prefs_file}" || die + + # force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it + if use system-harfbuzz ; then + echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \ + >>"${prefs_file}" || die + fi +} diff --git a/www-client/firefox/firefox-52.9.0.ebuild b/www-client/firefox/firefox-52.9.0.ebuild @@ -6,7 +6,7 @@ VIRTUALX_REQUIRED="pgo" WANT_AUTOCONF="2.1" MOZ_ESR=1 -# Convert the ebuild version to the upstream mozilla version, used by mozlinguas +# Convert the ebuild version to the upstream mozilla version MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI @@ -21,18 +21,17 @@ PATCH="${PN}-52.5-patches-02" MOZ_HTTP_URI="https://archive.mozilla.org/pub/${PN}/releases" MOZCONFIG_OPTIONAL_GTK2ONLY=1 -MOZCONFIG_OPTIONAL_WIFI=1 -inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v6.52 pax-utils xdg-utils autotools virtualx +inherit check-reqs flag-o-matic toolchain-funcs eutils mozconfig-v6.52 pax-utils autotools virtualx DESCRIPTION="Firefox Web Browser" HOMEPAGE="https://www.mozilla.org/firefox" -KEYWORDS="~alpha amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux" +KEYWORDS="amd64 x86" SLOT="0" LICENSE="MPL-2.0 GPL-2 LGPL-2.1" -IUSE="bindist eme-free +gmp-autoupdate hardened hwaccel pgo rust selinux test" +IUSE="bindist +eme-free gmp-autoupdate hardened +hwaccel pgo rust selinux test" RESTRICT="!bindist? ( bindist )" PATCH_URIS=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c}/mozilla/patchsets/${PATCH}.tar.xz ) @@ -107,13 +106,6 @@ pkg_pretend() { check-reqs_pkg_setup } -src_unpack() { - unpack ${A} - - # Unpack language packs - mozlinguas_src_unpack -} - src_prepare() { # Apply our patches rm -f "${WORKDIR}"/firefox/2007_fix_nvidia_latest.patch @@ -128,16 +120,6 @@ src_prepare() { "${S}"/build/unix/run-mozilla.sh || die "sed failed!" fi - # Drop -Wl,--as-needed related manipulation for ia64 as it causes ld sefgaults, bug #582432 - if use ia64 ; then - sed -i \ - -e '/^OS_LIBS += no_as_needed/d' \ - -e '/^OS_LIBS += as_needed/d' \ - "${S}"/widget/gtk/mozgtk/gtk2/moz.build \ - "${S}"/widget/gtk/mozgtk/gtk3/moz.build \ - || die "sed failed to drop --as-needed for ia64" - fi - # Ensure that our plugins dir is enabled as default sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \ "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!" @@ -182,10 +164,6 @@ src_prepare() { src_configure() { MEXTENSIONS="default" - # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) - # Note: These are for Gentoo Linux use ONLY. For your own distribution, please - # get your own set of keys. - _google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc #################################### # @@ -198,19 +176,12 @@ src_configure() { use eme-free && mozconfig_annotate '+eme-free' --disable-eme - # It doesn't compile on alpha without this LDFLAGS - use alpha && append-ldflags "-Wl,--no-relax" - # Add full relro support for hardened use hardened && append-ldflags "-Wl,-z,relro,-z,now" # Only available on mozilla-overlay for experimentation -- Removed in Gentoo repo per bug 571180 #use egl && mozconfig_annotate 'Enable EGL as GL provider' --with-gl-provider=EGL - # Setup api key for location services - echo -n "${_google_api_key}" > "${S}"/google-api-key - mozconfig_annotate '' --with-google-api-keyfile="${S}/google-api-key" - mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}" mozconfig_use_enable rust @@ -301,18 +272,7 @@ src_install() { MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \ emake DESTDIR="${D}" install - # Install language packs - mozlinguas_src_install - - local size sizes icon_path icon name if use bindist; then - sizes="16 32 48" - icon_path="${S}/browser/branding/aurora" - # Firefox's new rapid release cycle means no more codenames - # Let's just stick with this one... - icon="aurora" - name="Aurora" - # Override preferences to set the MOZ_DEV_EDITION defaults, since we # don't define MOZ_DEV_EDITION to avoid profile debaucles. # (source: browser/app/profile/firefox.js) @@ -322,33 +282,6 @@ sticky_pref("lightweightThemes.selectedThemeID", "firefox-devedition@mozilla.org sticky_pref("browser.devedition.theme.enabled", true); sticky_pref("devtools.theme", "dark"); PROFILE_EOF - - else - sizes="16 22 24 32 256" - icon_path="${S}/browser/branding/official" - icon="${PN}" - name="Mozilla Firefox" - fi - - # Install icons and .desktop for menu entry - for size in ${sizes}; do - insinto "/usr/share/icons/hicolor/${size}x${size}/apps" - newins "${icon_path}/default${size}.png" "${icon}.png" - done - # The 128x128 icon has a different name - insinto "/usr/share/icons/hicolor/128x128/apps" - newins "${icon_path}/mozicon128.png" "${icon}.png" - # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs - newicon "${icon_path}/content/icon48.png" "${icon}.png" - newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop" - sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \ - "${ED}/usr/share/applications/${PN}.desktop" || die - - # Add StartupNotify=true bug 237317 - if use startup-notification ; then - echo "StartupNotify=true"\ - >> "${ED}/usr/share/applications/${PN}.desktop" \ - || die fi # Required in order to use plugins and even run firefox on hardened. @@ -356,8 +289,6 @@ PROFILE_EOF } pkg_preinst() { - gnome2_icon_savelist - # if the apulse libs are available in MOZILLA_FIVE_HOME then apulse # doesn't need to be forced into the LD_LIBRARY_PATH if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then @@ -376,10 +307,6 @@ pkg_preinst() { } pkg_postinst() { - # Update mimedb for the new .desktop file - xdg_desktop_database_update - gnome2_icon_cache_update - if ! use gmp-autoupdate && ! use eme-free ; then elog "USE='-gmp-autoupdate' has disabled the following plugins from updating or" elog "installing into new profiles:" @@ -393,7 +320,3 @@ pkg_postinst() { elog "media-sound/apulse." fi } - -pkg_postrm() { - gnome2_icon_cache_update -}