Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
problem installing net-zope/zope-fixers-1.0
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
mrtnfs
n00b
n00b


Joined: 13 Mar 2012
Posts: 13

PostPosted: Tue Mar 13, 2012 3:15 am    Post subject: problem installing net-zope/zope-fixers-1.0 Reply with quote

Hi, I'm fairly new to gentoo and am trying to install deluged. I have a problem with a particular package, net-zope/zope-fixers-1.0. portage fails to install it and cancel the entire process. I leave the log file and some other file that portage mentions. I hope someone can help. thanks

/var/tmp/portage/net-zope/zope-fixers-1.0/temp/build.log

Code:
 * Package:    net-zope/zope-fixers-1.0
 * Repository: gentoo
 * Maintainer: net-zope@gentoo.org
 * USE:        amd64 elibc_glibc kernel_linux multilib userland_GNU
 * FEATURES:   sandbox
>>> Unpacking source...
>>> Unpacking zope.fixers-1.0.tar.gz to /var/tmp/portage/net-zope/zope-fixers-1.0/work
>>> Source unpacked in /var/tmp/portage/net-zope/zope-fixers-1.0/work
>>> Preparing source in /var/tmp/portage/net-zope/zope-fixers-1.0/work/zope.fixers-1.0 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/net-zope/zope-fixers-1.0/work/zope.fixers-1.0 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/net-zope/zope-fixers-1.0/work/zope.fixers-1.0 ...
 * Building of net-zope/zope-fixers-1.0 with CPython 2.7...
python2.7 setup.py build -b build-2.7
Traceback (most recent call last):
  File "setup.py", line 19, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools
 * ERROR: net-zope/zope-fixers-1.0 failed (compile phase):
 *   Building failed with CPython 2.7 in distutils_building() function
 *
 * Call stack:
 *     ebuild.sh, line   85:  Called src_compile
 *   environment, line 3681:  Called distutils_src_compile
 *   environment, line 1005:  Called python_execute_function 'distutils_building'
 *   environment, line 2069:  Called die
 * The specific snippet of code:
 *                       die "${failure_message}";
 *
 * If you need support, post the output of 'emerge --info =net-zope/zope-fixers-1.0',
 * the complete build log and the output of 'emerge -pqv =net-zope/zope-fixers-1.0'.
 * The complete build log is located at '/var/tmp/portage/net-zope/zope-fixers-1.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-zope/zope-fixers-1.0/temp/environment'.
 * S: '/var/tmp/portage/net-zope/zope-fixers-1.0/work/zope.fixers-1.0'


emerge --info =net-zope/zope-fixers-1.0

