mozcoreconf-v6.eclass: synchronize with changes from mozilla overlay
authorThomas Deutschmann <whissi@gentoo.org>
Wed, 5 Sep 2018 23:08:15 +0000 (01:08 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Thu, 6 Sep 2018 00:44:14 +0000 (02:44 +0200)
eclass/mozcoreconf-v6.eclass

index 403740c12410736fd83d20a5618ce5c407661a40..930122fc886f13e08b0cdd5f2b35dc6acab1875c 100644 (file)
@@ -1,7 +1,7 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 #
-# @ECLASS: mozcoreconf-v5.eclass
+# @ECLASS: mozcoreconf-v6.eclass
 # @MAINTAINER:
 # Mozilla team <mozilla@gentoo.org>
 # @BLURB: core options and configuration functions for mozilla
 
 if [[ ! ${_MOZCORECONF} ]]; then
 
+# for compatibility with packages prior to v1
+if [[ -z ${PYTHON_COMPAT[@]} ]]; then
 PYTHON_COMPAT=( python2_7 )
 PYTHON_REQ_USE='ncurses,sqlite,ssl,threads'
+fi
 
 inherit multilib toolchain-funcs flag-o-matic python-any-r1 versionator
 
@@ -112,6 +115,11 @@ moz_pkgsetup() {
        fi
 
        python-any-r1_pkg_setup
+       # workaround to set python3 into PYTHON3 until mozilla doesn't need py2
+       if [[ "${PYTHON_COMPAT[@]}" != "${PYTHON_COMPAT[@]#python3*}" ]]; then
+               export PYTHON3=${PYTHON}
+               python_export python2_7 PYTHON EPYTHON
+       fi
 }
 
 # @FUNCTION: mozconfig_init
@@ -124,6 +132,7 @@ mozconfig_init() {
        declare FF=$([[ ${PN} == firefox ]] && echo true || echo false)
        declare SM=$([[ ${PN} == seamonkey ]] && echo true || echo false)
        declare TB=$([[ ${PN} == thunderbird ]] && echo true || echo false)
+       declare TRB=$([[ ${PN} == torbrowser ]] && echo true || echo false)
 
        ####################################
        #
@@ -139,6 +148,9 @@ mozconfig_init() {
                *firefox)
                        cp browser/config/mozconfig .mozconfig \
                                || die "cp browser/config/mozconfig failed" ;;
+               *torbrowser)
+                       cp browser/config/mozconfig .mozconfig \
+                               || die "cp browser/config/mozconfig failed" ;;
                seamonkey)
                        # Must create the initial mozconfig to enable application
                        : >.mozconfig || die "initial mozconfig creation failed"
@@ -158,7 +170,7 @@ mozconfig_init() {
        ####################################
 
        # Set optimization level
-       if [[ $(gcc-major-version) -ge 7 ]]; then
+       if [[ $(gcc-major-version) -eq 7 ]]; then
                mozconfig_annotate "Workaround known breakage" --enable-optimize=-O2
        elif [[ ${ARCH} == hppa ]]; then
                mozconfig_annotate "more than -O0 causes a segfault on hppa" --enable-optimize=-O0