summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2013-09-26 19:17:17 +0000
committerMike Gilbert <floppym@gentoo.org>2013-09-26 19:17:17 +0000
commitc2164d4e5240a73a3fa856ce1b27507d9e290c92 (patch)
tree0ec8bfbe85264b5c90e6d725099c7b16bfcb53a0 /dev-lang
parentfix underlinking wrt #485896 (diff)
downloadgentoo-2-c2164d4e5240a73a3fa856ce1b27507d9e290c92.tar.gz
gentoo-2-c2164d4e5240a73a3fa856ce1b27507d9e290c92.tar.bz2
gentoo-2-c2164d4e5240a73a3fa856ce1b27507d9e290c92.zip
Apply cross-compile fixes to python-2.7.5.
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/python/ChangeLog6
-rw-r--r--dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch18
-rw-r--r--dev-lang/python/python-2.7.5-r2.ebuild84
3 files changed, 42 insertions, 66 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog
index 1ffbf8148db2..9d165e1ae7ff 100644
--- a/dev-lang/python/ChangeLog
+++ b/dev-lang/python/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-lang/python
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.707 2013/09/26 04:20:27 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.708 2013/09/26 19:17:17 floppym Exp $
+
+ 26 Sep 2013; Mike Gilbert <floppym@gentoo.org>
+ +files/python-2.7.5-nonfatal-compileall.patch, python-2.7.5-r2.ebuild:
+ Apply cross-compile fixes to python-2.7.5.
26 Sep 2013; Mike Gilbert <floppym@gentoo.org> python-3.3.2-r2.ebuild:
Fix/simplify cross-compiles.
diff --git a/dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch b/dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch
new file mode 100644
index 000000000000..a762dfb10882
--- /dev/null
+++ b/dev-lang/python/files/python-2.7.5-nonfatal-compileall.patch
@@ -0,0 +1,18 @@
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1000,12 +1000,12 @@
+ $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ $(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ fi
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ $(DESTDIR)$(LIBDEST)
+- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -d $(LIBDEST) -f \
+ -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
diff --git a/dev-lang/python/python-2.7.5-r2.ebuild b/dev-lang/python/python-2.7.5-r2.ebuild
index 5e3189fdeb6e..ee85ac8b0bc6 100644
--- a/dev-lang/python/python-2.7.5-r2.ebuild
+++ b/dev-lang/python/python-2.7.5-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.5-r2.ebuild,v 1.13 2013/08/28 15:59:25 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.5-r2.ebuild,v 1.14 2013/09/26 19:17:17 floppym Exp $
EAPI="4"
WANT_AUTOMAKE="none"
@@ -90,18 +90,19 @@ src_prepare() {
rm -r Modules/_ctypes/libffi* || die
rm -r Modules/zlib || die
- local excluded_patches
- if ! tc-is-cross-compiler; then
- excluded_patches="*_all_crosscompile.patch"
+ if tc-is-cross-compiler; then
+ local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
fi
- EPATCH_EXCLUDE="${excluded_patches}" EPATCH_SUFFIX="patch" \
- epatch "${WORKDIR}/${PV}-${PATCHSET_REVISION}"
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}-${PATCHSET_REVISION}"
epatch "${FILESDIR}/${P}-library-path.patch" #474882
epatch "${FILESDIR}/${P}-re_unsigned_ptrdiff.patch" #476426
epatch "${FILESDIR}/CVE-2013-4238_py27.patch"
+ # Fix for cross-compiling.
+ epatch "${FILESDIR}/python-2.7.5-nonfatal-compileall.patch"
+
sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
Lib/distutils/command/install.py \
Lib/distutils/sysconfig.py \
@@ -164,27 +165,6 @@ src_configure() {
use hardened && replace-flags -O3 -O2
fi
- # Run the configure scripts in parallel.
- multijob_init
-
- mkdir -p "${WORKDIR}"/{${CBUILD},${CHOST}}
-
- if tc-is-cross-compiler; then
- (
- multijob_child_init
- cd "${WORKDIR}"/${CBUILD} >/dev/null
- OPT="-O1" CFLAGS="" CPPFLAGS="" LDFLAGS="" CC="" \
- "${S}"/configure \
- --{build,host}=${CBUILD} \
- || die "cross-configure failed"
- ) &
- multijob_post_fork
-
- # The configure script assumes it's buggy when cross-compiling.
- export ac_cv_buggy_getaddrinfo=no
- export ac_cv_have_long_long_format=yes
- fi
-
# Export CXX so it ends up in /usr/lib/python2.X/config/Makefile.
tc-export CXX
# The configure script fails to use pkg-config correctly.
@@ -204,7 +184,10 @@ src_configure() {
dbmliborder+="${dbmliborder:+:}bdb"
fi
- cd "${WORKDIR}"/${CHOST}
+ BUILD_DIR="${WORKDIR}/${CHOST}"
+ mkdir -p "${BUILD_DIR}" || die
+ cd "${BUILD_DIR}" || die
+
ECONF_SOURCE="${S}" OPT="" \
econf \
--with-fpectl \
@@ -219,42 +202,14 @@ src_configure() {
--enable-loadable-sqlite-extensions \
--with-system-expat \
--with-system-ffi
-
- if tc-is-cross-compiler; then
- # Modify the Makefile.pre so we don't regen for the host/ one.
- # We need to link the host python programs into $PWD and run
- # them from here because the distutils sysconfig module will
- # parse Makefile/etc... from argv[0], and we need it to pick
- # up the target settings, not the host ones.
- sed -i \
- -e '1iHOSTPYTHONPATH = ./hostpythonpath:' \
- -e '/^HOSTPYTHON/s:=.*:= ./hostpython:' \
- -e '/^HOSTPGEN/s:=.*:= ./Parser/hostpgen:' \
- Makefile{.pre,} || die "sed failed"
- fi
-
- multijob_finish
}
src_compile() {
- if tc-is-cross-compiler; then
- cd "${WORKDIR}"/${CBUILD}
- # Disable as many modules as possible -- but we need a few to install.
- PYTHON_DISABLE_MODULES=$(
- sed -n "/Extension('/{s:^.*Extension('::;s:'.*::;p}" "${S}"/setup.py | \
- egrep -v '(unicodedata|time|cStringIO|_struct|binascii)'
- ) \
- PTHON_DISABLE_SSL="1" \
- SYSROOT= \
- emake
- # See comment in src_configure about these.
- ln python ../${CHOST}/hostpython || die
- ln Parser/pgen ../${CHOST}/Parser/hostpgen || die
- ln -s ../${CBUILD}/build/lib.*/ ../${CHOST}/hostpythonpath || die
- fi
+ # Avoid invoking pgen for cross-compiles.
+ touch Include/graminit.h Python/graminit.c
- cd "${WORKDIR}"/${CHOST}
- default
+ cd "${BUILD_DIR}" || die
+ emake
# Work around bug 329499. See also bug 413751 and 457194.
if has_version dev-libs/libffi[pax_kernel]; then
@@ -271,7 +226,7 @@ src_test() {
return
fi
- cd "${WORKDIR}"/${CHOST}
+ cd "${BUILD_DIR}" || die
# Skip failing tests.
local skipped_tests="distutils gdb"
@@ -305,7 +260,7 @@ src_test() {
src_install() {
local libdir=${ED}/usr/$(get_libdir)/python${SLOT}
- cd "${WORKDIR}"/${CHOST}
+ cd "${BUILD_DIR}" || die
emake DESTDIR="${D}" altinstall
sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die "sed failed"
@@ -354,9 +309,8 @@ src_install() {
# if not using a cross-compiler, use the fresh binary
if ! tc-is-cross-compiler; then
- local PYTHON=./python \
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
- export LD_LIBRARY_PATH
+ local PYTHON=./python
+ local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
fi
echo "EPYTHON='${EPYTHON}'" > epython.py