Magellan Linux

Contents of /smage/trunk/extras/python3/python3-3.7.1-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 13804 - (show annotations) (download)
Fri Nov 1 09:54:28 2019 UTC (4 years, 5 months ago) by niro
File size: 5207 byte(s)
-use app-arch/xz-utils not virtual/xz-utils which are provided by busybox on alx
1 # $Id$
2
3 PNAME="python3"
4 PVER="3.7.1"
5 PBUILD="r3"
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.2
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 || die
98
99 mmake || die
100 }
101
102 src_install()
103 {
104 # install some missing directories
105 minstalldir /usr || die
106
107 mmake DESTDIR=${BINDIR} altinstall || die
108
109 all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu || die
110 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
111
112 # remove hardcoded CFLAGS from default Makefile
113 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
114
115 if [[ $(mlibdir) != lib ]]
116 then
117 # move config header
118 all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig-$(mabi).h || die
119
120 # install a stub header
121 cat > ${BINDIR}/usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig.h << "EOF"
122 /* pyconfig.h - Stub Header */
123 #ifndef __STUB__PYCONFIG_H__
124 #define __STUB__PYCONFIG_H__
125
126 #if defined(__x86_64__) || \
127 defined(__sparc64__) || \
128 defined(__arch64__) || \
129 defined(__powerpc64__) || \
130 defined (__s390x__)
131 # include "pyconfig-m64.h"
132 #else
133 # include "pyconfig-m32.h"
134 #endif
135
136 #endif /* __STUB__PYCONFIG_H__ */
137 EOF
138 # install the multiarch-wrapper
139 for exec in python${PVER%.*} python${PVER%.*}${PYTHON_ABIFLAGS}
140 do
141 if [[ -f ${BINDIR}/usr/bin/${exec} ]]
142 then
143 rm -f ${BINDIR}/usr/bin/${exec} || die
144 fi
145 all-abis minstallexec python /usr/bin/${exec}-$(mabi) || die
146 mlink multiarch-wrapper /usr/bin/${exec} || die
147 # not our default python
148 #all-abis mlink ${exec} /usr/bin/python-$(mabi) || die
149 all-abis mlink ${exec}-$(mabi) /usr/bin/${exec/${PVER%.*}/${PVER:0:1}}-$(mabi) || die
150 done
151 fi
152
153 # not our default python
154 # # link python3.3m-config to python-config
155 # mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python-config || die
156
157 # link python3.3m-config to python3.3-config
158 mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER%.*}-config || die
159
160 # link python3.3m-config to python3-config
161 mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER:0:1}-config || die
162
163 # not our default python
164 # # link python3.3 binary with python
165 # mlink python${PVER%.*} /usr/bin/python || die
166
167 # link python3.3 binary with python3
168 mlink python${PVER%.*} /usr/bin/python${PVER:0:1} || die
169
170 minstalldocs LICENSE README || die
171 }