commit:     1c6ba8dbc954b16d309fa1f61a833fc5027df320
Author:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 15 17:10:42 2018 +0000
Commit:     Ian Stakenvicius <axs <AT> gentoo <DOT> org>
CommitDate: Wed Aug 15 17:13:30 2018 +0000
URL:        https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=1c6ba8db

eclass/mozcoreconf-v6.eclass: adjust for PYTHON3 support in ebuilds

As python2 only has one slot, but python3 support is required for v61
and newer AND may be different from one mozilla release to another,
this commit honours the setting of PYTHON_COMPAT and PYTHON_REQ_USE
in the header of ebuilds so that python3 variants can be chosen
via python-any-r1.  If not specified, the previous python2-only
values are set for compatibility.

If a python3 variant is specified in PYTHON_COMPAT, then
after python-any-r1 has chosen the correct python variant to use
this value is set in the PYTHON3 environment variable, and then
PYTHON itself is forced back to python2 (since mozilla requires
both to build for the forseeable future)

 eclass/mozcoreconf-v6.eclass | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/eclass/mozcoreconf-v6.eclass b/eclass/mozcoreconf-v6.eclass
index 46d9cd3..930122f 100644
--- a/eclass/mozcoreconf-v6.eclass
+++ b/eclass/mozcoreconf-v6.eclass
@@ -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 <mozi...@gentoo.org>
 # @BLURB: core options and configuration functions for mozilla
@@ -16,8 +16,11 @@
 
 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
@@ -146,10 +154,12 @@ mozconfig_init() {
                seamonkey)
                        # Must create the initial mozconfig to enable 
application
                        : >.mozconfig || die "initial mozconfig creation failed"
+                       # NOTE--this is not compatible with mozilla prior to v60
                        mozconfig_annotate "" --enable-application=comm/suite ;;
                *thunderbird)
                        # Must create the initial mozconfig to enable 
application
                        : >.mozconfig || die "initial mozconfig creation failed"
+                       # NOTE--this is not compatible with mozilla prior to v60
                        mozconfig_annotate "" --enable-application=comm/mail ;;
        esac
 

Reply via email to