Annotation of /smage/trunk/extras/python3/python3-3.7.1-r1.smage2
Parent Directory | Revision Log
Revision 12911 -
(hide annotations)
(download)
Thu Nov 22 12:55:10 2018 UTC (5 years, 6 months ago) by niro
File size: 5134 byte(s)
Thu Nov 22 12:55:10 2018 UTC (5 years, 6 months ago) by niro
File size: 5134 byte(s)
auto added: ver bump to 3.7.1-r1
1 | niro | 12909 | # $Id$ |
2 | |||
3 | PNAME="python3" | ||
4 | PVER="3.7.1" | ||
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.2" | ||
25 | |||
26 | # util-linux for linux32/64 | ||
27 | SDEPEND=">= virtual/sed | ||
28 | >= sys-apps/util-linux-2.29.2 | ||
29 | >= sys-libs/ncurses-dev-6.0 | ||
30 | >= sys-libs/zlib-dev-1.2 | ||
31 | >= dev-libs/expat-dev-2 | ||
32 | >= dev-libs/openssl-dev-1.1 | ||
33 | >= dev-db/db-dev-6.2 | ||
34 | >= dev-libs/libffi-dev-3.2 | ||
35 | >= app-arch/bzip2-dev-1.0.6 | ||
36 | >= sys-apps/util-linux-dev-2.29.2" | ||
37 | |||
38 | SRCFILE="Python-${PVER/.0}.tar.xz" | ||
39 | SRCDIR="${BUILDDIR}/Python-${PVER/.0}" | ||
40 | |||
41 | # disabled modules (needs the disable_modules patch) | ||
42 | export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die | ||
43 | |||
44 | # force usage of our CFLAGS | ||
45 | export OPT="${CFLAGS}" | ||
46 | |||
47 | # optimized ABIFLAGS is set to m = malloc in our builds | ||
48 | export PYTHON_ABIFLAGS="m" | ||
49 | |||
50 | sminclude multilib mtools mbuild | ||
51 | msetfeature "!check" | ||
52 | |||
53 | # uses PYVER and sometimes PVER; so keep both | ||
54 | SRC_URI=( | ||
55 | http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE} | ||
56 | http://www.python.org/ftp/python/${PVER}/${SRCFILE} | ||
57 | mirror://python/${SRCFILE} | ||
58 | niro | 12910 | mirror://python/python-3.7.0-disable_modules_and_ssl.patch |
59 | niro | 12909 | mirror://python/python-2.5.0-mimetypes-apache.patch |
60 | niro | 12911 | mirror://python/python-3.7.1-lib64.patch |
61 | niro | 12909 | ) |
62 | |||
63 | # sed line: on 2 digits add an zero: 2.6 -> 2.6.0 | ||
64 | #UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'" | ||
65 | #UP2DATE="updatecmd -listonly https://www.python.org/downloads/ | grep '/releases/[0-9]' | sed 's:.*/releases/\(.*\)/:\1:' | upsort_pipe" | ||
66 | UP2DATE="updatecmd ${HOMEPAGE}/download/ | grep -- '-3\.' | highesttarball xz" | ||
67 | |||
68 | src_prepare() | ||
69 | { | ||
70 | munpack ${SRCFILE} || die | ||
71 | |||
72 | niro | 12910 | mpatch python-3.7.0-disable_modules_and_ssl.patch || die |
73 | niro | 12909 | mpatch python-2.5.0-mimetypes-apache.patch || die |
74 | |||
75 | niro | 12911 | only-m64 mpatch python-3.7.1-lib64.patch || die |
76 | niro | 12909 | |
77 | # ensure to use system-wide copies of expat, zlib and libffi | ||
78 | # rather than copies shipped in the tarball | ||
79 | all-abis 'rm -r Modules/expat || die' | ||
80 | all-abis 'rm -r Modules/zlib || die' | ||
81 | all-abis 'rm -r Modules/_ctypes/{darwin,libffi}* || die' | ||
82 | } | ||
83 | |||
84 | src_compile() | ||
85 | { | ||
86 | mconfigure \ | ||
87 | --enable-shared \ | ||
88 | --enable-ipv6 \ | ||
89 | --infodir=/usr/share/info \ | ||
90 | --mandir=/usr/share/man \ | ||
91 | --with-threads \ | ||
92 | --with-computed-gotos \ | ||
93 | --with-system-expat \ | ||
94 | --with-system-ffi \ | ||
95 | || die | ||
96 | |||
97 | mmake || die | ||
98 | } | ||
99 | |||
100 | src_install() | ||
101 | { | ||
102 | # install some missing directories | ||
103 | minstalldir /usr || die | ||
104 | |||
105 | mmake DESTDIR=${BINDIR} altinstall || die | ||
106 | |||
107 | all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}-'$(linux${ABI/m/} arch | sed "s:i.86:i386:")'-linux-gnu || die | ||
108 | 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 | ||
109 | |||
110 | # remove hardcoded CFLAGS from default Makefile | ||
111 | 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 | ||
112 | |||
113 | if [[ $(mlibdir) != lib ]] | ||
114 | then | ||
115 | # move config header | ||
116 | all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig-$(mabi).h || die | ||
117 | |||
118 | # install a stub header | ||
119 | cat > ${BINDIR}/usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig.h << "EOF" | ||
120 | /* pyconfig.h - Stub Header */ | ||
121 | #ifndef __STUB__PYCONFIG_H__ | ||
122 | #define __STUB__PYCONFIG_H__ | ||
123 | |||
124 | #if defined(__x86_64__) || \ | ||
125 | defined(__sparc64__) || \ | ||
126 | defined(__arch64__) || \ | ||
127 | defined(__powerpc64__) || \ | ||
128 | defined (__s390x__) | ||
129 | # include "pyconfig-m64.h" | ||
130 | #else | ||
131 | # include "pyconfig-m32.h" | ||
132 | #endif | ||
133 | |||
134 | #endif /* __STUB__PYCONFIG_H__ */ | ||
135 | EOF | ||
136 | # install the multiarch-wrapper | ||
137 | for exec in python${PVER%.*} python${PVER%.*}${PYTHON_ABIFLAGS} | ||
138 | do | ||
139 | if [[ -f ${BINDIR}/usr/bin/${exec} ]] | ||
140 | then | ||
141 | rm -f ${BINDIR}/usr/bin/${exec} || die | ||
142 | fi | ||
143 | all-abis minstallexec python /usr/bin/${exec}-$(mabi) || die | ||
144 | mlink multiarch-wrapper /usr/bin/${exec} || die | ||
145 | # not our default python | ||
146 | #all-abis mlink ${exec} /usr/bin/python-$(mabi) || die | ||
147 | all-abis mlink ${exec}-$(mabi) /usr/bin/${exec/${PVER%.*}/${PVER:0:1}}-$(mabi) || die | ||
148 | done | ||
149 | fi | ||
150 | |||
151 | # not our default python | ||
152 | # # link python3.3m-config to python-config | ||
153 | # mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python-config || die | ||
154 | |||
155 | # link python3.3m-config to python3.3-config | ||
156 | mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER%.*}-config || die | ||
157 | |||
158 | # link python3.3m-config to python3-config | ||
159 | mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER:0:1}-config || die | ||
160 | |||
161 | # not our default python | ||
162 | # # link python3.3 binary with python | ||
163 | # mlink python${PVER%.*} /usr/bin/python || die | ||
164 | |||
165 | # link python3.3 binary with python3 | ||
166 | mlink python${PVER%.*} /usr/bin/python${PVER:0:1} || die | ||
167 | |||
168 | minstalldocs LICENSE README || die | ||
169 | } |