Contents of /smage/trunk/extras/python3/python3-3.7.9-r1.smage2
Parent Directory | Revision Log
Revision 15360 -
(show annotations)
(download)
Fri Aug 28 06:13:44 2020 UTC (4 years, 1 month ago) by niro
File size: 5212 byte(s)
Fri Aug 28 06:13:44 2020 UTC (4 years, 1 month ago) by niro
File size: 5212 byte(s)
auto added: ver bump to 3.7.9-r1
1 | # $Id$ |
2 | |
3 | PNAME="python3" |
4 | PVER="3.7.9" |
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-6.0 |
18 | >= sys-libs/zlib-1.2 |
19 | >= dev-libs/expat-2 |
20 | >= dev-libs/openssl-1.1 |
21 | >= dev-db/db-6.2 |
22 | >= dev-db/sqlite-3.9 |
23 | >= app-arch/bzip2-1.0.6 |
24 | >= dev-libs/libffi-3.3 |
25 | >= app-arch/xz-utils-5.2" |
26 | |
27 | # util-linux for linux32/64 |
28 | SDEPEND=">= virtual/sed |
29 | >= sys-apps/util-linux-2.29.2 |
30 | >= sys-libs/ncurses-dev-6.0 |
31 | >= sys-libs/zlib-dev-1.2 |
32 | >= dev-libs/expat-dev-2 |
33 | >= dev-libs/openssl-dev-1.1 |
34 | >= dev-db/db-dev-6.2 |
35 | >= dev-db/sqlite-dev-3.9 |
36 | >= dev-libs/libffi-dev-3.2 |
37 | >= app-arch/bzip2-dev-1.0.6 |
38 | >= sys-apps/util-linux-dev-2.29.2 |
39 | >= app-arch/xz-utils-dev-5.2" |
40 | |
41 | SRCFILE="Python-${PVER/.0}.tar.xz" |
42 | SRCDIR="${BUILDDIR}/Python-${PVER/.0}" |
43 | |
44 | # disabled modules (needs the disable_modules patch) |
45 | export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die |
46 | |
47 | # force usage of our CFLAGS |
48 | export OPT="${CFLAGS}" |
49 | |
50 | # optimized ABIFLAGS is set to m = malloc in our builds |
51 | export PYTHON_ABIFLAGS="m" |
52 | |
53 | sminclude multilib mtools mbuild |
54 | msetfeature "!check" |
55 | |
56 | # uses PYVER and sometimes PVER; so keep both |
57 | SRC_URI=( |
58 | http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE} |
59 | http://www.python.org/ftp/python/${PVER}/${SRCFILE} |
60 | mirror://python/${SRCFILE} |
61 | mirror://python/python-3.7.0-disable_modules_and_ssl.patch |
62 | mirror://python/python-2.5.0-mimetypes-apache.patch |
63 | mirror://python/python-3.7.1-lib64.patch |
64 | ) |
65 | |
66 | # sed line: on 2 digits add an zero: 2.6 -> 2.6.0 |
67 | #UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'" |
68 | #UP2DATE="updatecmd -listonly https://www.python.org/downloads/ | grep '/releases/[0-9]' | sed 's:.*/releases/\(.*\)/:\1:' | upsort_pipe" |
69 | UP2DATE="updatecmd ${HOMEPAGE}/download/ | grep -- '-3\.' | highesttarball xz" |
70 | |
71 | src_prepare() |
72 | { |
73 | munpack ${SRCFILE} || die |
74 | |
75 | mpatch python-3.7.0-disable_modules_and_ssl.patch || die |
76 | mpatch python-2.5.0-mimetypes-apache.patch || die |
77 | |
78 | only-m64 mpatch python-3.7.1-lib64.patch || die |
79 | |
80 | # ensure to use system-wide copies of expat and libffi |
81 | # rather than copies shipped in the tarball |
82 | all-abis 'rm -r Modules/expat || die' |
83 | all-abis 'rm -r Modules/_ctypes/{darwin,libffi}* || die' |
84 | } |
85 | |
86 | src_compile() |
87 | { |
88 | mconfigure \ |
89 | --enable-shared \ |
90 | --enable-ipv6 \ |
91 | --infodir=/usr/share/info \ |
92 | --mandir=/usr/share/man \ |
93 | --with-threads \ |
94 | --with-computed-gotos \ |
95 | --with-system-expat \ |
96 | --with-system-ffi \ |
97 | --enable-loadable-sqlite-extensions \ |
98 | || die |
99 | |
100 | mmake || die |
101 | } |
102 | |
103 | src_install() |
104 | { |
105 | # install some missing directories |
106 | minstalldir /usr || die |
107 | |
108 | mmake DESTDIR=${BINDIR} altinstall || die |
109 | |
110 | all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu || die |
111 | all-abis minstallfile Makefile.pre.in /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu || die |
112 | |
113 | # remove hardcoded CFLAGS from default Makefile |
114 | all-abis sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu/Makefile || die |
115 | |
116 | if [[ $(mlibdir) != lib ]] |
117 | then |
118 | # move config header |
119 | all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig-$(mabi).h || die |
120 | |
121 | # install a stub header |
122 | cat > ${BINDIR}/usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig.h << "EOF" |
123 | /* pyconfig.h - Stub Header */ |
124 | #ifndef __STUB__PYCONFIG_H__ |
125 | #define __STUB__PYCONFIG_H__ |
126 | |
127 | #if defined(__x86_64__) || \ |
128 | defined(__sparc64__) || \ |
129 | defined(__arch64__) || \ |
130 | defined(__powerpc64__) || \ |
131 | defined (__s390x__) |
132 | # include "pyconfig-m64.h" |
133 | #else |
134 | # include "pyconfig-m32.h" |
135 | #endif |
136 | |
137 | #endif /* __STUB__PYCONFIG_H__ */ |
138 | EOF |
139 | # install the multiarch-wrapper |
140 | for exec in python${PVER%.*} python${PVER%.*}${PYTHON_ABIFLAGS} |
141 | do |
142 | if [[ -f ${BINDIR}/usr/bin/${exec} ]] |
143 | then |
144 | rm -f ${BINDIR}/usr/bin/${exec} || die |
145 | fi |
146 | all-abis minstallexec python /usr/bin/${exec}-$(mabi) || die |
147 | mlink multiarch-wrapper /usr/bin/${exec} || die |
148 | # not our default python |
149 | #all-abis mlink ${exec} /usr/bin/python-$(mabi) || die |
150 | all-abis mlink ${exec}-$(mabi) /usr/bin/${exec/${PVER%.*}/${PVER:0:1}}-$(mabi) || die |
151 | done |
152 | fi |
153 | |
154 | # not our default python |
155 | # # link python3.3m-config to python-config |
156 | # mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python-config || die |
157 | |
158 | # link python3.3m-config to python3.3-config |
159 | mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER%.*}-config || die |
160 | |
161 | # link python3.3m-config to python3-config |
162 | mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER:0:1}-config || die |
163 | |
164 | # not our default python |
165 | # # link python3.3 binary with python |
166 | # mlink python${PVER%.*} /usr/bin/python || die |
167 | |
168 | # link python3.3 binary with python3 |
169 | mlink python${PVER%.*} /usr/bin/python${PVER:0:1} || die |
170 | |
171 | minstalldocs LICENSE README || die |
172 | } |