Magellan Linux

Contents of /smage/trunk/extras/python3/python3-3.7.9-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15359 - (show annotations) (download)
Fri Aug 28 06:12:29 2020 UTC (3 years, 8 months ago) by niro
File size: 5274 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, libmpdec 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 #all-abis 'rm -r Modules/_decimal/libmpdec || die'
85 }
86
87 src_compile()
88 {
89 mconfigure \
90 --enable-shared \
91 --enable-ipv6 \
92 --infodir=/usr/share/info \
93 --mandir=/usr/share/man \
94 --with-threads \
95 --with-computed-gotos \
96 --with-system-expat \
97 --with-system-ffi \
98 --enable-loadable-sqlite-extensions \
99 || die
100
101 mmake || die
102 }
103
104 src_install()
105 {
106 # install some missing directories
107 minstalldir /usr || die
108
109 mmake DESTDIR=${BINDIR} altinstall || die
110
111 all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu || die
112 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
113
114 # remove hardcoded CFLAGS from default Makefile
115 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
116
117 if [[ $(mlibdir) != lib ]]
118 then
119 # move config header
120 all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig-$(mabi).h || die
121
122 # install a stub header
123 cat > ${BINDIR}/usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig.h << "EOF"
124 /* pyconfig.h - Stub Header */
125 #ifndef __STUB__PYCONFIG_H__
126 #define __STUB__PYCONFIG_H__
127
128 #if defined(__x86_64__) || \
129 defined(__sparc64__) || \
130 defined(__arch64__) || \
131 defined(__powerpc64__) || \
132 defined (__s390x__)
133 # include "pyconfig-m64.h"
134 #else
135 # include "pyconfig-m32.h"
136 #endif
137
138 #endif /* __STUB__PYCONFIG_H__ */
139 EOF
140 # install the multiarch-wrapper
141 for exec in python${PVER%.*} python${PVER%.*}${PYTHON_ABIFLAGS}
142 do
143 if [[ -f ${BINDIR}/usr/bin/${exec} ]]
144 then
145 rm -f ${BINDIR}/usr/bin/${exec} || die
146 fi
147 all-abis minstallexec python /usr/bin/${exec}-$(mabi) || die
148 mlink multiarch-wrapper /usr/bin/${exec} || die
149 # not our default python
150 #all-abis mlink ${exec} /usr/bin/python-$(mabi) || die
151 all-abis mlink ${exec}-$(mabi) /usr/bin/${exec/${PVER%.*}/${PVER:0:1}}-$(mabi) || die
152 done
153 fi
154
155 # not our default python
156 # # link python3.3m-config to python-config
157 # mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python-config || die
158
159 # link python3.3m-config to python3.3-config
160 mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER%.*}-config || die
161
162 # link python3.3m-config to python3-config
163 mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER:0:1}-config || die
164
165 # not our default python
166 # # link python3.3 binary with python
167 # mlink python${PVER%.*} /usr/bin/python || die
168
169 # link python3.3 binary with python3
170 mlink python${PVER%.*} /usr/bin/python${PVER:0:1} || die
171
172 minstalldocs LICENSE README || die
173 }