Annotation of /trunk/extras/python3/python3-3.11.4-r3.smage2
Parent Directory | Revision Log
Revision 33419 -
(hide annotations)
(download)
Mon Jul 17 07:15:47 2023 UTC (10 months, 3 weeks ago) by niro
File size: 8259 byte(s)
Mon Jul 17 07:15:47 2023 UTC (10 months, 3 weeks ago) by niro
File size: 8259 byte(s)
-link all python binaries to python-major version
1 | niro | 33419 | # $Id$ |
2 | |||
3 | PNAME="python3" | ||
4 | PVER="3.11.4" | ||
5 | PBUILD="r3" | ||
6 | |||
7 | SPLIT_PACKAGES="python3 python3-tests" | ||
8 | PCAT="dev-lang" | ||
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="$(marchdepend) | ||
17 | >= virtual/glibc | ||
18 | >= sys-libs/ncurses-6.4 | ||
19 | >= sys-libs/zlib-1.2 | ||
20 | >= dev-libs/expat-2 | ||
21 | >= dev-libs/openssl-3.1 | ||
22 | >= sys-libs/libxcrypt-4.4 | ||
23 | >= sys-libs/readline-8.2 | ||
24 | >= dev-db/db-6.2 | ||
25 | >= dev-db/sqlite-3.42 | ||
26 | >= app-arch/bzip2-1.0.6 | ||
27 | >= dev-libs/libffi-3.4" | ||
28 | |||
29 | # util-linux for linux32/64 | ||
30 | SDEPEND=">= virtual/sed | ||
31 | >= sys-apps/util-linux-2.39" | ||
32 | |||
33 | SRCFILE="Python-${PVER/.0}.tar.xz" | ||
34 | SRCDIR="${BUILDDIR}/Python-${PVER/.0}" | ||
35 | |||
36 | # force usage of our CFLAGS | ||
37 | export OPT="${CFLAGS}" | ||
38 | |||
39 | sminclude multilib mtools mbuild cleanutils | ||
40 | msetfeature "!check" | ||
41 | |||
42 | # uses PYVER and sometimes PVER; so keep both | ||
43 | SRC_URI=( | ||
44 | http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE} | ||
45 | http://www.python.org/ftp/python/${PVER}/${SRCFILE} | ||
46 | mirror://python/${SRCFILE} | ||
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 | #UP2DATE="updatecmd -listonly https://www.python.org/downloads/ | grep '/releases/[0-9]' | sed 's:.*/releases/\(.*\)/:\1:' | upsort_pipe" | ||
52 | UP2DATE="updatecmd ${HOMEPAGE}/download/ | grep -- '-3\.' | highesttarball xz" | ||
53 | |||
54 | split_info_python3() | ||
55 | { | ||
56 | DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language." | ||
57 | } | ||
58 | |||
59 | split_info_python3-tests() | ||
60 | { | ||
61 | DESCRIPTION="Python regression test packages." | ||
62 | DEPEND="== ${PCAT}/python3-${PVER}" | ||
63 | } | ||
64 | |||
65 | src_prepare() | ||
66 | { | ||
67 | munpack ${SRCFILE} || die | ||
68 | |||
69 | # ensure to use system-wide copies of expat, libmpdec and libffi | ||
70 | # rather than copies shipped in the tarball | ||
71 | all-abis 'rm -r Modules/expat || die' | ||
72 | all-abis 'rm -r Modules/_ctypes/{darwin,libffi}* || die' | ||
73 | #all-abis 'rm -r Modules/_decimal/libmpdec || die' | ||
74 | } | ||
75 | |||
76 | src_compile() | ||
77 | { | ||
78 | mconfigure \ | ||
79 | --enable-shared \ | ||
80 | --enable-ipv6 \ | ||
81 | --infodir=/usr/share/info \ | ||
82 | --mandir=/usr/share/man \ | ||
83 | --with-threads \ | ||
84 | --with-computed-gotos \ | ||
85 | --with-system-expat \ | ||
86 | --with-system-ffi \ | ||
87 | --enable-optimizations \ | ||
88 | --with-platlibdir='$(mlibdir)' \ | ||
89 | || die | ||
90 | |||
91 | # disabled some modules (gdbm dbm bsddb _tkinter) | ||
92 | all-abis 'echo "MODULE__GDBM_STATE=disabled" >> Makefile || die' | ||
93 | all-abis 'echo "MODULE__DBM_STATE=disabled" >> Makefile || die' | ||
94 | all-abis 'echo "MODULE__TKINTER_STATE=disabled" >> Makefile || die' | ||
95 | |||
96 | mmake || die | ||
97 | } | ||
98 | |||
99 | src_install_python3() | ||
100 | { | ||
101 | # install some missing directories | ||
102 | minstalldir /usr || die | ||
103 | |||
104 | mmake -j1 DESTDIR=${BINDIR} altinstall || die | ||
105 | |||
106 | all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu || die | ||
107 | all-abis minstallfile Makefile.pre.in /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu || die | ||
108 | |||
109 | # remove hardcoded CFLAGS from default Makefile | ||
110 | all-abis sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu/Makefile || die | ||
111 | |||
112 | if [[ ${ARCH} = x86_64 ]] | ||
113 | then | ||
114 | # move config header | ||
115 | all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}/pyconfig-$(mabi).h || die | ||
116 | |||
117 | # install a stub header | ||
118 | cat > ${BINDIR}/usr/include/python${PVER%.*}/pyconfig.h << "EOF" | ||
119 | /* pyconfig.h - Stub Header */ | ||
120 | #ifndef __STUB__PYCONFIG_H__ | ||
121 | #define __STUB__PYCONFIG_H__ | ||
122 | |||
123 | #if defined(__x86_64__) || \ | ||
124 | defined(__sparc64__) || \ | ||
125 | defined(__arch64__) || \ | ||
126 | defined(__powerpc64__) || \ | ||
127 | defined (__s390x__) | ||
128 | # include "pyconfig-m64.h" | ||
129 | #else | ||
130 | # include "pyconfig-m32.h" | ||
131 | #endif | ||
132 | |||
133 | #endif /* __STUB__PYCONFIG_H__ */ | ||
134 | EOF | ||
135 | |||
136 | # install the multiarch-wrapper for python binaries | ||
137 | if [[ -f ${BINDIR}/usr/bin/python${PVER%.*} ]] | ||
138 | then | ||
139 | rm -f ${BINDIR}/usr/bin/python${PVER%.*} || die | ||
140 | fi | ||
141 | all-abis minstallexec python /usr/bin/python${PVER%.*}-$(mabi) || die | ||
142 | mlink multiarch-wrapper /usr/bin/python${PVER%.*} || die | ||
143 | # not our default python | ||
144 | #all-abis mlink python${PVER%.*} /usr/bin/python-$(mabi) || die | ||
145 | all-abis mlink python${PVER%.*}-$(mabi) /usr/bin/python${PVER:0:1}-$(mabi) || die | ||
146 | |||
147 | # install the multiarch-wrapper for python-config | ||
148 | if [[ -f ${BINDIR}/usr/bin/python${PVER%.*}-config ]] | ||
149 | then | ||
150 | rm -f ${BINDIR}/usr/bin/python${PVER%.*}-config || die | ||
151 | fi | ||
152 | all-abis minstallexec python-config /usr/bin/python${PVER%.*}-config-$(mabi) || die | ||
153 | mlink multiarch-wrapper /usr/bin/python${PVER%.*}-config || die | ||
154 | # not our default python | ||
155 | #all-abis mlink python${PVER%.*}-config /usr/bin/python-config-$(mabi) || die | ||
156 | all-abis mlink python${PVER%.*}-config-$(mabi) /usr/bin/python${PVER:0:1}-config-$(mabi) || die | ||
157 | fi | ||
158 | |||
159 | # not our default python | ||
160 | # # link python3.x-config to python-config | ||
161 | # mlink python${PVER%.*}-config /usr/bin/python-config || die | ||
162 | |||
163 | # link python3.x-config to python3-config | ||
164 | mlink python${PVER%.*}-config /usr/bin/python${PVER:0:1}-config || die | ||
165 | |||
166 | # not our default python | ||
167 | # # link python3.x binary with python | ||
168 | # mlink python${PVER%.*} /usr/bin/python || die | ||
169 | |||
170 | # link python3.x binary with python3 | ||
171 | mlink python${PVER%.*} /usr/bin/python${PVER:0:1} || die | ||
172 | |||
173 | # link pydoc3.x, 2to3-3.x and idle3.x too | ||
174 | mlink pydoc${PVER%.*} /usr/bin/pydoc${PVER:0:1} || die | ||
175 | mlink 2to3-${PVER%.*} /usr/bin/2to3-${PVER:0:1} || die | ||
176 | mlink idle${PVER%.*} /usr/bin/idle${PVER:0:1} || die | ||
177 | |||
178 | minstalldocs LICENSE README || die | ||
179 | |||
180 | # remove all regression test packages to save alot of space (>200MB) | ||
181 | all-abis mdelete -r /usr/'$(mlibdir)'/python${PVER%.*}/ctypes/test || die | ||
182 | all-abis mdelete -r /usr/'$(mlibdir)'/python${PVER%.*}/distutils/tests || die | ||
183 | all-abis mdelete -r /usr/'$(mlibdir)'/python${PVER%.*}/idlelib/idle_test || die | ||
184 | all-abis mdelete -r /usr/'$(mlibdir)'/python${PVER%.*}/lib2to3/tests || die | ||
185 | all-abis mdelete -r /usr/'$(mlibdir)'/python${PVER%.*}/tkinter/test || die | ||
186 | all-abis mdelete -r /usr/'$(mlibdir)'/python${PVER%.*}/unittest/test || die | ||
187 | # just keep support directory | ||
188 | all-abis zapmost ${BINDIR}/usr/'$(mlibdir)'/python${PVER%.*}/test support || die | ||
189 | } | ||
190 | |||
191 | src_install_python3-tests() | ||
192 | { | ||
193 | mmake -j1 DESTDIR=${BINDIR} libinstall || die | ||
194 | |||
195 | # keep all tests | ||
196 | zapmost ${BINDIR} \ | ||
197 | usr/$(mlibdir)/python${PVER%.*}/test \ | ||
198 | usr/$(mlibdir)/python${PVER%.*}/ctypes/test \ | ||
199 | usr/$(mlibdir)/python${PVER%.*}/distutils/tests \ | ||
200 | usr/$(mlibdir)/python${PVER%.*}/idlelib/idle_test \ | ||
201 | usr/$(mlibdir)/python${PVER%.*}/lib2to3/tests \ | ||
202 | usr/$(mlibdir)/python${PVER%.*}/tkinter/test \ | ||
203 | usr/$(mlibdir)/python${PVER%.*}/unittest/test \ | ||
204 | \ | ||
205 | $([[ $(MABI=m32 mlibdir) != lib ]] && echo "usr/$(MABI=m32 mlibdir)/python${PVER%.*}/test") \ | ||
206 | $([[ $(MABI=m32 mlibdir) != lib ]] && echo "usr/$(MABI=m32 mlibdir)/python${PVER%.*}/ctypes/test") \ | ||
207 | $([[ $(MABI=m32 mlibdir) != lib ]] && echo "usr/$(MABI=m32 mlibdir)/python${PVER%.*}/distutils/tests") \ | ||
208 | $([[ $(MABI=m32 mlibdir) != lib ]] && echo "usr/$(MABI=m32 mlibdir)/python${PVER%.*}/idlelib/idle_test") \ | ||
209 | $([[ $(MABI=m32 mlibdir) != lib ]] && echo "usr/$(MABI=m32 mlibdir)/python${PVER%.*}/lib2to3/tests") \ | ||
210 | $([[ $(MABI=m32 mlibdir) != lib ]] && echo "usr/$(MABI=m32 mlibdir)/python${PVER%.*}/tkinter/test") \ | ||
211 | $([[ $(MABI=m32 mlibdir) != lib ]] && echo "usr/$(MABI=m32 mlibdir)/python${PVER%.*}/unittest/test") \ | ||
212 | \ | ||
213 | $([[ $(MABI=m64 mlibdir) != lib ]] && echo "usr/$(MABI=m64 mlibdir)/python${PVER%.*}/test") \ | ||
214 | $([[ $(MABI=m64 mlibdir) != lib ]] && echo "usr/$(MABI=m64 mlibdir)/python${PVER%.*}/ctypes/test") \ | ||
215 | $([[ $(MABI=m64 mlibdir) != lib ]] && echo "usr/$(MABI=m64 mlibdir)/python${PVER%.*}/distutils/tests") \ | ||
216 | $([[ $(MABI=m64 mlibdir) != lib ]] && echo "usr/$(MABI=m64 mlibdir)/python${PVER%.*}/idlelib/idle_test") \ | ||
217 | $([[ $(MABI=m64 mlibdir) != lib ]] && echo "usr/$(MABI=m64 mlibdir)/python${PVER%.*}/lib2to3/tests") \ | ||
218 | $([[ $(MABI=m64 mlibdir) != lib ]] && echo "usr/$(MABI=m64 mlibdir)/python${PVER%.*}/tkinter/test") \ | ||
219 | $([[ $(MABI=m64 mlibdir) != lib ]] && echo "usr/$(MABI=m64 mlibdir)/python${PVER%.*}/unittest/test") \ | ||
220 | || die | ||
221 | |||
222 | # remove the test/support directory proved by python itself | ||
223 | all-abis mdelete -r /usr/'$(mlibdir)'/python${PVER%.*}/test/support || die | ||
224 | } |