Gentoo Archives: gentoo-commits

From: Sebastian Pipping <sping@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/betagarden:master commit in: dev-lang/python/, dev-lang/python/files/
Date: Thu, 28 Apr 2011 23:31:04
Message-Id: a3712c45dee61717cbc09b39ff868af7a3ccaa89.sping@gentoo
1 commit: a3712c45dee61717cbc09b39ff868af7a3ccaa89
2 Author: Sebastian Pipping <sebastian <AT> pipping <DOT> org>
3 AuthorDate: Thu Apr 28 23:07:33 2011 +0000
4 Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 28 23:30:29 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/betagarden.git;a=commit;h=a3712c45
7
8 dev-lang/python: 2.2, return from the stone age
9
10 ---
11 dev-lang/python/files/python-2.2-readline.patch | 12 ++
12 dev-lang/python/metadata.xml | 9 ++
13 dev-lang/python/python-2.2-r8.ebuild | 143 +++++++++++++++++++++++
14 3 files changed, 164 insertions(+), 0 deletions(-)
15
16 diff --git a/dev-lang/python/files/python-2.2-readline.patch b/dev-lang/python/files/python-2.2-readline.patch
17 new file mode 100644
18 index 0000000..0bd740b
19 --- /dev/null
20 +++ b/dev-lang/python/files/python-2.2-readline.patch
21 @@ -0,0 +1,12 @@
22 +diff --git a/Modules/readline.c b/Modules/readline.c
23 +index fe653b8..a6b203e 100644
24 +--- a/Modules/readline.c
25 ++++ b/Modules/readline.c
26 +@@ -93,7 +93,6 @@ read_history_file(PyObject *self, PyObject *args)
27 + return Py_None;
28 + }
29 +
30 +-static int history_length = -1; /* do not truncate history by default */
31 + static char doc_read_history_file[] = "\
32 + read_history_file([filename]) -> None\n\
33 + Load a readline history file.\n\
34
35 diff --git a/dev-lang/python/metadata.xml b/dev-lang/python/metadata.xml
36 new file mode 100644
37 index 0000000..328fbd1
38 --- /dev/null
39 +++ b/dev-lang/python/metadata.xml
40 @@ -0,0 +1,9 @@
41 +<?xml version="1.0" encoding="UTF-8"?>
42 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
43 +<pkgmetadata>
44 + <herd>no-herd</herd>
45 + <maintainer>
46 + <email>sping@g.o</email>
47 + <name>Sebastian Pipping</name>
48 + </maintainer>
49 +</pkgmetadata>
50
51 diff --git a/dev-lang/python/python-2.2-r8.ebuild b/dev-lang/python/python-2.2-r8.ebuild
52 new file mode 100644
53 index 0000000..94d4c40
54 --- /dev/null
55 +++ b/dev-lang/python/python-2.2-r8.ebuild
56 @@ -0,0 +1,143 @@
57 +# Copyright 1999-2011 Gentoo Foundation
58 +# Distributed under the terms of the GNU General Public License v2
59 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/Attic/python-2.2-r7.ebuild,v 1.12 2003/04/01 00:05:24 liquidx dead $
60 +
61 +EAPI="2"
62 +
63 +MULTILIB_STRICT_DIRS= # Dirty hack to bypass failing multilib-strict testing
64 +
65 +inherit eutils flag-o-matic
66 +
67 +IUSE="readline tcltk berkdb bootstrap"
68 +
69 +PYVER_MAJOR="`echo ${PV} | cut -d '.' -f 1`"
70 +PYVER_MINOR="`echo ${PV} | cut -d '.' -f 2`"
71 +PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
72 +S=${WORKDIR}/Python-${PV}
73 +DESCRIPTION="A really great language"
74 +SRC_URI="http://www.python.org/ftp/python/${PV}/Python-${PV}.tgz"
75 +
76 +HOMEPAGE="http://www.python.org"
77 +LICENSE="PSF-2.2"
78 +KEYWORDS="x86 sparc "
79 +
80 +DEPEND="sys-libs/glibc >=sys-libs/zlib-1.1.3
81 + readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 )
82 + berkdb? ( >=sys-libs/db-3 )
83 + tcltk? ( >=dev-lang/tk-8.0 )"
84 +RDEPEND="$DEPEND dev-python/python-fchksum"
85 +
86 +# The dev-python/python-fchksum RDEPEND is needed to that this python provides
87 +# the functionality expected from previous pythons.
88 +
89 +SLOT="2.2"
90 +
91 +KEYWORDS="~amd64 ~sparc ~x86"
92 +
93 +src_prepare() {
94 + # python's config seems to ignore CFLAGS
95 + export OPT=$CFLAGS
96 +
97 + # adjust makefile to install pydoc into ${D} correctly
98 + t=${S}/Makefile.pre.in
99 + cp $t $t.orig || die
100 + sed 's:install-platlib.*:& --install-scripts=$(BINDIR):' $t.orig > $t
101 +
102 + # adjust Setup to include the various modules we need
103 + cd "${S}"
104 + # turn **on** shared
105 + scmd="s:#\(\*shared\*\):\1:;"
106 + # adjust for USE readline
107 + if use readline; then
108 + scmd="$scmd s:#\(readline .*\) -ltermcap:\1:;"
109 + scmd="$scmd s:#\(_curses .*\) -lcurses -ltermcap:\1 -lncurses:;"
110 + fi
111 + # adjust for USE tcltk
112 + if use tcltk; then
113 + # Find the version of tcl/tk that has headers installed.
114 + # This will be the most recently merged, not necessarily the highest
115 + # version number.
116 + tclv=$(grep TCL_VER /usr/include/tcl.h | sed 's/^.*"\(.*\)".*/\1/')
117 + tkv=$( grep TK_VER /usr/include/tk.h | sed 's/^.*"\(.*\)".*/\1/')
118 + # adjust Setup to match
119 + scmd="$scmd s:# \(_tkinter \):\1:;"
120 + scmd="$scmd s:#\(\t-ltk[0-9.]* -ltcl[0-9.]*\):\t-ltk$tkv -ltcl$tclv:;"
121 + scmd="$scmd s:#\(\t-L/usr/X11R6/lib\):\1:;"
122 + scmd="$scmd s:#\(\t-lX11.*\):\1:;"
123 + scmd="$scmd s:#\(\t-I/usr/X11R6/include\):\1:;"
124 + fi
125 + # adjust for USE berkdb
126 + if use berkdb; then
127 + # patch the dbmmodule to use db3's dbm compatibility code. That way,
128 + # we're depending on db3 rather than old db1.
129 + t=Modules/dbmmodule.c
130 + cp $t $t.orig || die
131 + sed \
132 + -e '10,25d' \
133 + -e '26i\' \
134 + -e '#define DB_DBM_HSEARCH 1\' \
135 + -e 'static char *which_dbm = "BSD db";\' \
136 + -e '#include <db3/db.h>' \
137 + $t.orig > $t
138 + # now fix Setup
139 + scmd="$scmd s:#dbm.*:dbm dbmmodule.c -I/usr/include/db3 -ldb-3.2:;"
140 + fi
141 + # no USE vars to switch off these adjustments:
142 + scmd="$scmd s:#\(_locale .*\):\1:;" # access to ISO C locale support
143 + scmd="$scmd s:#\(syslog .*\):\1:;" # syslog daemon interface
144 + scmd="$scmd s:#\(zlib .*\):\1:;" # This require zlib 1.1.3 (or later).
145 + scmd="$scmd s:#\(termios .*\):\1:;" # Steen Lumholt's termios module
146 + scmd="$scmd s:#\(resource .*\):\1:;" # Jeremy Hylton's rlimit interface
147 + sed "$scmd" Modules/Setup.dist > Modules/Setup
148 +
149 + epatch "${FILESDIR}"/${P}-readline.patch
150 +}
151 +
152 +src_configure() {
153 + local myopts
154 + #if we are creating a new build image, we remove the dependency on g++
155 + if [ "`use build`" -a ! "`use bootstrap`" ]
156 + then
157 + myopts="--with-cxx=no"
158 + fi
159 + OPT="${CFLAGS} -fPIC" ./configure \
160 + --prefix=/usr \
161 + --without-libdb \
162 + --infodir='${prefix}'/share/info \
163 + --mandir='${prefix}'/share/man $myopts
164 + assert "Configure failed"
165 + # kill the -DHAVE_CONFIG_H flag
166 + mv Makefile Makefile.orig
167 + sed -e 's/-DHAVE_CONFIG_H//' Makefile.orig > Makefile
168 +}
169 +
170 +src_compile() {
171 + #emake || die "Parallel make failed"
172 + make || die "Parallel make failed"
173 +}
174 +
175 +src_install() {
176 + dodir /usr
177 + make install prefix="${D}"/usr || die
178 + rm "${D}/usr/bin/python" || die
179 + dodoc README || die
180 +
181 + # install our own custom python-config
182 + ### exeinto /usr/bin
183 + ### newexe "${FILESDIR}"/python-config-${PYVER} python-config
184 +
185 + # seems like the build do not install Makefile.pre.in anymore
186 + insinto /usr/lib/python${PYVER}/config
187 + doins "${S}"/Makefile.pre.in || die
188 +
189 + # If USE tcltk lets install idle
190 + # Need to script the python version in the path
191 + if use tcltk; then
192 + dodir /usr/lib/python${PYVER}/tools
193 + mv "${S}/Tools/idle" "${D}/usr/lib/python${PYVER}/tools/" || die
194 + dosym /usr/lib/python${PYVER}/tools/idle/idle.py /usr/bin/idle.py || die
195 + fi
196 +
197 + mv "${D}"/usr/share/man/man1/python{,${PV}}.1 || die
198 + mv "${D}"/usr/bin/pydoc{,${PV}} || die
199 +}