From 5a60210f53b9847015395e39ffb1ab77100d2e37 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Mon, 27 May 2013 22:26:55 +0200 Subject: dev-lang/python: add outdated patch to be able to cross compile python 2.7 and 3.1 --- dev-lang/python/Manifest | 17 + dev-lang/python/files/linux2.patch | 24 ++ dev-lang/python/files/pydoc.conf | 8 + dev-lang/python/files/pydoc.init | 27 ++ .../python/files/python-2.4.4-test-cross.patch | 19 ++ .../python/files/python-2.5-cross-printf.patch | 34 ++ .../python/files/python-2.6-chflags-cross.patch | 59 ++++ dev-lang/python/files/python-2.6-test-cross.patch | 19 ++ dev-lang/python/files/python-2.7.1-BJA-cross.diff | 29 ++ dev-lang/python/files/python-3.1.3-BJA-cross.diff | 30 ++ dev-lang/python/files/python-3.2-soname_typo.patch | 51 +++ dev-lang/python/files/python-config-2.4-r1 | 58 ++++ dev-lang/python/python-2.7.1-r1.ebuild | 365 +++++++++++++++++++++ dev-lang/python/python-3.1.3-r1.ebuild | 336 +++++++++++++++++++ 14 files changed, 1076 insertions(+) create mode 100644 dev-lang/python/Manifest create mode 100644 dev-lang/python/files/linux2.patch create mode 100644 dev-lang/python/files/pydoc.conf create mode 100755 dev-lang/python/files/pydoc.init create mode 100644 dev-lang/python/files/python-2.4.4-test-cross.patch create mode 100644 dev-lang/python/files/python-2.5-cross-printf.patch create mode 100644 dev-lang/python/files/python-2.6-chflags-cross.patch create mode 100644 dev-lang/python/files/python-2.6-test-cross.patch create mode 100644 dev-lang/python/files/python-2.7.1-BJA-cross.diff create mode 100644 dev-lang/python/files/python-3.1.3-BJA-cross.diff create mode 100644 dev-lang/python/files/python-3.2-soname_typo.patch create mode 100644 dev-lang/python/files/python-config-2.4-r1 create mode 100644 dev-lang/python/python-2.7.1-r1.ebuild create mode 100644 dev-lang/python/python-3.1.3-r1.ebuild (limited to 'dev-lang') diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest new file mode 100644 index 00000000..ae2fe8d2 --- /dev/null +++ b/dev-lang/python/Manifest @@ -0,0 +1,17 @@ +AUX linux2.patch 606 RMD160 0cca6f619a98e6090d01f4a80c2178c323416a47 SHA1 8fc817c8da2f74d3ccc93d84a1bc713ed26c00e2 SHA256 a178120a3022ecb14044c82eff7e828f6d060b6885acacd4a4d8569fde372fd7 +AUX pydoc.conf 330 RMD160 0cd619ec251597e0fcadc05bfd249915e73baa17 SHA1 a56100d45378c554b9822f6ed512a6cb7841ef50 SHA256 a45ebba2de5f2b0e963db4101507203d095c5ff667ae5002c4897a9c87786fa1 +AUX pydoc.init 679 RMD160 79ccfb6179974f4a4f35238c122b9640753e7e43 SHA1 e7bb706ae4ef94d28874677c4f92b82d08d7999a SHA256 8f6c1753a28462fa61d22a927debed7ec3994b3617d728932357e739ede6516f +AUX python-2.4.4-test-cross.patch 977 RMD160 8fdcd45dc202993988f7a1c2b3d918068883b99e SHA1 96f25777150ba05765282a43f08da6b6fab3cb73 SHA256 ff2a131776d560d188ec5069e17fea3eb09c26fdd02124ae5ff34d791c9fd9f6 +AUX python-2.5-cross-printf.patch 903 RMD160 8dc0ee148120aaf7667624bdb5574bb6af5d2a00 SHA1 596e05be8cde43e4cdd87c8ed06ebb40828f7cea SHA256 1e91e5123d74d89aa8fc9dc60d98516b785f851e43da9b634ae535130e24e780 +AUX python-2.6-chflags-cross.patch 1716 RMD160 b0ec772a41a24d51f4c7430b19bcc6251cd6be87 SHA1 4745cd53cef503c41c50573ad97f40eb89fd4bcd SHA256 7c36689db47720052069725036983c2fb6959f425e3777aae55976b2788d463f +AUX python-2.6-test-cross.patch 914 RMD160 1f421b5565d39a24b887e85cbecaf3857741f756 SHA1 9c05fbe28aac6373f24317db5c277bc4549dde0c SHA256 8264f6ffe5aedcce67bea00b0346e5416a5486da2229bf82fe748d87ec65c4de +AUX python-2.7.1-BJA-cross.diff 1355 RMD160 90c8e6d8433052e893c2f5cb5e3dea3b3bf5f5d5 SHA1 3cd7d1351c9b4439745038b97b04cd6cee310f79 SHA256 69bd7fb750ca6b4b7b9f24795ef7572507d91e859eab66163ef8cc1a523aa1c1 +AUX python-3.1.3-BJA-cross.diff 931 RMD160 050586946dbbfc8357e0270055677d3c425c22f9 SHA1 93659614d7505ba40a01c9f41b03fd429c7b498c SHA256 a55958807d2d226921e299bba899cc566186e66cf2d1d6a64bdf701c0898ece7 +AUX python-3.2-soname_typo.patch 1724 RMD160 1b112382152731768b655279145c7caa31d1094f SHA1 808fdab3b1d1664fc20c67dce008e7ea48134a4e SHA256 776366c3cc67c7d66883846acee8cc1b795c25f6e35e927793be8c54162491e2 +AUX python-config-2.4-r1 1624 RMD160 e4e6893c9e8414289c0c70c0f4be58835911e376 SHA1 addf9a6eb81e636364264a6abb3d96f01ea0cf90 SHA256 923a9e896f99cca5aa4ccbb02f981c6e26a2b1aa42326de2359d3c884bde2a9f +DIST Python-2.7.1.tar.bz2 11722546 RMD160 3ce59305f6cd3fb320a53771d0ea01ec0687005f SHA1 fbe1894322ff91b80726e269c97454f4129fc2a3 SHA256 80e387bcf57eae8ce26726753584fd63e060ec11682d1145af921e85fd612292 +DIST Python-3.1.3.tar.bz2 9875464 RMD160 730f3b8eb1a41f1b7c469fc81be734bb802cb9f9 SHA1 aeadf1eb7f450aab77a8972c042bc5f49bcf2288 SHA256 77f6f41a51be4ca85d83670405c8281dd1237bb00d8be8a7560cb3ccdf5558cb +DIST python-gentoo-patches-2.7.1-r1.tar.bz2 13384 RMD160 d79de2520244a8b9c5de61c9bc591a4e538a7736 SHA1 72a0b75ab891ee20041a65dc2642ee6cf40642be SHA256 cc9b4239a3276c6fd447e3bb3ab8a2f94fbc49e08bb5b20ba5f05b4becda2bf8 +DIST python-gentoo-patches-3.1.3-r1.tar.bz2 13730 RMD160 73f922d850e464e589c7a3cfb8f755d36167d156 SHA1 9228b63c980b80dd7e8dd9e0276c29af18692e33 SHA256 f23056436b298ed0ff9823b52902aaaa63eae0c4585a4a19e47571685127631e +EBUILD python-2.7.1-r1.ebuild 11161 RMD160 95a90a182be0ae83ec5508a38732faefd6cbf9cb SHA1 dc5bd6196095d4c0335d6c16ef7999ef85d6dbb6 SHA256 59458c10f433c602e36ec6b2e913c891c7ebd643a1dd996fda202920db1f6fcd +EBUILD python-3.1.3-r1.ebuild 9838 RMD160 bf62cbba7a999e356c2642f1032687dcc396267e SHA1 a76b0f6e9b81c548c880f7f45fe96e7abdeea22d SHA256 508cb80e100775885f9caff5770eee8e448b18e0487c8c1aa5d2c473aae4921f diff --git a/dev-lang/python/files/linux2.patch b/dev-lang/python/files/linux2.patch new file mode 100644 index 00000000..c3414238 --- /dev/null +++ b/dev-lang/python/files/linux2.patch @@ -0,0 +1,24 @@ +http://hg.python.org/cpython/rev/c816479f6aaf/ +diff --git a/configure b/configure +--- a/configure ++++ b/configure +@@ -2995,6 +2995,7 @@ then + MACHDEP="$ac_md_system$ac_md_release" + + case $MACHDEP in ++ linux*) MACHDEP="linux2";; + cygwin*) MACHDEP="cygwin";; + darwin*) MACHDEP="darwin";; + atheos*) MACHDEP="atheos";; +diff --git a/configure.in b/configure.in +--- a/configure.in ++++ b/configure.in +@@ -293,6 +293,7 @@ then + MACHDEP="$ac_md_system$ac_md_release" + + case $MACHDEP in ++ linux*) MACHDEP="linux2";; + cygwin*) MACHDEP="cygwin";; + darwin*) MACHDEP="darwin";; + atheos*) MACHDEP="atheos";; + diff --git a/dev-lang/python/files/pydoc.conf b/dev-lang/python/files/pydoc.conf new file mode 100644 index 00000000..4a98fd40 --- /dev/null +++ b/dev-lang/python/files/pydoc.conf @@ -0,0 +1,8 @@ +# /etc/init.d/pydoc.conf +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/files/pydoc.conf,v 1.2 2008/06/30 15:10:28 hawking Exp $ + +# This file contains the configuration information for pydoc's internal +# webserver. The variables should be rather self explanatory :-) + +# Default port for Python's pydoc server +PYDOC_PORT=7464 diff --git a/dev-lang/python/files/pydoc.init b/dev-lang/python/files/pydoc.init new file mode 100755 index 00000000..f67371d8 --- /dev/null +++ b/dev-lang/python/files/pydoc.init @@ -0,0 +1,27 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public Licence v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/files/pydoc.init,v 1.3 2011/05/17 15:14:43 arfrever Exp $ + +depend() { + need net +} + +start() { + if [ -z "${PYDOC_PORT}" ]; then + eerror "Port not set" + return 1 + fi + + ebegin "Starting pydoc server on port ${PYDOC_PORT}" + start-stop-daemon --start --background --make-pidfile \ + --pidfile /var/run/pydoc.pid \ + --startas /usr/bin/@PYDOC@ -- -p "${PYDOC_PORT}" + eend $? +} + +stop() { + ebegin "Stopping pydoc server" + start-stop-daemon --stop --quiet --pidfile /var/run/pydoc.pid + eend $? +} diff --git a/dev-lang/python/files/python-2.4.4-test-cross.patch b/dev-lang/python/files/python-2.4.4-test-cross.patch new file mode 100644 index 00000000..d32cb3ff --- /dev/null +++ b/dev-lang/python/files/python-2.4.4-test-cross.patch @@ -0,0 +1,19 @@ +--- Python-2.4.4/Lib/test/test_multibytecodec.py.orig 2007-09-10 14:52:34.424592960 -0400 ++++ Python-2.4.4/Lib/test/test_multibytecodec.py 2007-09-10 14:53:30.646201491 -0400 +@@ -81,11 +81,11 @@ class Test_ISO2022(unittest.TestCase): + uni = u':hu4:unit\xe9 de famille' + self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni) + +- def test_iso2022_jp_g0(self): +- self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2')) +- for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'): +- e = u'\u3406'.encode(encoding) +- self.failIf(filter(lambda x: x >= '\x80', e)) ++# def test_iso2022_jp_g0(self): ++# self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2')) ++# for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'): ++# e = u'\u3406'.encode(encoding) ++# self.failIf(filter(lambda x: x >= '\x80', e)) + + def test_bug1572832(self): + if sys.maxunicode >= 0x10000: diff --git a/dev-lang/python/files/python-2.5-cross-printf.patch b/dev-lang/python/files/python-2.5-cross-printf.patch new file mode 100644 index 00000000..9a3eaf71 --- /dev/null +++ b/dev-lang/python/files/python-2.5-cross-printf.patch @@ -0,0 +1,34 @@ +http://bugs.gentoo.org/239110 + +assume %zd is supported when cross-compiling. any target we care about +supports it, so ... + +--- configure.in ++++ configure.in +@@ -3417,7 +3417,7 @@ + + + +-AC_MSG_CHECKING(for %zd printf() format support) ++AC_CACHE_CHECK([for %zd printf() format support], [py_cv_has_zd_printf], [dnl + AC_TRY_RUN([#include + #include + #include +@@ -3451,10 +3451,13 @@ + return 1; + + return 0; +-}], +-[AC_MSG_RESULT(yes) +- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])], +- AC_MSG_RESULT(no)) ++}], [py_cv_has_zd_printf="yes"], ++ [py_cv_has_zd_printf="no"], ++ [py_cv_has_zd_printf="cross -- assuming yes"] ++)]) ++if test "$py_cv_has_zd_printf" != "no" ; then ++ AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t]) ++fi + + AC_CHECK_TYPE(socklen_t,, + AC_DEFINE(socklen_t,int, 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 00000000..9c4b6d2a --- /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 + #include +@@ -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 + #include +@@ -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-test-cross.patch b/dev-lang/python/files/python-2.6-test-cross.patch new file mode 100644 index 00000000..0ff41939 --- /dev/null +++ b/dev-lang/python/files/python-2.6-test-cross.patch @@ -0,0 +1,19 @@ +--- Lib/test/test_multibytecodec.py.orig 2008-04-19 18:48:59.000000000 +0300 ++++ Lib/test/test_multibytecodec.py 2008-04-19 18:49:44.000000000 +0300 +@@ -212,11 +212,11 @@ + uni = u':hu4:unit\xe9 de famille' + self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni) + +- def test_iso2022_jp_g0(self): +- self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2')) +- for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'): +- e = u'\u3406'.encode(encoding) +- self.failIf(filter(lambda x: x >= '\x80', e)) ++ #def test_iso2022_jp_g0(self): ++ # self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2')) ++ # for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'): ++ # e = u'\u3406'.encode(encoding) ++ # self.failIf(filter(lambda x: x >= '\x80', e)) + + def test_bug1572832(self): + if sys.maxunicode >= 0x10000: diff --git a/dev-lang/python/files/python-2.7.1-BJA-cross.diff b/dev-lang/python/files/python-2.7.1-BJA-cross.diff new file mode 100644 index 00000000..9d6c1cf6 --- /dev/null +++ b/dev-lang/python/files/python-2.7.1-BJA-cross.diff @@ -0,0 +1,29 @@ +--- Python-2.7.1/Makefile.pre.in.ori 2011-10-02 23:12:02.563007250 +0200 ++++ Python-2.7.1/Makefile.pre.in 2011-10-02 23:12:16.435076152 +0200 +@@ -934,26 +934,6 @@ + done; \ + done + $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- ./$(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/files/python-3.1.3-BJA-cross.diff b/dev-lang/python/files/python-3.1.3-BJA-cross.diff new file mode 100644 index 00000000..2c45f528 --- /dev/null +++ b/dev-lang/python/files/python-3.1.3-BJA-cross.diff @@ -0,0 +1,30 @@ +--- Python-3.1.3/configure.in.ori 2011-10-02 22:30:36.695328093 +0200 ++++ Python-3.1.3/configure.in 2011-10-02 22:37:37.248498660 +0200 +@@ -3533,6 +3533,7 @@ + + # Multiprocessing check for broken sem_getvalue + AC_MSG_CHECKING(for broken sem_getvalue) ++AC_CACHE_VAL(ac_cv_broken_sem_getvalue, + AC_TRY_RUN([ + #include + #include +@@ -3555,10 +3556,16 @@ + return res==-1 ? 1 : 0; + } + ] +-,AC_MSG_RESULT(no), +- AC_MSG_RESULT(yes) +- AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1, define to 1 if your sem_getvalue is broken.) ++, ac_cv_broken_sem_getvalue=no, ++ ac_cv_broken_sem_getvalue=yes, ++ ac_cv_broken_sem_getvalue=no) + ) ++AC_MSG_RESULT($ac_cv_broken_sem_getvalue) ++if test $ac_cv_broken_sem_getvalue = yes ++then ++ AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1, ++ [define to 1 if your sem_getvalue is broken]) ++fi + + # determine what size digit to use for Python's longs + AC_MSG_CHECKING([digit size for Python's longs]) diff --git a/dev-lang/python/files/python-3.2-soname_typo.patch b/dev-lang/python/files/python-3.2-soname_typo.patch new file mode 100644 index 00000000..357274c4 --- /dev/null +++ b/dev-lang/python/files/python-3.2-soname_typo.patch @@ -0,0 +1,51 @@ +# HG changeset patch +# User Martin v. Löwis +# Date 1304919465 -7200 +# Node ID 749686064642118c5ccc8ad28105472321931353 +# Parent 4f3f67a595fb05f04d89ed906df911b743e47463 +Use --as-needed when linking libpython3.so. Closes #11347. +Patch by Arfrever Frehtes Taifersar Arahesis. + +diff --git a/Makefile.pre.in b/Makefile.pre.in +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -76,6 +76,7 @@ PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIG + # environment variables + PY_CPPFLAGS= -I. -IInclude -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS) + PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS) ++NO_AS_NEEDED= @NO_AS_NEEDED@ + LDLAST= @LDLAST@ + SGI_ABI= @SGI_ABI@ + CCSHARED= @CCSHARED@ +@@ -459,7 +460,7 @@ libpython$(LDVERSION).so: $(LIBRARY_OBJS + fi + + libpython3.so: libpython$(LDVERSION).so +- $(BLDSHARED) -o $@ -Wl,-hl$@ $^ ++ $(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^ + + libpython$(LDVERSION).dylib: $(LIBRARY_OBJS) + $(CC) -dynamiclib -Wl,-single_module $(PY_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ +diff --git a/configure.in b/configure.in +--- a/configure.in ++++ b/configure.in +@@ -525,6 +525,18 @@ then + fi + + ++AC_MSG_CHECKING([for -Wl,--no-as-needed]) ++save_LDFLAGS="$LDFLAGS" ++LDFLAGS="$LDFLAGS -Wl,--no-as-needed" ++AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], ++ [NO_AS_NEEDED="-Wl,--no-as-needed" ++ AC_MSG_RESULT([yes])], ++ [NO_AS_NEEDED="" ++ AC_MSG_RESULT([no])]) ++LDFLAGS="$save_LDFLAGS" ++AC_SUBST(NO_AS_NEEDED) ++ ++ + # checks for UNIX variants that set C preprocessor variables + AC_USE_SYSTEM_EXTENSIONS + + diff --git a/dev-lang/python/files/python-config-2.4-r1 b/dev-lang/python/files/python-config-2.4-r1 new file mode 100644 index 00000000..af451131 --- /dev/null +++ b/dev-lang/python/files/python-config-2.4-r1 @@ -0,0 +1,58 @@ +#! /usr/bin/python2.4 + +import sys +import os +import getopt +from distutils import sysconfig + +valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags', + 'ldflags', 'help'] + +def exit_with_usage(code=1): + print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0], + '|'.join('--'+opt for opt in valid_opts)) + sys.exit(code) + +try: + opts, args = getopt.getopt(sys.argv[1:], '', valid_opts) +except getopt.error: + exit_with_usage() + +if not opts: + #exit_with_usage() + #be compatible with our old python-config-2.4 + import string + print "-lpython2.4 -lm -L/usr/lib/python2.4/config",string.join(string.split(sysconfig.get_config_var("MODLIBS"))) + sys.exit(0) + +opt = opts[0][0] + +pyver = sysconfig.get_config_var('VERSION') +getvar = sysconfig.get_config_var + +if opt == '--help': + exit_with_usage(0) + +elif opt == '--prefix': + print sysconfig.PREFIX + +elif opt == '--exec-prefix': + print sysconfig.EXEC_PREFIX + +elif opt in ('--includes', '--cflags'): + flags = ['-I' + sysconfig.get_python_inc(), + '-I' + sysconfig.get_python_inc(plat_specific=True)] + if opt == '--cflags': + flags.extend(getvar('CFLAGS').split()) + print ' '.join(flags) + +elif opt in ('--libs', '--ldflags'): + libs = getvar('LIBS').split() + getvar('SYSLIBS').split() + libs.append('-lpython'+pyver) + # add the prefix/lib/pythonX.Y/config dir, but only if there is no + # shared library in prefix/lib/. + if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'): + libs.insert(0, '-L' + getvar('LIBPL')) + print ' '.join(libs) + + diff --git a/dev-lang/python/python-2.7.1-r1.ebuild b/dev-lang/python/python-2.7.1-r1.ebuild new file mode 100644 index 00000000..4003f137 --- /dev/null +++ b/dev-lang/python/python-2.7.1-r1.ebuild @@ -0,0 +1,365 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.7.1-r1.ebuild,v 1.12 2011/05/17 15:14:43 arfrever Exp $ + +EAPI="2" +WANT_AUTOMAKE="none" + +inherit autotools eutils flag-o-matic multilib python toolchain-funcs + +if [[ "${PV}" == *_pre* ]]; then + inherit subversion + + ESVN_PROJECT="python" + ESVN_REPO_URI="http://svn.python.org/projects/python/branches/release27-maint" + ESVN_REVISION="" +else + MY_PV="${PV%_p*}" + MY_P="Python-${MY_PV}" +fi + +PATCHSET_REVISION="1" + +DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language." +HOMEPAGE="http://www.python.org/" +if [[ "${PV}" == *_pre* ]]; then + SRC_URI="" +else + SRC_URI="http://www.python.org/ftp/python/${MY_PV}/${MY_P}.tar.bz2 + mirror://gentoo/python-gentoo-patches-${MY_PV}$([[ "${PATCHSET_REVISION}" != "0" ]] && echo "-r${PATCHSET_REVISION}").tar.bz2" +fi + +LICENSE="PSF-2.2" +SLOT="2.7" +PYTHON_ABI="${SLOT}" +KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd" +IUSE="-berkdb build doc elibc_uclibc examples gdbm ipv6 +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml" + +RDEPEND=">=app-admin/eselect-python-20091230 + >=sys-libs/zlib-1.1.3 + virtual/libffi + virtual/libintl + !build? ( + berkdb? ( || ( + sys-libs/db:4.8 + sys-libs/db:4.7 + sys-libs/db:4.6 + sys-libs/db:4.5 + sys-libs/db:4.4 + sys-libs/db:4.3 + sys-libs/db:4.2 + ) ) + gdbm? ( sys-libs/gdbm ) + ncurses? ( + >=sys-libs/ncurses-5.2 + readline? ( >=sys-libs/readline-4.1 ) + ) + sqlite? ( >=dev-db/sqlite-3.3.8:3[extensions] ) + ssl? ( dev-libs/openssl ) + tk? ( >=dev-lang/tk-8.0 ) + xml? ( >=dev-libs/expat-2 ) + ) + !!=${CATEGORY}/${PN}-${SLOT}_alpha"; then + python_updater_warning="1" + fi +} + +eselect_python_update() { + if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then + eselect python update + fi + + if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then + eselect python update --python${PV%%.*} + fi +} + +pkg_postinst() { + eselect_python_update + + python_mod_optimize -f -x "/(site-packages|test|tests)/" $(python_get_libdir) + + if [[ "${python_updater_warning}" == "1" ]]; then + ewarn + ewarn "\e[1;31m************************************************************************\e[0m" + ewarn + ewarn "You have just upgraded from an older version of Python." + ewarn "You should run 'python-updater \${options}' to rebuild Python modules." + ewarn + ewarn "\e[1;31m************************************************************************\e[0m" + ewarn + + local n + for ((n = 0; n < 12; n++)); do + echo -ne "\a" + sleep 1 + done + fi +} + +pkg_postrm() { + eselect_python_update + + python_mod_cleanup $(python_get_libdir) +} -- cgit v1.2.3