Code:
Portage 2.1.10.44 (default/linux/amd64/10.0/desktop/gnome, gcc-4.5.3, glibc-2.13-r4, 3.2.1-gentoo-r2-custom x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.2.1-gentoo-r2-custom-x86_64-Intel-R-_Core-TM-_i5-2500K_CPU_@_3.30GHz-with-gentoo-2.0.3
Timestamp of tree: Tue, 13 Mar 2012 02:30:01 +0000
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="es_ES.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="es"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli colord consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr eds emboss encode evo exif fam firefox flac fortran gdbm gdu gif gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk iconv ipv6 jpeg lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg mudflap multilib nautilus ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf png policykit ppds pppd pulseaudio qt3support qt4 readline sdl session socialweb spell sse sse2 ssl startup-notification svg sysfs tcpd tiff truetype udev unicode usb vorbis x264 xcb xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="es" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


/var/tmp/portage/net-zope/zope-fixers-1.0/temp/environment

[code:1:b714e7bcc7]declare -x ABI="amd64"
declare -x ALSA_CARDS=""
declare -x ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol"
declare -x APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias"
declare -x ARCH="amd64"
declare -x BOOTSTRAP_USE="cxx unicode multilib"
declare -x CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump"
declare -x CAMERAS="ptp2"
declare -x CBUILD="x86_64-pc-linux-gnu"
declare -x CFLAGS="-march=native -O2 -pipe"
declare -x CFLAGS_amd64="-m64"
declare -x CFLAGS_default
declare -x CFLAGS_x32="-mx32"
declare -x CFLAGS_x86="-m32"
declare -x CHOST="x86_64-pc-linux-gnu"
declare -x CHOST_amd64="x86_64-pc-linux-gnu"
declare -x CHOST_default="x86_64-pc-linux-gnu"
declare -x CHOST_x32="x86_64-pc-linux-gnu"
declare -x CHOST_x86="i686-pc-linux-gnu"
declare -x COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
declare -x CROSSCOMPILE_OPTS=""
declare -x CTARGET_default="x86_64-pc-linux-gnu"
declare -x CXXFLAGS="-march=native -O2 -pipe"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-Zuh7EGpBaL,guid=52060abfa145795674893ff800000011"
declare -x DEFAULT_ABI="amd64"
declare -x DEFINED_PHASES=" compile install postinst postrm prepare test"
declare DEPEND="dev-python/setuptools >=app-admin/eselect-python-20091230 || ( =dev-lang/python-3.2* =dev-lang/python-3.1* =dev-lang/python-2.7* =dev-lang/python-2.6* )"
declare DESCRIPTION="2to3 fixers for Zope"
declare -x DESKTOP_SESSION="gnome"
declare -x DESTTREE="/usr"
declare -x DIROPTIONS="-m0755"
declare -- DISTUTILS_SRC_TEST="setup.py"
declare -- DOCS="CHANGES.txt README.txt"
declare -x EAPI="3"
declare -x ELIBC="glibc"
declare -x EXEOPTIONS="-m0755"
declare -x FCFLAGS=""
declare -x FETCHCOMMAND_SSH="bash -c \"x=\\\${2#ssh://} ; host=\\\${x%%/*} ; port=\\\${host##*:} ; host=\\\${host%:*} ; [[ \\\${host} = \\\${port} ]] && port=22 ; exec rsync --rsh=\\\"ssh -p\\\${port}\\\" -avP \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
declare -x FFLAGS=""
declare -x GCC_SPECS=""
declare -x GDK_USE_XFT="1"
declare -x GDMSESSION="gnome"
declare -x GDM_LANG="es_ES.utf8"
declare -x GJS_DEBUG_OUTPUT="stderr"
declare -x GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
declare -x GNOME_DESKTOP_SESSION_ID="this-is-deprecated"
declare -x GNOME_KEYRING_CONTROL="/tmp/keyring-GQ8GJX"
declare -x GNOME_KEYRING_PID="19760"
declare -x GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx"
declare -x GRUB_PLATFORMS=""
declare -x GSETTINGS_BACKEND="dconf"
declare HOMEPAGE="http://pypi.python.org/pypi/zope.fixers"
declare -x INHERITED=" multilib toolchain-funcs python distutils"
declare -x INPUT_DEVICE="evdev synaptics"
declare -x INPUT_DEVICES="keyboard mouse evdev"
declare -x INSDESTTREE=""
declare -x INSOPTIONS="-m0644"
declare IUSE=""
declare -x JAVAC="/etc/java-config-2/current-system-vm/bin/javac"
declare -x JAVA_HOME="/etc/java-config-2/current-system-vm"
declare -x JDK_HOME="/etc/java-config-2/current-system-vm"
declare -x KERNEL="linux"
declare -x KERNEL_ABI="amd64"
declare -x KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
declare -x KV="3.2.1-gentoo-r2-custom"
declare -x LANG="es_ES.utf8"
declare -x LCD_DEVICES=""
declare -x LC_MEASUREMENT="es_UY.utf8"
declare -x LC_MONETARY="es_UY.utf8"
declare -x LC_NUMERIC="es_UY.utf8"
declare -x LC_TIME="es_UY.utf8"
declare -x LDFLAGS="-Wl,-O1 -Wl,--as-needed"
declare -x LDFLAGS_amd64="-m elf_x86_64"
declare -x LDFLAGS_default
declare -x LDFLAGS_x32="-m elf32_x86_64"
declare -x LDFLAGS_x86="-m elf_i386"
declare -x LIBDIR_amd64="lib64"
declare -x LIBDIR_amd64_fbsd="lib64"
declare -x LIBDIR_default="lib"
declare -x LIBDIR_n32="lib32"
declare -x LIBDIR_n64="lib64"
declare -x LIBDIR_o32="lib"
declare -x LIBDIR_ppc="lib32"
declare -x LIBDIR_ppc64="lib64"
declare -x LIBDIR_s390="lib32"
declare -x LIBDIR_s390x="lib64"
declare -x LIBDIR_sparc32="lib32"
declare -x LIBDIR_sparc64="lib64"
declare -x LIBDIR_x32="libx32"
declare -x LIBDIR_x86="lib32"
declare -x LIBDIR_x86_fbsd="lib32"
declare -x LIBOPTIONS="-m0644"
declare -x LICENSE="ZPL"
declare -x LINGUAS="es"
declare -x MAKEOPTS="-j5"
declare -x MULTILIB_ABIS="amd64 x86"
declare -x MULTILIB_STRICT_DENY="64-bit.*shared object"
declare -x MULTILIB_STRICT_DIRS="/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib"
declare -x MULTILIB_STRICT_EXEMPT="(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage|udev)"
declare -- MY_P="zope.fixers-1.0"
declare -- MY_PN="zope.fixers"
declare -x NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"
declare -x OPENGL_PROFILE="xorg-x11"
declare -x ORBIT_SOCKETDIR="/tmp/orbit-martin"
declare -x PATH="/usr/lib64/portage/bin/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3"
declare PDEPEND=""
declare -x PHP_TARGETS=""
declare -x PKG_CONFIG_PATH="/usr/lib64/pkgconfig"
declare -a PORTAGE_DOCOMPRESS='([0]="/usr/share/doc" [1]="/usr/share/info" [2]="/usr/share/man")'
declare -a PORTAGE_DOCOMPRESS_SKIP='([0]="/usr/share/doc/zope-fixers-1.0/html")'
declare -x PRELINK_PATH_MASK="/usr/lib64/libfreebl3.so:/usr/lib64/libnssdbm3.so:/usr/lib64/libsoftokn3.so"
declare -x PROFILE_ONLY_VARIABLES="ARCH ELIBC KERNEL USERLAND"
declare -x PROPERTIES=""
declare -x PROVIDE=""
declare -x PYTHONDONTWRITEBYTECODE="1"
declare -- PYTHON_COLORS="0"
declare -- PYTHON_DEPEND="2:2.6 3:3.1"
declare -- PYTHON_MODNAME="zope/fixers"
declare -- PYTHON_TESTS_RESTRICTED_ABIS="2.*"
declare -- PYTHON_TEST_VERBOSITY="1"
declare -x RDEPEND=">=app-admin/eselect-python-20091230 || ( =dev-lang/python-3.2* =dev-lang/python-3.1* =dev-lang/python-2.7* =dev-lang/python-2.6* )"
declare REQUIRED_USE=""
declare -x RESTRICT=""
declare -- RESTRICT_PYTHON_ABIS="2.[45] 3.0"
declare -x RESUMECOMMAND_SSH="bash -c \"x=\\\${2#ssh://} ; host=\\\${x%%/*} ; port=\\\${host##*:} ; host=\\\${host%:*} ; [[ \\\${host} = \\\${port} ]] && port=22 ; exec rsync --rsh=\\\"ssh -p\\\${port}\\\" -avP \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
declare -x RUBY_TARGETS="ruby18"
declare -x S="/var/tmp/portage/net-zope/zope-fixers-1.0/work/zope.fixers-1.0"
declare -x SANDBOX_DEBUG="0"
declare -x SANDBOX_DENY=""
declare -x SANDBOX_PID="1649"
declare -x SANDBOX_PREDICT="/var/tmp/portage/net-zope/zope-fixers-1.0/homedir:/dev/crypto:/var/cache/fontconfig"
declare -x SANDBOX_READ="/:/var/tmp"
declare -x SANDBOX_VERBOSE="1"
declare -x SANDBOX_WRITE=":/dev/console:/dev/fd:/dev/full:/dev/null:/dev/pts/:/dev/pty:/dev/shm:/dev/tts:/dev/tty:/dev/vc/:/dev/zero:/proc/self/fd:/tmp/:/usr/lib32/cf:/usr/lib32/conftest:/usr/lib64/cf:/usr/lib64/conftest:/usr/lib/cf:/usr/lib/conftest:/usr/tmp/cf:/usr/tmp/conftest:/var/tmp:/var/tmp/:/var/tmp/portage/net-zope/zope-fixers-1.0/homedir/.bash_history"
declare -x SESSION_MANAGER="local/gentoo:@/tmp/.ICE-unix/19770,unix/gentoo:/tmp/.ICE-unix/19770"
declare -x SLOT="0"
declare SRC_URI="mirror://pypi/z/zope.fixers/zope.fixers-1.0.tar.gz"
declare -- SUPPORT_PYTHON_ABIS="1"
declare -x SYMLINK_LIB="yes"
declare -x USE="amd64 elibc_glibc kernel_linux multilib userland_GNU"
declare -x USERLAND="GNU"
declare -x USERNAME="martin"
declare -x VBOX_APP_HOME="/usr/lib64/virtualbox"
declare -x VIDEO_CARDS=""
declare -x WINDOWID="29360133"
declare -x WINDOWPATH="7"
declare -x XDG_CONFIG_DIRS="/etc/xdg"
declare -x XDG_DATA_DIRS="/usr/local/share:/usr/share:/usr/share/gdm"
declare -x XDG_MENU_PREFIX="gnome-"
declare -x XDG_SESSION_COOKIE="5eb1f71d1a11e9e083d08b7900000015-1331587938.750700-21236427"
declare -x XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
declare -a _CPYTHON2_GLOBALLY_SUPPORTED_ABIS='([0]="2.4" [1]="2.5" [2]="2.6" [3]="2.7")'
declare -a _CPYTHON3_GLOBALLY_SUPPORTED_ABIS='([0]="3.1" [1]="3.2")'
declare -x _E_DOCDESTTREE_=""
declare -x _E_EXEDESTTREE_=""
declare -a _JYTHON_GLOBALLY_SUPPORTED_ABIS='([0]="2.5-jython")'
declare -a _PYPY_GLOBALLY_SUPPORTED_ABIS='([0]="2.7-pypy-1.7" [1]="2.7-pypy-1.8")'
declare -- _PYTHON_ABI_EXTRACTION_COMMAND="import platform
import sys
sys.stdout.write(\".\".join(str(x) for x in sys.version_info[:2]))
if platform.system()[:4] == \"Java\":
sys.stdout.write(\"-jython\")
elif hasattr(platform, \"python_implementation\") and platform.python_implementation() == \"PyPy\":
sys.stdout.write(\"-pypy-\" + \".\".join(str(x) for x in sys.pypy_version_info[:2]))"
declare -- _PYTHON_ABI_PATTERN_REGEX="([[:alnum:]]|\\.|-|\\*|\\[|\\])+"
declare -- _PYTHON_ECLASS_INHERITED="1"
declare -a _PYTHON_GLOBALLY_SUPPORTED_ABIS='([0]="2.4" [1]="2.5" [2]="2.6" [3]="2.7" [4]="3.1" [5]="3.2" [6]="2.5-jython" [7]="2.7-pypy-1.7" [8]="2.7-pypy-1.8")'
declare -- _PYTHON_SHEBANG_BASE_PART_REGEX="^#![[:space:]]*([^[:space:]]*/usr/bin/env[[:space:]]+)?([^[:space:]]*/)?(jython|pypy-c|python)"
declare -- ___ECLASS_ONCE_MULTILIB="recur -_+^+_- spank"
declare -- ___ECLASS_ONCE_TOOLCHAIN_FUNCS="recur -_+^+_- spank"
declare -- phase_func
declare -- python="die"
PYTHON ()
{
_python_check_python_pkg_setup_execution;
local ABI_output="0" absolute_path_output="0" final_ABI="0" PYTHON_ABI="${PYTHON_ABI}" python_interpreter python2="0" python3="0";
while (($#)); do
case "$1" in
-2)
python2="1"
;;
-3)
python3="1"
;;
--ABI)
ABI_output="1"
;;
-a | --absolute-path)
absolute_path_output="1"
;;
-f | --final-ABI)
final_ABI="1"
;;
--)
shift;
break
;;
-*)
die "${FUNCNAME}(): Unrecognized option '$1'"
;;
*)
break
;;
esac;
shift;
done;
if [[ "${ABI_output}" == "1" && "${absolute_path_output}" == "1" ]]; then
die "${FUNCNAME}(): '--ABI' and '--absolute-path' options cannot be specified simultaneously";
fi;
if [[ "$((${python2} + ${python3} + ${final_ABI}))" -gt 1 ]]; then
die "${FUNCNAME}(): '-2', '-3' or '--final-ABI' options cannot be specified simultaneously";
fi;
if [[ "$#" -eq 0 ]]; then
if [[ "${final_ABI}" == "1" ]]; then
if ! _python_package_supporting_installation_for_multiple_python_abis; then
die "${FUNCNAME}(): '--final-ABI' option cannot be used in ebuilds of packages not supporting installation for multiple Python ABIs";
fi;
_python_calculate_PYTHON_ABIS;
PYTHON_ABI="${PYTHON_ABIS##* }";
else
if [[ "${python2}" == "1" ]]; then
PYTHON_ABI="$(ROOT="/" eselect python show --python2 --ABI)";
if [[ -z "${PYTHON_ABI}" ]]; then
die "${FUNCNAME}(): Active version of CPython 2 not set";
else
if [[ "${PYTHON_ABI}" != "2."* ]]; then
die "${FUNCNAME}(): Internal error in \`eselect python show --python2\`";
fi;
fi;
else
if [[ "${python3}" == "1" ]]; then
PYTHON_ABI="$(ROOT="/" eselect python show --python3 --ABI)";
if [[ -z "${PYTHON_ABI}" ]]; then
die "${FUNCNAME}(): Active version of CPython 3 not set";
else
if [[ "${PYTHON_ABI}" != "3."* ]]; then
die "${FUNCNAME}(): Internal error in \`eselect python show --python3\`";
fi;
fi;
else
if _python_package_supporting_installation_for_multiple_python_abis; then
if ! _python_abi-specific_local_scope; then
die "${FUNCNAME}() should be used in ABI-specific local scope";
fi;
else
PYTHON_ABI="$("${EPREFIX}/usr/bin/python" -c "${_PYTHON_ABI_EXTRACTION_COMMAND}")";
if [[ -z "${PYTHON_ABI}" ]]; then
die "${FUNCNAME}(): Failure of extraction of locally active version of Python";
fi;
fi;
fi;
fi;
fi;
else
if [[ "$#" -eq 1 ]]; then
if [[ "${final_ABI}" == "1" ]]; then
die "${FUNCNAME}(): '--final-ABI' option and Python ABI cannot be specified simultaneously";
fi;
if [[ "${python2}" == "1" ]]; then
die "${FUNCNAME}(): '-2' option and Python ABI cannot be specified simultaneously";
fi;
if [[ "${python3}" == "1" ]]; then
die "${FUNCNAME}(): '-3' option and Python ABI cannot be specified simultaneously";
fi;
PYTHON_ABI="$1";
else
die "${FUNCNAME}(): Invalid usage";
fi;
fi;
if [[ "${ABI_output}" == "1" ]]; then
echo -n "${PYTHON_ABI}";
return;
else
if [[ "$(_python_get_implementation "${PYTHON_ABI}")" == "CPython" ]]; then
python_interpreter="python${PYTHON_ABI}";
else
if [[ "$(_python_get_implementation "${PYTHON_ABI}")" == "Jython" ]]; then
python_interpreter="jython${PYTHON_ABI%-jython}";
else
if [[ "$(_python_get_implementation "${PYTHON_ABI}")" == "PyPy" ]]; then
python_interpreter="pypy-c${PYTHON_ABI#*-pypy-}";
fi;
fi;
fi;
if [[ "${absolute_path_output}" == "1" ]]; then
echo -n "${EPREFIX}/usr/bin/${python_interpreter}";
else
echo -n "${python_interpreter}";
fi;
fi;
if [[ -n "${ABI}" && "${ABI}" != "${DEFAULT_ABI}" && "${DEFAULT_ABI}" != "default" ]]; then
echo -n "-${ABI}";
fi
}
_distutils_get_PYTHONPATH ()
{
if _python_package_supporting_installation_for_multiple_python_abis && [[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
ls -d build-${PYTHON_ABI}/lib* 2> /dev/null;
else
ls -d build/lib* 2> /dev/null;
fi
}
_distutils_get_build_dir ()
{
if _python_package_supporting_installation_for_multiple_python_abis && [[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
echo "build-${PYTHON_ABI}";
else
echo "build";
fi
}
_distutils_hook ()
{
if [[ "$#" -ne 1 ]]; then
die "${FUNCNAME}() requires 1 argument";
fi;
if [[ "$(type -t "distutils_src_${EBUILD_PHASE}_$1_hook")" == "function" ]]; then
"distutils_src_${EBUILD_PHASE}_$1_hook";
fi
}
_distutils_prepare_current_working_directory ()
{
if [[ "$1" == *"|"*"|"* ]]; then
die "Element '$1' of DISTUTILS_SETUP_FILES array has invalid syntax";
fi;
if [[ "$1" == *"|"* ]]; then
echo "${_BOLD}[${1%|*}]${_NORMAL}";
pushd "${1%|*}" > /dev/null || die "Entering directory '${1%|*}' failed";
fi
}
_distutils_prepare_global_options ()
{
local element option pattern;
if [[ -n "$(declare -p DISTUTILS_GLOBAL_OPTIONS 2> /dev/null)" && "$(declare -p DISTUTILS_GLOBAL_OPTIONS)" != "declare -a DISTUTILS_GLOBAL_OPTIONS="* ]]; then
die "DISTUTILS_GLOBAL_OPTIONS should be indexed array";
fi;
if has "${EAPI:-0}" 0 1 2 3; then
_DISTUTILS_GLOBAL_OPTIONS=("${DISTUTILS_GLOBAL_OPTIONS[@]}");
else
_DISTUTILS_GLOBAL_OPTIONS=();
for element in "${DISTUTILS_GLOBAL_OPTIONS[@]}";
do
if [[ ! "${element}" =~ ^[^[:space:]]+\ . ]]; then
die "Element '${element}' of DISTUTILS_GLOBAL_OPTIONS array has invalid syntax";
fi;
pattern="${element%% *}";
option="${element#* }";
if _python_check_python_abi_matching "${PYTHON_ABI}" "${pattern}"; then
_DISTUTILS_GLOBAL_OPTIONS+=("${option}");
fi;
done;
fi
}
_distutils_restore_current_working_directory ()
{
if [[ "$1" == *"|"* ]]; then
popd > /dev/null || die "Leaving directory '${1%|*}' failed";
fi
}
_distutils_src_test_hook ()
{
if [[ "$#" -ne 1 ]]; then
die "${FUNCNAME}() requires 1 arguments";
fi;
if ! _python_package_supporting_installation_for_multiple_python_abis; then
return;
fi;
if [[ "$(type -t "distutils_src_test_pre_hook")" == "function" ]]; then
eval "python_execute_$1_pre_hook() {
distutils_src_test_pre_hook
}";
fi;
if [[ "$(type -t "distutils_src_test_post_hook")" == "function" ]]; then
eval "python_execute_$1_post_hook() {
distutils_src_test_post_hook
}";
fi
}
_gcc-install-dir ()
{
echo "$(LC_ALL=C $(tc-getCC) -print-search-dirs 2> /dev/null | awk '$1=="install:" {print $2}')"
}
_gcc-specs-directive_raw ()
{
local cc=$(tc-getCC);
local specfiles=$(LC_ALL=C ${cc} -v 2>&1 | awk '$1=="Reading" {print $NF}');
${cc} -dumpspecs 2> /dev/null | cat - ${specfiles} | awk -v directive=$1 'BEGIN { pspec=""; spec=""; outside=1 }
$1=="*"directive":" { pspec=spec; spec=""; outside=0; next }
outside || NF==0 || ( substr($1,1,1)=="*" && substr($1,length($1),1)==":" ) { outside=1; next }
spec=="" && substr($0,1,1)=="+" { spec=pspec " " substr($0,2); next }
{ spec=spec $0 }
END { print spec }';
return 0
}
_gcc-specs-exists ()
{
[[ -f $(_gcc-install-dir)/$1 ]]
}
_gcc_fullversion ()
{
local ver="$1";
shift;
set -- `$(tc-getCPP "$@") -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__"`;
eval echo "$ver"
}
_python_abi-specific_local_scope ()
{
[[ " ${FUNCNAME[@]:2} " =~ " "(_python_final_sanity_checks|python_execute_function|python_mod_optimize|python_mod_cleanup)" " ]]
}
_python_calculate_PYTHON_ABIS ()
{
if ! _python_package_supporting_installation_for_multiple_python_abis; then
die "${FUNCNAME}() cannot be used in ebuilds of packages not supporting installation for multiple Python ABIs";
fi;
_python_initial_sanity_checks;
if [[ "$(declare -p PYTHON_ABIS 2> /dev/null)" != "declare -x PYTHON_ABIS="* ]] && has "${EAPI:-0}" 0 1 2 3 4; then
local PYTHON_ABI;
if [[ "$(declare -p USE_PYTHON 2> /dev/null)" == "declare -x USE_PYTHON="* ]]; then
local cpython_enabled="0";
if [[ -z "${USE_PYTHON}" ]]; then
die "USE_PYTHON variable is empty";
fi;
for PYTHON_ABI in ${USE_PYTHON};
do
if ! has "${PYTHON_ABI}" "${_PYTHON_GLOBALLY_SUPPORTED_ABIS[@]}"; then
die "USE_PYTHON variable contains invalid value '${PYTHON_ABI}'";
fi;
if has "${PYTHON_ABI}" "${_CPYTHON2_GLOBALLY_SUPPORTED_ABIS[@]}" "${_CPYTHON3_GLOBALLY_SUPPORTED_ABIS[@]}"; then
cpython_enabled="1";
fi;
if ! _python_check_python_abi_matching --patterns-list "${PYTHON_ABI}" "${RESTRICT_PYTHON_ABIS}"; then
export PYTHON_ABIS+="${PYTHON_ABIS:+ }${PYTHON_ABI}";
fi;
done;
if [[ -z "${PYTHON_ABIS//[${IFS}]/}" ]]; then
die "USE_PYTHON variable does not enable any Python ABI supported by ${CATEGORY}/${PF}";
fi;
if [[ "${cpython_enabled}" == "0" ]]; then
die "USE_PYTHON variable does not enable any CPython ABI";
fi;
else
local python_version python2_version python3_version support_python_major_version;
if ! has_version "dev-lang/python"; then
die "${FUNCNAME}(): 'dev-lang/python' is not installed";
fi;
python_version="$("${EPREFIX}/usr/bin/python" -c 'from sys import version_info; print(".".join(str(x) for x in version_info[:2]))')";
if has_version "=dev-lang/python-2*"; then
if [[ "$(readlink "${EPREFIX}/usr/bin/python2")" != "python2."* ]]; then
die "'${EPREFIX}/usr/bin/python2' is not valid symlink";
fi;
python2_version="$("${EPREFIX}/usr/bin/python2" -c 'from sys import version_info; print(".".join(str(x) for x in version_info[:2]))')";
support_python_major_version="0";
for PYTHON_ABI in "${_CPYTHON2_GLOBALLY_SUPPORTED_ABIS[@]}";
do
if ! _python_check_python_abi_matching --patterns-list "${PYTHON_ABI}" "${RESTRICT_PYTHON_ABIS}"; then
support_python_major_version="1";
break;
fi;
done;
if [[ "${support_python_major_version}" == "1" ]]; then
if _python_check_python_abi_matching --patterns-list "${python2_version}" "${RESTRICT_PYTHON_ABIS}"; then
die "Active version of CPython 2 is not supported by ${CATEGORY}/${PF}";
fi;
else
python2_version="";
fi;
fi;
if has_version "=dev-lang/python-3*"; then
if [[ "$(readlink "${EPREFIX}/usr/bin/python3")" != "python3."* ]]; then
die "'${EPREFIX}/usr/bin/python3' is not valid symlink";
fi;
python3_version="$("${EPREFIX}/usr/bin/python3" -c 'from sys import version_info; print(".".join(str(x) for x in version_info[:2]))')";
support_python_major_version="0";
for PYTHON_ABI in "${_CPYTHON3_GLOBALLY_SUPPORTED_ABIS[@]}";
do
if ! _python_check_python_abi_matching --patterns-list "${PYTHON_ABI}" "${RESTRICT_PYTHON_ABIS}"; then
support_python_major_version="1";
break;
fi;
done;
if [[ "${support_python_major_version}" == "1" ]]; then
if _python_check_python_abi_matching --patterns-list "${python3_version}" "${RESTRICT_PYTHON_ABIS}"; then
die "Active version of CPython 3 is not supported by ${CATEGORY}/${PF}";
fi;
else
python3_version="";
fi;
fi;
if [[ -z "${python2_version}" && -z "${python3_version}" ]]; then
eerror "${CATEGORY}/${PF} requires at least one of the following packages:";
for PYTHON_ABI in "${_CPYTHON2_GLOBALLY_SUPPORTED_ABIS[@]}" "${_CPYTHON3_GLOBALLY_SUPPORTED_ABIS[@]}";
do
if ! _python_check_python_abi_matching --patterns-list "${PYTHON_ABI}" "${RESTRICT_PYTHON_ABIS}"; then
eerror " dev-lang/python:${PYTHON_ABI}";
fi;
done;
die "No supported version of CPython installed";
fi;
if [[ -n "${python2_version}" && "${python_version}" == "2."* && "${python_version}" != "${python2_version}" ]]; then
eerror "Python wrapper is configured incorrectly or '${EPREFIX}/usr/bin/python2' symlink";
eerror "is set incorrectly. Use \`eselect python\` to fix configuration.";
die "Incorrect configuration of Python";
fi;
if [[ -n "${python3_version}" && "${python_version}" == "3."* && "${python_version}" != "${python3_version}" ]]; then
eerror "Python wrapper is configured incorrectly or '${EPREFIX}/usr/bin/python3' symlink";
eerror "is set incorrectly. Use \`eselect python\` to fix configuration.";
die "Incorrect configuration of Python";
fi;
PYTHON_ABIS="${python2_version} ${python3_version}";
PYTHON_ABIS="${PYTHON_ABIS# }";
export PYTHON_ABIS="${PYTHON_ABIS% }";
fi;
fi;
_python_final_sanity_checks
}
_python_check_python_abi_matching ()
{
local pattern patterns patterns_list="0" PYTHON_ABI;
while (($#)); do
case "$1" in
--patterns-list)
patterns_list="1"
;;
--)
shift;
break
;;
-*)
die "${FUNCNAME}(): Unrecognized option '$1'"
;;
*)
break
;;
esac;
shift;
done;
if [[ "$#" -ne 2 ]]; then
die "${FUNCNAME}() requires 2 arguments";
fi;
PYTHON_ABI="$1";
if [[ "${patterns_list}" == "0" ]]; then
pattern="$2";
if [[ "${pattern}" == *"-cpython" ]]; then
[[ "${PYTHON_ABI}" =~ ^[[:digit:]]+\.[[:digit:]]+$ && "${PYTHON_ABI}" == ${pattern%-cpython} ]];
else
if [[ "${pattern}" == *"-jython" ]]; then
[[ "${PYTHON_ABI}" == ${pattern} ]];
else
if [[ "${pattern}" == *"-pypy-"* ]]; then
[[ "${PYTHON_ABI}" == ${pattern} ]];
else
if [[ "${PYTHON_ABI}" =~ ^[[:digit:]]+\.[[:digit:]]+$ ]]; then
[[ "${PYTHON_ABI}" == ${pattern} ]];
else
if [[ "${PYTHON_ABI}" =~ ^[[:digit:]]+\.[[:digit:]]+-jython$ ]]; then
[[ "${PYTHON_ABI%-jython}" == ${pattern} ]];
else
if [[ "${PYTHON_ABI}" =~ ^[[:digit:]]+\.[[:digit:]]+-pypy-[[:digit:]]+\.[[:digit:]]+$ ]]; then
[[ "${PYTHON_ABI%-pypy-*}" == ${pattern} ]];
else
die "${FUNCNAME}(): Unrecognized Python ABI '${PYTHON_ABI}'";
fi;
fi;
fi;
fi;
fi;
fi;
else
patterns="${2// /
}";
while read pattern; do
if _python_check_python_abi_matching "${PYTHON_ABI}" "${pattern}"; then
return 0;
fi;
done <<< "${patterns}";
return 1;
fi
}
_python_check_python_pkg_setup_execution ()
{
[[ " ${FUNCNAME[@]:1} " =~ " "(python_set_active_version|python_pkg_setup)" " ]] && return;
if ! has "${EAPI:-0}" 0 1 2 3 && [[ -z "${PYTHON_PKG_SETUP_EXECUTED}" ]]; then
die "python_pkg_setup() not called";
fi
}
_python_clean_compiled_modules ()
{
_python_initialize_prefix_variables;
_python_set_color_variables;
[[ "${FUNCNAME[1]}" =~ ^(python_mod_optimize|python_mod_cleanup)$ ]] || die "${FUNCNAME}(): Invalid usage";
local base_module_name compiled_file compiled_files=() dir path py_file root;
root="${EROOT%/}";
for path in "$@";
do
compiled_files=();
if [[ -d "${path}" ]]; then
while read -d '' -r compiled_file; do
compiled_files+=("${compiled_file}");
done < <(find "${path}" "(" -name "*.py[co]" -o -name "*\$py.class" ")" -print0);
if [[ "${EBUILD_PHASE}" == "postrm" ]]; then
find "${path}" -type d | sort -r | while read -r dir; do
if rmdir "${dir}" 2> /dev/null; then
echo "${_CYAN}<<< ${dir}${_NORMAL}";
fi;
done;
fi;
else
if [[ "${path}" == *.py ]]; then
base_module_name="${path##*/}";
base_module_name="${base_module_name%.py}";
if [[ -d "${path%/*}/__pycache__" ]]; then
while read -d '' -r compiled_file; do
compiled_files+=("${compiled_file}");
done < <(find "${path%/*}/__pycache__" "(" -name "${base_module_name}.*.py[co]" -o -name "${base_module_name}\$py.class" ")" -print0);
fi;
compiled_files+=("${path}c" "${path}o" "${path%.py}\$py.class");
fi;
fi;
for compiled_file in "${compiled_files[@]}";
do
[[ ! -f "${compiled_file}" ]] && continue;
dir="${compiled_file%/*}";
dir="${dir##*/}";
if [[ "${compiled_file}" == *.py[co] ]]; then
if [[ "${dir}" == "__pycache__" ]]; then
base_module_name="${compiled_file##*/}";
base_module_name="${base_module_name%.*py[co]}";
base_module_name="${base_module_name%.*}";
py_file="${compiled_file%__pycache__/*}${base_module_name}.py";
else
py_file="${compiled_file%[co]}";
fi;
if [[ "${EBUILD_PHASE}" == "postinst" ]]; then
[[ -f "${py_file}" && "${compiled_file}" -nt "${py_file}" ]] && continue;
else
[[ -f "${py_file}" ]] && continue;
fi;
echo "${_BLUE}<<< ${compiled_file%[co]}[co]${_NORMAL}";
rm -f "${compiled_file%[co]}"[co];
else
if [[ "${compiled_file}" == *\$py.class ]]; then
if [[ "${dir}" == "__pycache__" ]]; then
base_module_name="${compiled_file##*/}";
base_module_name="${base_module_name%\$py.class}";
py_file="${compiled_file%__pycache__/*}${base_module_name}.py";
else
py_file="${compiled_file%\$py.class}.py";
fi;
if [[ "${EBUILD_PHASE}" == "postinst" ]]; then
[[ -f "${py_file}" && "${compiled_file}" -nt "${py_file}" ]] && continue;
else
[[ -f "${py_file}" ]] && continue;
fi;
echo "${_BLUE}<<< ${compiled_file}${_NORMAL}";
rm -f "${compiled_file}";
else
die "${FUNCNAME}(): Unrecognized file type: '${compiled_file}'";
fi;
fi;
dir="${compiled_file%/*}";
while [[ "${dir}" != "${root}" ]]; do
if rmdir "${dir}" 2> /dev/null; then
echo "${_CYAN}<<< ${dir}${_NORMAL}";
else
break;
fi;
dir="${dir%/*}";
done;
done;
done
}
_python_final_sanity_checks ()
{
if ! _python_implementation && [[ "$(declare -p PYTHON_SANITY_CHECKS_EXECUTED 2> /dev/null)" != "declare -- PYTHON_SANITY_CHECKS_EXECUTED="* || " ${FUNCNAME[@]:1} " =~ " "(python_set_active_version|python_pkg_setup)" " && -z "${PYTHON_SKIP_SANITY_CHECKS}" ]]; then
local PYTHON_ABI="${PYTHON_ABI}";
for PYTHON_ABI in ${PYTHON_ABIS-${PYTHON_ABI}};
do
if ! has_version "$(python_get_implementational_package)"; then
die "$(python_get_implementational_package) is not installed";
fi;
if [[ "$(EPYTHON="$(PYTHON)" python -c "${_PYTHON_ABI_EXTRACTION_COMMAND}")" != "${PYTHON_ABI}" ]]; then
eerror "Path to 'python': '$(type -p python)'";
eerror "ABI: '${ABI}'";
eerror "DEFAULT_ABI: '${DEFAULT_ABI}'";
eerror "EPYTHON: '$(PYTHON)'";
eerror "PYTHON_ABI: '${PYTHON_ABI}'";
eerror "Locally active version of Python: '$(EPYTHON="$(PYTHON)" python -c "${_PYTHON_ABI_EXTRACTION_COMMAND}")'";
die "'python' does not respect EPYTHON variable";
fi;
done;
fi;
PYTHON_SANITY_CHECKS_EXECUTED="1"
}
_python_get_implementation ()
{
local ignore_invalid="0";
while (($#)); do
case "$1" in
--ignore-invalid)
ignore_invalid="1"
;;
--)
shift;
break
;;
-*)
die "${FUNCNAME}(): Unrecognized option '$1'"
;;
*)
break
;;
esac;
shift;
done;
if [[ "$#" -ne 1 ]]; then
die "${FUNCNAME}() requires 1 argument";
fi;
if [[ "$1" =~ ^[[:digit:]]+\.[[:digit:]]+$ ]]; then
echo "CPython";
else
if [[ "$1" =~ ^[[:digit:]]+\.[[:digit:]]+-jython$ ]]; then
echo "Jython";
else
if [[ "$1" =~ ^[[:digit:]]+\.[[:digit:]]+-pypy-[[:digit:]]+\.[[:digit:]]+$ ]]; then
echo "PyPy";
else
if [[ "${ignore_invalid}" == "0" ]]; then
die "${FUNCNAME}(): Unrecognized Python ABI '$1'";
fi;
fi;
fi;
fi
}
_python_implementation ()
{
if [[ "${CATEGORY}/${PN}" == "dev-lang/python" ]]; then
return 0;
else
if [[ "${CATEGORY}/${PN}" == "dev-java/jython" ]]; then
return 0;
else
if [[ "${CATEGORY}/${PN}" == "dev-python/pypy" ]]; then
return 0;
else
return 1;
fi;
fi;
fi
}
_python_initial_sanity_checks ()
{
if [[ "$(declare -p PYTHON_SANITY_CHECKS_EXECUTED 2> /dev/null)" != "declare -- PYTHON_SANITY_CHECKS_EXECUTED="* || " ${FUNCNAME[@]:1} " =~ " "(python_set_active_version|python_pkg_setup)" " && -z "${PYTHON_SKIP_SANITY_CHECKS}" ]]; then
if [[ "$(readlink "${EPREFIX}/usr/bin/python")" != "python-wrapper" ]]; then
eerror "'${EPREFIX}/usr/bin/python' is not valid symlink.";
eerror "Use \`eselect python set \${python_interpreter}\` to fix this problem.";
die "'${EPREFIX}/usr/bin/python' is not valid symlink";
fi;
if [[ "$(<"${EPREFIX}/usr/bin/python-config")" != *"Gentoo python-config wrapper script"* ]]; then
eerror "'${EPREFIX}/usr/bin/python-config' is not valid script";
eerror "Use \`eselect python set \${python_interpreter}\` to fix this problem.";
die "'${EPREFIX}/usr/bin/python-config' is not valid script";
fi;
fi
}
_python_initialize_prefix_variables ()
{
if has "${EAPI:-0}" 0 1 2; then
if [[ -n "${ROOT}" && -z "${EROOT}" ]]; then
EROOT="${ROOT%/}${EPREFIX}/";
fi;
if [[ -n "${D}" && -z "${ED}" ]]; then
ED="${D%/}${EPREFIX}/";
fi;
fi
}
_python_package_supporting_installation_for_multiple_python_abis ()
{
if has "${EAPI:-0}" 0 1 2 3 4; then
if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
return 0;
else
return 1;
fi;
else
die "${FUNCNAME}(): Support for EAPI=\"${EAPI}\" not implemented";
fi
}
_python_prepare_flags ()
{
local array=() deleted_flag element flags new_value old_flag old_value operator pattern prefix variable;
for variable in CPPFLAGS CFLAGS CXXFLAGS LDFLAGS;
do
eval "_PYTHON_SAVED_${variable}=\"\${!variable}\"";
for prefix in PYTHON_USER_ PYTHON_;
do
if [[ "$(declare -p ${prefix}${variable} 2> /dev/null)" == "declare -a ${prefix}${variable}="* ]]; then
eval "array=(\"\${${prefix}${variable}[@]}\")";
for element in "${array[@]}";
do
if [[ "${element}" =~ ^${_PYTHON_ABI_PATTERN_REGEX}\ (\+|-)\ .+ ]]; then
pattern="${element%% *}";
element="${element#* }";
operator="${element%% *}";
flags="${element#* }";
if _python_check_python_abi_matching "${PYTHON_ABI}" "${pattern}"; then
if [[ "${operator}" == "+" ]]; then
eval "export ${variable}+=\"\${variable:+ }${flags}\"";
else
if [[ "${operator}" == "-" ]]; then
flags="${flags// /
}";
old_value="${!variable// /
}";
new_value="";
while read old_flag; do
while read deleted_flag; do
if [[ "${old_flag}" == ${deleted_flag} ]]; then
continue 2;
fi;
done <<< "${flags}";
new_value+="${new_value:+ }${old_flag}";
done <<< "${old_value}";
eval "export ${variable}=\"\${new_value}\"";
fi;
fi;
fi;
else
die "Element '${element}' of ${prefix}${variable} array has invalid syntax";
fi;
done;
else
if [[ -n "$(declare -p ${prefix}${variable} 2> /dev/null)" ]]; then
die "${prefix}${variable} should be indexed array";
fi;
fi;
done;
done
}
_python_restore_flags ()
{
local variable;
for variable in CPPFLAGS CFLAGS CXXFLAGS LDFLAGS;
do
eval "${variable}=\"\${_PYTHON_SAVED_${variable}}\"";
unset _PYTHON_SAVED_${variable};
done
}
_python_set_color_variables ()
{
if [[ "${PYTHON_COLORS}" != "0" && "${NOCOLOR:-false}" =~ ^(false|no)$ ]]; then
_BOLD='';
_RED='';
_GREEN='';
_BLUE='';
_CYAN='';
_NORMAL='';
else
_BOLD=;
_RED=;
_GREEN=;
_BLUE=;
_CYAN=;
_NORMAL=;
fi
}
_python_test_hook ()
{
if [[ "$#" -ne 1 ]]; then
die "${FUNCNAME}() requires 1 argument";
fi;
if _python_package_supporting_installation_for_multiple_python_abis && [[ "$(type -t "${_PYTHON_TEST_FUNCTION}_$1_hook")" == "function" ]]; then
"${_PYTHON_TEST_FUNCTION}_$1_hook";
fi
}
_tc-getPROG ()
{
local tuple=$1;
local v var vars=$2;
local prog=$3;
var=${vars%% *};
for v in ${vars};
do
if [[ -n ${!v} ]]; then
export ${var}="${!v}";
echo "${!v}";
return 0;
fi;
done;
local search=;
[[ -n $4 ]] && search=$(type -p "$4-${prog}");
[[ -z ${search} && -n ${!tuple} ]] && search=$(type -p "${!tuple}-${prog}");
[[ -n ${search} ]] && prog=${search##*/};
export ${var}=${prog};
echo "${!var}"
}
distutils_get_intermediate_installation_image ()
{
if [[ "${EBUILD_PHASE}" != "install" ]]; then
die "${FUNCNAME}() can be used only in src_install() phase";
fi;
if ! _python_package_supporting_installation_for_multiple_python_abis; then
die "${FUNCNAME}() cannot be used in ebuilds of packages not supporting installation for multiple Python ABIs";
fi;
_python_check_python_pkg_setup_execution;
if [[ ! "${FUNCNAME[1]}&quo
Back to top
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 7913

PostPosted: Tue Mar 13, 2012 6:10 am    Post subject: Reply with quote

Moved from Portage & Programming to Duplicate Threads, given that it was duplicated, replied to and resolved.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum