Magellan Linux

Contents of /branches/R11-stable/core/python/python-2.7.5-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17789 - (show annotations) (download)
Wed Jun 26 12:31:53 2013 UTC (10 years, 11 months ago) by niro
File size: 4128 byte(s)
-release branches/R11-stable
1 # $Id$
2
3 PNAME="python"
4 PVER="2.7.5"
5 PBUILD="r1"
6
7 PCAT="dev-lang"
8
9 DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
10 HOMEPAGE="http://www.python.org/"
11
12 DEPEND_x86_64=">= sys-apps/multiarch-wrapper-1"
13 SPECIAL_VARS="DEPEND_x86_64"
14
15 DEPEND="$(marchdepend)
16 >= virtual/glibc
17 >= sys-libs/ncurses-5.9
18 >= sys-libs/zlib-1.2
19 >= dev-libs/expat-2
20 >= dev-libs/openssl-1.0.1
21 >= sys-libs/readline-6.2
22 >= dev-db/sqlite-3.7
23 >= app-arch/bzip2-1.0.6
24 >= dev-libs/libffi-3.0.10"
25
26 SDEPEND=">= virtual/sed"
27
28 SRCFILE="${PNAME/py/Py}-${PVER/.0}.tar.bz2"
29 SRCDIR="${BUILDDIR}/${PNAME/py/Py}-${PVER/.0}"
30
31 # disabled modules (needs the gentoo_py_dontcompile patch)
32 export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die
33
34 # force usage of our CFLAGS
35 export OPT="${CFLAGS}"
36
37 sminclude mtools multilib
38 msetfeature "!check"
39
40 # uses PYVER and sometimes PVER; so keep both
41 SRC_URI=(
42 http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE}
43 http://www.python.org/ftp/python/${PVER}/${SRCFILE}
44 mirror://${PNAME}/${SRCFILE}
45 mirror://${PNAME}/${PNAME}-2.7.0-gentoo_py_dontcompile.patch
46 mirror://${PNAME}/${PNAME}-2.4-disable_modules_and_ssl.patch
47 mirror://${PNAME}/${PNAME}-2.5.0-mimetypes-apache.patch
48 mirror://${PNAME}/${PNAME}-2.7.1-lib64.patch
49 )
50
51 # sed line: on 2 digits add an zero: 2.6 -> 2.6.0
52 UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'"
53
54 src_prepare()
55 {
56 munpack ${SRCFILE} || die
57
58 # adds support for PYTHON_DONTCOMPILE shell environment to
59 # supress automatic generation of .pyc and .pyo files
60 mpatch ${PNAME}-2.7.0-gentoo_py_dontcompile.patch || die
61 mpatch ${PNAME}-2.4-disable_modules_and_ssl.patch || die
62 mpatch ${PNAME}-2.5.0-mimetypes-apache.patch || die
63
64 only-m64 mpatch ${PNAME}-2.7.1-lib64.patch || die
65
66 # ensure to use system-wide copies of expat, zlib and libffi
67 # rather than copies shipped in the tarball
68 all-abis 'rm -r Modules/expat || die'
69 all-abis 'rm -r Modules/zlib || die'
70 all-abis 'rm -r Modules/_ctypes/{darwin,libffi}* || die'
71 }
72
73 src_compile()
74 {
75 mconfigure \
76 --with-fpectl \
77 --enable-shared \
78 --enable-unicode=ucs4 \
79 --infodir='${prefix}'/share/info \
80 --mandir='${prefix}'/share/man \
81 --with-threads \
82 --with-system-expat \
83 --with-system-ffi \
84 || die
85
86 mmake || die
87 }
88
89 src_install()
90 {
91 # install some missing directories
92 minstalldir /usr || die
93
94 mmake DESTDIR=${BINDIR} altinstall || die
95
96 all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config || die
97 all-abis minstallfile Makefile.pre.in /usr/'$(mlibdir)'/python${PVER%.*}/config || die
98
99 # remove hardcoded CFLAGS from default Makefile
100 all-abis sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/'$(mlibdir)'/python${PVER%.*}/config/Makefile || die
101
102 if [[ ${ARCH} = x86_64 ]]
103 then
104 # move config header
105 all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}/pyconfig-$(mabi).h || die
106
107 # install a stub header
108 cat > ${BINDIR}/usr/include/python${PVER%.*}/pyconfig.h << "EOF"
109 /* pyconfig.h - Stub Header */
110 #ifndef __STUB__PYCONFIG_H__
111 #define __STUB__PYCONFIG_H__
112
113 #if defined(__x86_64__) || \
114 defined(__sparc64__) || \
115 defined(__arch64__) || \
116 defined(__powerpc64__) || \
117 defined (__s390x__)
118 # include "pyconfig-m64.h"
119 #else
120 # include "pyconfig-m32.h"
121 #endif
122
123 #endif /* __STUB__PYCONFIG_H__ */
124 EOF
125 # install the multiarch-wrapper
126 if [[ -f ${BINDIR}/usr/bin/python${PVER%.*} ]]
127 then
128 rm -f ${BINDIR}/usr/bin/python${PVER%.*} || die
129 fi
130 all-abis minstallexec python /usr/bin/python${PVER%.*}-$(mabi) || die
131 mlink multiarch-wrapper /usr/bin/python${PVER%.*} || die
132 all-abis mlink python${PVER%.*}-$(mabi) /usr/bin/python-$(mabi) || die
133 all-abis mlink python${PVER%.*}-$(mabi) /usr/bin/python2-$(mabi) || die
134 fi
135
136 # link python${PVER%.*}-config to python-config
137 mlink python${PVER%.*}-config /usr/bin/python-config || die
138
139 # link python2.7 binary with python
140 mlink python${PVER%.*} /usr/bin/python || die
141
142 # link python2.7 binary with python2
143 mlink python${PVER%.*} /usr/bin/python2 || die
144
145 minstalldocs LICENSE README || die
146 }