Magellan Linux

Contents of /branches/R11-stable/extras/python3/python3-3.3.3-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 20202 - (show annotations) (download)
Tue Nov 26 11:46:02 2013 UTC (10 years, 6 months ago) by niro
File size: 4490 byte(s)
-release branches/R11-stable
1 # $Id$
2
3 PNAME="python3"
4 PVER="3.3.3"
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/db-6.0
23 >= dev-db/sqlite-3.7
24 >= app-arch/bzip2-1.0.6
25 >= dev-libs/libffi-3.0.13"
26
27 SDEPEND=">= virtual/sed"
28
29 SRCFILE="Python-${PVER/.0}.tar.xz"
30 SRCDIR="${BUILDDIR}/Python-${PVER/.0}"
31
32 # disabled modules (needs the disable_modules patch)
33 export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die
34
35 # force usage of our CFLAGS
36 export OPT="${CFLAGS}"
37
38 # optimized ABIFLAGS is set to m = malloc in our builds
39 export PYTHON_ABIFLAGS="m"
40
41 sminclude mtools multilib
42 msetfeature "!check"
43
44 # uses PYVER and sometimes PVER; so keep both
45 SRC_URI=(
46 http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE}
47 http://www.python.org/ftp/python/${PVER}/${SRCFILE}
48 mirror://python/${SRCFILE}
49 mirror://python/python-3.3.2-disable_modules_and_ssl.patch
50 mirror://python/python-2.5.0-mimetypes-apache.patch
51 mirror://python/python-3.3.2-lib64.patch
52 )
53
54 # sed line: on 2 digits add an zero: 2.6 -> 2.6.0
55 UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'"
56
57 src_prepare()
58 {
59 munpack ${SRCFILE} || die
60
61 mpatch python-3.3.2-disable_modules_and_ssl.patch || die
62 mpatch python-2.5.0-mimetypes-apache.patch || die
63
64 only-m64 mpatch python-3.3.2-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 --enable-shared \
77 --enable-ipv6 \
78 --infodir=/usr/share/info \
79 --mandir=/usr/share/man \
80 --with-threads \
81 --with-computed-gotos \
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-${PVER%.*}${PYTHON_ABIFLAGS} || die
97 all-abis minstallfile Makefile.pre.in /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS} || die
98
99 # remove hardcoded CFLAGS from default Makefile
100 all-abis sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}/Makefile || die
101
102 if [[ $(mlibdir) != lib ]]
103 then
104 # move config header
105 all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig-$(mabi).h || die
106
107 # install a stub header
108 cat > ${BINDIR}/usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/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 for exec in python${PVER%.*} python${PVER%.*}${PYTHON_ABIFLAGS}
127 do
128 if [[ -f ${BINDIR}/usr/bin/${exec} ]]
129 then
130 rm -f ${BINDIR}/usr/bin/${exec} || die
131 fi
132 all-abis minstallexec python /usr/bin/${exec}-$(mabi) || die
133 mlink multiarch-wrapper /usr/bin/${exec} || die
134 # not our default python
135 #all-abis mlink ${exec} /usr/bin/python-$(mabi) || die
136 all-abis mlink ${exec}-$(mabi) /usr/bin/${exec/${PVER%.*}/${PVER:0:1}}-$(mabi) || die
137 done
138 fi
139
140 # not our default python
141 # # link python3.3m-config to python-config
142 # mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python-config || die
143
144 # link python3.3m-config to python3.3-config
145 mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER%.*}-config || die
146
147 # link python3.3m-config to python3-config
148 mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER:0:1}-config || die
149
150 # not our default python
151 # # link python3.3 binary with python
152 # mlink python${PVER%.*} /usr/bin/python || die
153
154 # link python3.3 binary with python3
155 mlink python${PVER%.*} /usr/bin/python${PVER:0:1} || die
156
157 minstalldocs LICENSE README || die
158 }