Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15414 - (show annotations) (download)
Mon Aug 31 08:26:03 2020 UTC (3 years, 7 months ago) by niro
File size: 5202 byte(s)
-pruned old cruft
1 # $Id$
2
3 PNAME="python3"
4 PVER="3.8.3"
5 PBUILD="r1"
6
7 STATE="disabled"
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.2
19 >= sys-libs/zlib-1.2
20 >= dev-libs/expat-2
21 >= dev-libs/openssl-1.1
22 >= dev-db/db-6.2
23 >= dev-db/sqlite-3.32
24 >= app-arch/bzip2-1.0.8
25 >= dev-libs/libffi-3.3
26 >= app-arch/xz-utils-5.2"
27
28 # util-linux for linux32/64
29 SDEPEND=">= virtual/sed
30 >= sys-apps/util-linux-2.29.2
31 >= sys-libs/ncurses-dev-6.2
32 >= sys-libs/zlib-dev-1.2
33 >= dev-libs/expat-dev-2
34 >= dev-libs/openssl-dev-1.1
35 >= dev-db/db-dev-6.2
36 >= dev-libs/libffi-dev-3.2
37 >= app-arch/bzip2-dev-1.0.8
38 >= sys-apps/util-linux-dev-2.35
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 }