summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-04-12 09:35:24 +0000
committerMike Frysinger <vapier@gentoo.org>2009-04-12 09:35:24 +0000
commit6da2114df81fb7d3a2b656a84a100bc4eb6dc779 (patch)
tree4043cf509d69ad4c5c2ab12350183cf6ed663310 /dev-lang/python
parentfixed has_version to the right category (diff)
downloadgentoo-2-6da2114df81fb7d3a2b656a84a100bc4eb6dc779.tar.gz
gentoo-2-6da2114df81fb7d3a2b656a84a100bc4eb6dc779.tar.bz2
gentoo-2-6da2114df81fb7d3a2b656a84a100bc4eb6dc779.zip
Fix up cross-compiling with python-2.6.
(Portage version: 2.2_rc28/cvs/Linux x86_64)
Diffstat (limited to 'dev-lang/python')
-rw-r--r--dev-lang/python/ChangeLog7
-rw-r--r--dev-lang/python/files/python-2.6-chflags-cross.patch59
-rw-r--r--dev-lang/python/files/python-2.6-cross-patch-tweak.patch15
-rw-r--r--dev-lang/python/python-2.6.1-r1.ebuild9
4 files changed, 85 insertions, 5 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog
index 0dfad379cb3a..cf7d0abcccc0 100644
--- a/dev-lang/python/ChangeLog
+++ b/dev-lang/python/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-lang/python
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.369 2009/03/26 05:10:31 zmedico Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.370 2009/04/12 09:35:24 vapier Exp $
+
+ 12 Apr 2009; Mike Frysinger <vapier@gentoo.org>
+ +files/python-2.6-chflags-cross.patch,
+ +files/python-2.6-cross-patch-tweak.patch, python-2.6.1-r1.ebuild:
+ Fix up cross-compiling with python-2.6.
26 Mar 2009; Zac Medico <zmedico@gentoo.org> python-2.5.2-r7.ebuild,
python-2.5.2-r8.ebuild, python-2.5.4-r2.ebuild, python-2.6-r5.ebuild,
diff --git a/dev-lang/python/files/python-2.6-chflags-cross.patch b/dev-lang/python/files/python-2.6-chflags-cross.patch
new file mode 100644
index 000000000000..9c4b6d2acc83
--- /dev/null
+++ b/dev-lang/python/files/python-2.6-chflags-cross.patch
@@ -0,0 +1,59 @@
+if we're cross-compiling, fall back to a link-only test rather than trying
+to run a program for the chflags functions
+
+--- python-2.6/configure.in
++++ python-2.6/configure.in
+@@ -2565,7 +2565,7 @@
+
+ # On Tru64, chflags seems to be present, but calling it will
+ # exit Python
+-AC_MSG_CHECKING(for chflags)
++AC_CACHE_CHECK([for chflags], [py_cv_has_chflags], [dnl
+ AC_TRY_RUN([
+ #include <sys/stat.h>
+ #include <unistd.h>
+@@ -2575,12 +2575,18 @@
+ return 1;
+ return 0;
+ }
+-],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
+- AC_MSG_RESULT(yes),
+- AC_MSG_RESULT(no)
+-)
++], [py_cv_has_chflags="yes"],
++ [py_cv_has_chflags="no"],
++ [py_cv_has_chflags="cross"])
++])
++if test "$py_cv_has_chflags" = "cross" ; then
++ AC_CHECK_FUNC([chflags], [py_cv_has_chflags="yes"], [py_cv_has_chflags="no"])
++fi
++if test "$py_cv_has_chflags" = "yes" ; then
++ AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
++fi
+
+-AC_MSG_CHECKING(for lchflags)
++AC_CACHE_CHECK([for lchflags], [py_cv_has_lchflags], [dnl
+ AC_TRY_RUN([
+ #include <sys/stat.h>
+ #include <unistd.h>
+@@ -2590,10 +2596,16 @@
+ return 1;
+ return 0;
+ }
+-],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
+- AC_MSG_RESULT(yes),
+- AC_MSG_RESULT(no)
+-)
++], [py_cv_has_lchflags="yes"],
++ [py_cv_has_lchflags="no"],
++ [py_cv_has_lchflags="cross"])
++])
++if test "$py_cv_has_lchflags" = "cross" ; then
++ AC_CHECK_FUNC([lchflags], [py_cv_has_lchflags="yes"], [py_cv_has_lchflags="no"])
++fi
++if test "$py_cv_has_lchflags" = "yes" ; then
++ AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
++fi
+
+ dnl Check if system zlib has *Copy() functions
+ dnl
diff --git a/dev-lang/python/files/python-2.6-cross-patch-tweak.patch b/dev-lang/python/files/python-2.6-cross-patch-tweak.patch
new file mode 100644
index 000000000000..4aa5cf49a115
--- /dev/null
+++ b/dev-lang/python/files/python-2.6-cross-patch-tweak.patch
@@ -0,0 +1,15 @@
+our patchset is out dated ... this really should get merged ...
+
+--- ../2.6/08_all_crosscompile.patch
++++ ../2.6/08_all_crosscompile.patch
+@@ -60,8 +60,8 @@
+ -d $(LIBDEST)/site-packages -f \
+ -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram"
+-+ ./$(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram"
++- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
+++ ./$(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
+
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
diff --git a/dev-lang/python/python-2.6.1-r1.ebuild b/dev-lang/python/python-2.6.1-r1.ebuild
index 13f72c0b7123..6db9fb9a9009 100644
--- a/dev-lang/python/python-2.6.1-r1.ebuild
+++ b/dev-lang/python/python-2.6.1-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.1-r1.ebuild,v 1.2 2009/03/26 05:10:31 zmedico Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.1-r1.ebuild,v 1.3 2009/04/12 09:35:24 vapier Exp $
# NOTE about python-portage interactions :
# - Do not add a pkg_setup() check for a certain version of portage
@@ -56,9 +56,10 @@ src_prepare() {
default
if tc-is-cross-compiler ; then
- [[ $(python -V 2>&1) != "Python ${PV}" ]] && \
- die "Crosscompiling requires the same host and build versions."
+ epatch "${FILESDIR}"/python-2.5-cross-printf.patch
+ epatch "${FILESDIR}"/python-2.6-chflags-cross.patch
epatch "${FILESDIR}"/python-2.6-test-cross.patch
+ epatch "${FILESDIR}"/python-2.6-cross-patch-tweak.patch
else
rm "${WORKDIR}/${PYVER}"/*_all_crosscompile.patch
fi
@@ -142,7 +143,7 @@ src_configure() {
if tc-is-cross-compiler ; then
OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \
- ./configure || die "cross-configure failed"
+ ./configure --{build,host}=${CBUILD} || die "cross-configure failed"
emake python Parser/pgen || die "cross-make failed"
mv python hostpython
mv Parser/pgen Parser/hostpgen