Commit Graph

36 Commits

Author SHA1 Message Date
Michał Górny
ab6a4a2f53 python-utils-r1.eclass: Do not prefer Jython & PyPy over CPython
Fix _PYTHON_ALL_IMPLS to list Jython & PyPy before CPython versions,
therefore causing them not to be implicitly preferred over CPython.

The implementation reordering done in b284e54 ("reorder implementations
in semi-ascending order") has caused PyPy & Jython to be listed after
CPython. While seemingly it was more intuitive to list third-party
implementations after the reference one, it also implicitly caused them
to be preferred by python-exec.
2016-02-06 22:27:31 +01:00
Michał Górny
33380ad5e1 python*-r1.eclass: Commonize PYTHON_COMPAT processing, cache the result
Introduce a common _python_set_impls function in python-utils-r1.eclass
that validates and processes PYTHON_COMPAT, then stores the result in
_PYTHON_SUPPORTED_IMPLS and _PYTHON_UNSUPPORTED_IMPLS variables. Reuse
those variables in all python-r1 suite eclasses, effectively reducing
code duplication and providing cache for repeated implementation support
checks.
2015-12-22 23:12:23 +01:00
Michał Górny
01e902405d python*-r1.eclass: Replace non-portable use of 'declare -g'
Replace uses of 'declare -g -r' (bash-4.2+) with 'readonly'. Reported
by Arfrever. This time use split assignments followed by readonly calls
since combined calls work unreliably.
2015-12-11 23:42:33 +01:00
Mike Gilbert
d296b5daa5 Revert "python*-r1.eclass: Replace non-portable use of 'declare -g'"
This reverts commit 44d3345d82.

This was triggering "No supported implementation in PYTHON_COMPAT.".
2015-12-11 17:26:44 -05:00
Michał Górny
44d3345d82 python*-r1.eclass: Replace non-portable use of 'declare -g'
Replace uses of 'declare -g -r' (bash-4.2+) with 'readonly'. Reported
by Arfrever.
2015-12-11 22:27:19 +01:00
Michał Górny
f16b1c0b53 python-utils-r1.eclass: Disable jython2_5 2015-12-09 21:41:16 +01:00
Michał Górny
b284e54e19 python-utils-r1.eclass: Reorder implementations to semi-ascending order
Reorder the Python implementations to ascending version order, with
CPython listed first and other implementations in descending preference.

The previous ordering has been used for two reasons:

1. There were packages which supported Python 3.x or PyPy partially but
their documentation builds or test functions required CPython 2.x.
The specific ordering caused python_export_best (the predecessor of
python_setup) to use CPython 2.x for those tasks. This is now replaced
by explicit implementation restrictions in python_setup.

2. PyPy setup runs were usually slower than CPython, and CPython 3.x
runs were often slower due to 2to3 calls. Combined with parallel build
runs, this ordering caused slower builds to start earlier and sometimes
resulted in more efficient use of threads. However, nowadays we no
longer do parallel builds.

Therefore, it seems reasonable to finally reorder the implementations
into a more intuitive order.
2015-12-09 21:41:16 +01:00
Michał Górny
8d08aef9ec python-utils-r1.eclass: Mark _PYTHON_ALL_IMPLS read-only 2015-12-09 21:41:16 +01:00
Mike Gilbert
f946bebc3f python-utils-r1.eclass: Change python_export_utf8_locale to deal with LC_ALL=C
Paludis sets LC_ALL=C to ensure a 'sane' build environment.
We only want to override LC_CTYPE, so we break LC_ALL into separate
LC_* overrides and set LC_ALL to blank.
2015-12-03 11:43:44 -05:00
Michał Górny
283da8a1e1 python-utils-r1.eclass: _python_check_locale_sanity, fix quoting issue 2015-11-30 14:29:23 +01:00
Michał Górny
5f35965531 python-utils-r1.eclass: Reduce python_do*/new* ban to EAPI < 4
Fix python_do* and python_new* helper ban to EAPIs older than 4. That
was the original intent, and restricting it to 5+ breaks old
dev-lang/python ebuilds.
2015-11-29 09:19:16 +01:00
Michał Górny
36ca742396 python-utils-r1.eclass: Enable EAPI 6 2015-11-28 20:09:06 +01:00
Michał Górny
6a0597dada python-utils-r1.eclass: Make heredocs consistent 2015-11-28 20:09:06 +01:00
Michał Górny
e67a293e26 python-utils-r1.eclass: Support nonfatal in python_do* and python_new* 2015-11-28 20:09:06 +01:00
Michał Górny
991e139992 python-utils-r1.eclass: Remove unneeded multilib inherit in EAPI 6 2015-11-28 20:09:06 +01:00
Michał Górny
9e00927e4e python-utils-r1.eclass: Make python_fix_shebang QAwarns fatal in EAPI 6 2015-11-28 20:09:06 +01:00
Michał Górny
a2c3f26426 python-utils-r1.eclass: Ban installation helpers in EAPIs < 5
Ban python_do* and python_new* helpers in EAPIs older than 5. We should
ban them in python-any-r1 uses, actually but that would break
dev-python/pypy* ebuilds as they are written now.
2015-11-28 20:09:06 +01:00
Michał Górny
0951efe8cb python-utils-r1.eclass: Replace local INSDESTTREE with subshells
Replace the 'local INSDESTTREE' hacks (which are PMS-valid yet
deprecated) with safer subshells.
2015-11-28 20:09:06 +01:00
Michał Górny
2421e06b05 python-utils-r1.eclass: Remove py2.6 note from python_optimize 2015-11-28 20:09:06 +01:00
Michał Górny
64f62e4bfa python-utils-r1.eclass: python_fix_shebang, accept symlink as parameter
Add '-H' option to find to allow following symlinks passed as
parameters. This makes python_fix_shebang handle either file symlinks
passed directly, or directory symlinks passed directly for recursive
traversal. Both were currently ignored silently.
2015-11-28 20:09:06 +01:00
Michał Górny
a3853d54e9 python-utils-r1.eclass: Add missing ||die on file read 2015-11-28 20:09:06 +01:00
Michał Górny
de298a8cdc python-utils-r1.eclass: Add missing ||die on 'cat' file writes 2015-11-28 20:09:06 +01:00
Michał Górny
2a39ec2a3d python-utils-r1.eclass: Add missing ||die for external getters 2015-11-28 20:09:06 +01:00
Michał Górny
09475a2f59 python-utils-r1.eclass: python_export_utf8_locale(), ensure sane locale
Ensure that the locale selected by python_export_utf8_locale() conforms
to POSIX-ish case conversions. Otherwise, we may accidentally force
a locale that will break random ebuilds and programs.
2015-11-28 20:09:06 +01:00
Michał Górny
a3535feb5a python-utils-r1.eclass: python_export(), always respect PYTHON
Respect pre-set PYTHON in python_export(), unless a new value is
requested. Bail out if PYTHON is neither set, nor requested.
2015-11-12 17:03:16 +01:00
Michał Górny
59e7fab60e python-utils-r1.eclass: wrapper, PYTHON_CONFIG is valid only for CPython 2015-11-11 13:21:21 +01:00
Michał Górny
e7536eccab python-utils-r1.eclass: Reuse PYTHON_CONFIG in python_wrapper_setup() 2015-11-11 11:21:41 +01:00
Michał Górny
0f076c6564 python-utils-r1.eclass: Support getting PYTHON_CONFIG path 2015-11-11 11:21:33 +01:00
Michał Górny
fd4001e968 python-utils-r1.eclass: Obtain PYTHON_SITEDIR from the interpreter
Obtain the Python site-packages directory path using
the distutils.sysconfig module, rather than hardcoding it.
2015-11-11 11:21:25 +01:00
Michał Górny
e0d0c11486 python-utils-r1.eclass: Obtain library path from the interpreter
Obtain library path as concatenation of LIBDIR and LDLIBRARY config
variables (from sysconfig module) rather than hardcoding it in the
eclass. This improves maintainability and fixes compatibility with
ABIFLAGS-enabled Python 3.3+.
2015-11-11 11:21:17 +01:00
Michał Górny
6cdbddf775 python-utils-r1.eclass: Obtain include directory from the interpreter
Obtain the Python include directory using the distutils.sysconfig module
of the Python interpreter rather than hardcoding values for it. This
makes the code more maintainable, and clears the way for re-enabling
ABIFLAGS on new Python versions.
2015-11-11 11:21:09 +01:00
Michał Górny
85b6221484 python-utils-r1.eclass: set PYTHON locally in python_export()
Ensure that PYTHON is always set inside python_export() for convenience.
If it wasn't requested for explicit export, make it a local variable.
2015-11-11 11:21:02 +01:00
Mike Frysinger
699fde68df python-utils-r1.eclass: python_export_utf8_locale: do not spew warnings when locale is not available
If the `locale` isn't available, there's nothing this func can do,
so just return quickly and assume the system is sane.
2015-10-10 14:22:54 -04:00
Mike Gilbert
0069399e50 python-utils-r1.eclass: Add support for python3.5 2015-10-04 09:35:45 -04:00
Mike Frysinger
a3dac837fc eclass: fix various doc errors #537392 2015-08-14 00:05:33 -04:00
Robin H. Johnson
56bd759df1 proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.

This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.

Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
2015-08-08 17:38:18 -07:00