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