Annotation of /branches/magellan-next/core/python/python-2.7.0-r4.smage2
Parent Directory | Revision Log
Revision 6338 -
(hide annotations)
(download)
Fri Aug 20 19:55:52 2010 UTC (13 years, 9 months ago) by niro
File size: 3607 byte(s)
Fri Aug 20 19:55:52 2010 UTC (13 years, 9 months ago) by niro
File size: 3607 byte(s)
-fixed multilib install
1 | niro | 6328 | # $Id: python-2.6.3-r2.smage2 3627 2009-10-27 15:43:35Z niro $ |
2 | |||
3 | PNAME="python" | ||
4 | PVER="2.7.0" | ||
5 | PBUILD="r4" | ||
6 | |||
7 | PCATEGORIE="dev-lang" | ||
8 | STATE="unstable" | ||
9 | |||
10 | DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language." | ||
11 | HOMEPAGE="http://www.python.org/" | ||
12 | |||
13 | DEPEND_x86_64=">= sys-apps/multiarch-wrapper-1" | ||
14 | SPECIAL_VARS="DEPEND_x86_64" | ||
15 | |||
16 | DEPEND="\$(eval echo \\\$DEPEND_\${ARCH/i*86/x86} | tr ';' '\n') | ||
17 | >= virtual/glibc | ||
18 | >= sys-libs/ncurses-5.7 | ||
19 | >= sys-libs/zlib-1.2 | ||
20 | >= dev-libs/expat-2 | ||
21 | >= dev-libs/openssl-1.0.0 | ||
22 | >= sys-libs/readline-6.1 | ||
23 | >= dev-db/sqlite-3.7" | ||
24 | |||
25 | SDEPEND=">= sys-apps/sed-4" | ||
26 | |||
27 | SRCFILE="${PNAME/py/Py}-${PVER/.0}.tar.bz2" | ||
28 | SRCDIR="${BUILDDIR}/${PNAME/py/Py}-${PVER/.0}" | ||
29 | |||
30 | # disabled modules (needs the gentoo_py_dontcompile patch) | ||
31 | export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die | ||
32 | |||
33 | # force usage of our CFLAGS | ||
34 | export OPT="${CFLAGS}" | ||
35 | |||
36 | niro | 6331 | sminclude mtools multilib |
37 | niro | 6328 | |
38 | # uses PYVER and sometimes PVER; so keep both | ||
39 | SRC_URI=( | ||
40 | http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE} | ||
41 | http://www.python.org/ftp/python/${PVER}/${SRCFILE} | ||
42 | mirror://${PNAME}/${SRCFILE} | ||
43 | mirror://${PNAME}/${PNAME}-2.7.0-gentoo_py_dontcompile.patch | ||
44 | mirror://${PNAME}/${PNAME}-2.4-disable_modules_and_ssl.patch | ||
45 | mirror://${PNAME}/${PNAME}-2.5.0-mimetypes-apache.patch | ||
46 | mirror://${PNAME}/${PNAME}-2.7.0-lib64-3.patch | ||
47 | ) | ||
48 | |||
49 | # sed line: on 2 digits add an zero: 2.6 -> 2.6.0 | ||
50 | UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'" | ||
51 | |||
52 | src_prepare() | ||
53 | { | ||
54 | munpack ${SRCFILE} || die | ||
55 | |||
56 | # adds support for PYTHON_DONTCOMPILE shell environment to | ||
57 | # supress automatic generation of .pyc and .pyo files | ||
58 | mpatch ${PNAME}-2.7.0-gentoo_py_dontcompile.patch || die | ||
59 | mpatch ${PNAME}-2.4-disable_modules_and_ssl.patch || die | ||
60 | mpatch ${PNAME}-2.5.0-mimetypes-apache.patch || die | ||
61 | |||
62 | niro | 6332 | only-m64 mpatch ${PNAME}-2.7.0-lib64-3.patch || die |
63 | niro | 6328 | } |
64 | |||
65 | src_compile() | ||
66 | { | ||
67 | mconfigure \ | ||
68 | --with-fpectl \ | ||
69 | --enable-shared \ | ||
70 | --infodir='${prefix}'/share/info \ | ||
71 | --mandir='${prefix}'/share/man \ | ||
72 | --with-threads || die | ||
73 | |||
74 | mmake || die | ||
75 | } | ||
76 | |||
77 | src_install() | ||
78 | { | ||
79 | # install some missing directories | ||
80 | minstalldir /usr || die | ||
81 | |||
82 | niro | 6337 | local abi |
83 | for abi in ${MULTILIB_ABIS} | ||
84 | do | ||
85 | make DESTDIR=${BINDIR} altinstall || die | ||
86 | niro | 6328 | |
87 | niro | 6337 | minstalldir /usr/$(mlibdir)/python${PVER%.*}/config || die |
88 | minstallfile ${SRCDIR}-${abi}/Makefile.pre.in /usr/'$(mlibdir)'/python${PVER%.*}/config || die | ||
89 | niro | 6328 | |
90 | niro | 6337 | # remove hardcoded CFLAGS from default Makefile |
91 | sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/$(mlibdir)/python${PVER%.*}/config/Makefile || die | ||
92 | niro | 6328 | |
93 | niro | 6337 | if [[ ${ARCH} = x86_64 ]] |
94 | then | ||
95 | # move config header | ||
96 | niro | 6338 | mv -v ${BINDIR}/usr/include/python${PVER%.*}/pyconfig{,${abi}}.h |
97 | niro | 6328 | |
98 | niro | 6337 | # install a stub header |
99 | cat > ${BINDIR}/usr/include/python${PVER%.*}/pyconfig.h << "EOF" | ||
100 | niro | 6329 | /* pyconfig.h - Stub Header */ |
101 | #ifndef __STUB__PYCONFIG_H__ | ||
102 | #define __STUB__PYCONFIG_H__ | ||
103 | |||
104 | #if defined(__x86_64__) || \ | ||
105 | defined(__sparc64__) || \ | ||
106 | defined(__arch64__) || \ | ||
107 | defined(__powerpc64__) || \ | ||
108 | defined (__s390x__) | ||
109 | niro | 6334 | # include "pyconfig-m64.h" |
110 | niro | 6329 | #else |
111 | niro | 6334 | # include "pyconfig-m32.h" |
112 | niro | 6329 | #endif |
113 | |||
114 | #endif /* __STUB__PYCONFIG_H__ */ | ||
115 | EOF | ||
116 | niro | 6337 | # install the multiarch-wrapper |
117 | niro | 6338 | mv -v ${BINDIR}/usr/bin/python${PYVER%.*}{,-${abi}} |
118 | niro | 6337 | mlink multiarch-wrapper /usr/bin/python${PYVER%.*} |
119 | fi | ||
120 | done | ||
121 | niro | 6329 | |
122 | niro | 6337 | # link python${PVER%.*}-config to python-config |
123 | mlink python${PVER%.*}-config /usr/bin/python-config || die | ||
124 | |||
125 | niro | 6328 | # link python2.7 binary with python |
126 | mlink python${PVER%.*} /usr/bin/python || die | ||
127 | |||
128 | # link python2.7 binary with python2 | ||
129 | mlink python${PVER%.*} /usr/bin/python2 || die | ||
130 | |||
131 | minstalldocs LICENSE README || die | ||
132 | } |