Contents of /branches/R11-stable/extras/python3/python3-3.4.2-r1.smage2
Parent Directory | Revision Log
Revision 24401 -
(show annotations)
(download)
Fri Feb 20 10:18:43 2015 UTC (9 years, 7 months ago) by niro
File size: 4625 byte(s)
Fri Feb 20 10:18:43 2015 UTC (9 years, 7 months ago) by niro
File size: 4625 byte(s)
-release branches/R11-stable
1 | # $Id$ |
2 | |
3 | PNAME="python3" |
4 | PVER="3.4.2" |
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.3 |
22 | >= dev-db/db-6.0 |
23 | >= dev-db/sqlite-3.8 |
24 | >= app-arch/bzip2-1.0.6 |
25 | >= dev-libs/libffi-3.1" |
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.4.0-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 | UP2DATE="updatecmd -listonly https://www.python.org/downloads/ | grep '/releases/[0-9]' | sed 's:.*/releases/\(.*\)/:\1:' | upsort_pipe" |
57 | |
58 | src_prepare() |
59 | { |
60 | munpack ${SRCFILE} || die |
61 | |
62 | mpatch python-3.3.2-disable_modules_and_ssl.patch || die |
63 | mpatch python-2.5.0-mimetypes-apache.patch || die |
64 | |
65 | only-m64 mpatch python-3.4.0-lib64.patch || die |
66 | |
67 | # ensure to use system-wide copies of expat, zlib and libffi |
68 | # rather than copies shipped in the tarball |
69 | all-abis 'rm -r Modules/expat || die' |
70 | all-abis 'rm -r Modules/zlib || die' |
71 | all-abis 'rm -r Modules/_ctypes/{darwin,libffi}* || die' |
72 | } |
73 | |
74 | src_compile() |
75 | { |
76 | mconfigure \ |
77 | --enable-shared \ |
78 | --enable-ipv6 \ |
79 | --infodir=/usr/share/info \ |
80 | --mandir=/usr/share/man \ |
81 | --with-threads \ |
82 | --with-computed-gotos \ |
83 | --with-system-expat \ |
84 | --with-system-ffi \ |
85 | || die |
86 | |
87 | mmake || die |
88 | } |
89 | |
90 | src_install() |
91 | { |
92 | # install some missing directories |
93 | minstalldir /usr || die |
94 | |
95 | mmake DESTDIR=${BINDIR} altinstall || die |
96 | |
97 | all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS} || die |
98 | all-abis minstallfile Makefile.pre.in /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS} || die |
99 | |
100 | # remove hardcoded CFLAGS from default Makefile |
101 | all-abis sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}/Makefile || die |
102 | |
103 | if [[ $(mlibdir) != lib ]] |
104 | then |
105 | # move config header |
106 | all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig-$(mabi).h || die |
107 | |
108 | # install a stub header |
109 | cat > ${BINDIR}/usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig.h << "EOF" |
110 | /* pyconfig.h - Stub Header */ |
111 | #ifndef __STUB__PYCONFIG_H__ |
112 | #define __STUB__PYCONFIG_H__ |
113 | |
114 | #if defined(__x86_64__) || \ |
115 | defined(__sparc64__) || \ |
116 | defined(__arch64__) || \ |
117 | defined(__powerpc64__) || \ |
118 | defined (__s390x__) |
119 | # include "pyconfig-m64.h" |
120 | #else |
121 | # include "pyconfig-m32.h" |
122 | #endif |
123 | |
124 | #endif /* __STUB__PYCONFIG_H__ */ |
125 | EOF |
126 | # install the multiarch-wrapper |
127 | for exec in python${PVER%.*} python${PVER%.*}${PYTHON_ABIFLAGS} |
128 | do |
129 | if [[ -f ${BINDIR}/usr/bin/${exec} ]] |
130 | then |
131 | rm -f ${BINDIR}/usr/bin/${exec} || die |
132 | fi |
133 | all-abis minstallexec python /usr/bin/${exec}-$(mabi) || die |
134 | mlink multiarch-wrapper /usr/bin/${exec} || die |
135 | # not our default python |
136 | #all-abis mlink ${exec} /usr/bin/python-$(mabi) || die |
137 | all-abis mlink ${exec}-$(mabi) /usr/bin/${exec/${PVER%.*}/${PVER:0:1}}-$(mabi) || die |
138 | done |
139 | fi |
140 | |
141 | # not our default python |
142 | # # link python3.3m-config to python-config |
143 | # mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python-config || die |
144 | |
145 | # link python3.3m-config to python3.3-config |
146 | mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER%.*}-config || die |
147 | |
148 | # link python3.3m-config to python3-config |
149 | mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER:0:1}-config || die |
150 | |
151 | # not our default python |
152 | # # link python3.3 binary with python |
153 | # mlink python${PVER%.*} /usr/bin/python || die |
154 | |
155 | # link python3.3 binary with python3 |
156 | mlink python${PVER%.*} /usr/bin/python${PVER:0:1} || die |
157 | |
158 | minstalldocs LICENSE README || die |
159 | } |