Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15358 - (hide annotations) (download)
Thu Aug 27 12:59:44 2020 UTC (3 years, 8 months ago) by niro
File size: 5247 byte(s)
auto added: ver bump to 3.7.9-r1
1 niro 15358 # $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-libs/libffi-dev-3.2
36     >= app-arch/bzip2-dev-1.0.6
37     >= sys-apps/util-linux-dev-2.29.2
38     >= app-arch/xz-utils-dev-5.2"
39    
40     SRCFILE="Python-${PVER/.0}.tar.xz"
41     SRCDIR="${BUILDDIR}/Python-${PVER/.0}"
42    
43     # disabled modules (needs the disable_modules patch)
44     export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die
45    
46     # force usage of our CFLAGS
47     export OPT="${CFLAGS}"
48    
49     # optimized ABIFLAGS is set to m = malloc in our builds
50     export PYTHON_ABIFLAGS="m"
51    
52     sminclude multilib mtools mbuild
53     msetfeature "!check"
54    
55     # uses PYVER and sometimes PVER; so keep both
56     SRC_URI=(
57     http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE}
58     http://www.python.org/ftp/python/${PVER}/${SRCFILE}
59     mirror://python/${SRCFILE}
60     mirror://python/python-3.7.0-disable_modules_and_ssl.patch
61     mirror://python/python-2.5.0-mimetypes-apache.patch
62     mirror://python/python-3.7.1-lib64.patch
63     )
64    
65     # sed line: on 2 digits add an zero: 2.6 -> 2.6.0
66     #UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'"
67     #UP2DATE="updatecmd -listonly https://www.python.org/downloads/ | grep '/releases/[0-9]' | sed 's:.*/releases/\(.*\)/:\1:' | upsort_pipe"
68     UP2DATE="updatecmd ${HOMEPAGE}/download/ | grep -- '-3\.' | highesttarball xz"
69    
70     src_prepare()
71     {
72     munpack ${SRCFILE} || die
73    
74     mpatch python-3.7.0-disable_modules_and_ssl.patch || die
75     mpatch python-2.5.0-mimetypes-apache.patch || die
76    
77     only-m64 mpatch python-3.7.1-lib64.patch || die
78    
79     # ensure to use system-wide copies of expat, libmpdec and libffi
80     # rather than copies shipped in the tarball
81     all-abis 'rm -r Modules/expat || die'
82     all-abis 'rm -r Modules/_ctypes/{darwin,libffi}* || die'
83     all-abis 'rm -r Modules/_decimal/libmpdec || 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     }