Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/python:master commit in: dev-lang/python/
Date: Fri, 27 Dec 2019 21:16:37
Message-Id: 1577464915.626238f3310229684c030f1248c62a3e09f0b5ef.mgorny@gentoo
1 commit: 626238f3310229684c030f1248c62a3e09f0b5ef
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 27 15:58:41 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 27 16:41:55 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/python.git/commit/?id=626238f3
7
8 dev-lang/python: Bump 3.5.9 to EAPI 7
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-lang/python/python-3.5.9.ebuild | 139 +++++++++++++++++-------------------
13 1 file changed, 67 insertions(+), 72 deletions(-)
14
15 diff --git a/dev-lang/python/python-3.5.9.ebuild b/dev-lang/python/python-3.5.9.ebuild
16 index 931cccc..c2ffba6 100644
17 --- a/dev-lang/python/python-3.5.9.ebuild
18 +++ b/dev-lang/python/python-3.5.9.ebuild
19 @@ -1,23 +1,25 @@
20 # Copyright 1999-2019 Gentoo Authors
21 # Distributed under the terms of the GNU General Public License v2
22
23 -EAPI="5"
24 +EAPI="7"
25 WANT_LIBTOOL="none"
26
27 -inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
28 +inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs
29
30 -MY_P="Python-${PV/_/}"
31 +MY_P="Python-${PV}"
32 +PYVER=$(ver_cut 1-2)
33 PATCHSET_VERSION="3.5.4-0"
34
35 DESCRIPTION="An interpreted, interactive, object-oriented programming language"
36 HOMEPAGE="https://www.python.org/"
37 -SRC_URI="https://www.python.org/ftp/python/${PV%_rc*}/${MY_P}.tar.xz
38 +SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
39 https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
40 +S="${WORKDIR}/${MY_P}"
41
42 LICENSE="PSF-2"
43 -SLOT="3.5/3.5m"
44 +SLOT="${PYVER}/${PYVER}m"
45 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
46 -IUSE="bluetooth build elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
47 +IUSE="bluetooth build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
48 RESTRICT="!test? ( test )"
49
50 # Do not add a dependency on dev-lang/python to this ebuild.
51 @@ -25,57 +27,51 @@ RESTRICT="!test? ( test )"
52 # run the bootstrap code on your dev box and include the results in the
53 # patchset. See bug 447752.
54
55 -RDEPEND="app-arch/bzip2:0=
56 - app-arch/xz-utils:0=
57 - >=sys-libs/zlib-1.1.3:0=
58 +RDEPEND="app-arch/bzip2:=
59 + app-arch/xz-utils:=
60 + >=sys-libs/zlib-1.1.3:=
61 virtual/libffi:=
62 virtual/libintl
63 - gdbm? ( sys-libs/gdbm:0=[berkdb] )
64 - ncurses? ( >=sys-libs/ncurses-5.2:0= )
65 - readline? ( >=sys-libs/readline-4.1:0= )
66 + gdbm? ( sys-libs/gdbm:=[berkdb] )
67 + ncurses? ( >=sys-libs/ncurses-5.2:= )
68 + readline? ( >=sys-libs/readline-4.1:= )
69 sqlite? ( >=dev-db/sqlite-3.3.8:3= )
70 ssl? (
71 - !libressl? ( dev-libs/openssl:0= )
72 - libressl? ( dev-libs/libressl:0= )
73 + !libressl? ( dev-libs/openssl:= )
74 + libressl? ( dev-libs/libressl:= )
75 )
76 tk? (
77 - >=dev-lang/tcl-8.0:0=
78 - >=dev-lang/tk-8.0:0=
79 - dev-tcltk/blt:0=
80 + >=dev-lang/tcl-8.0:=
81 + >=dev-lang/tk-8.0:=
82 + dev-tcltk/blt:=
83 dev-tcltk/tix
84 )
85 - xml? ( >=dev-libs/expat-2.1:0= )"
86 + xml? ( >=dev-libs/expat-2.1:= )"
87 # bluetooth requires headers from bluez
88 DEPEND="${RDEPEND}
89 bluetooth? ( net-wireless/bluez )
90 + test? ( app-arch/xz-utils[extra-filters(+)] )
91 virtual/pkgconfig
92 !sys-devel/gcc[libffi(-)]"
93 RDEPEND+=" !build? ( app-misc/mime-types )"
94 PDEPEND=">=app-eselect/eselect-python-20140125-r1"
95
96 -S="${WORKDIR}/${MY_P}"
97 -
98 -PYVER=${SLOT%/*}
99 -
100 src_prepare() {
101 # Ensure that internal copies of expat, libffi and zlib are not used.
102 - rm -fr Modules/expat
103 - rm -fr Modules/_ctypes/libffi*
104 - rm -fr Modules/zlib
105 + rm -fr Modules/expat || die
106 + rm -fr Modules/_ctypes/libffi* || die
107 + rm -fr Modules/zlib || die
108
109 - if tc-is-cross-compiler; then
110 - # Invokes BUILDPYTHON, which is built for the host arch
111 - local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
112 - fi
113 + eapply -p0 "${WORKDIR}"/patches
114
115 - EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
116 - epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
117 - epatch "${FILESDIR}/${PN}-3.5-distutils-OO-build.patch"
118 - epatch "${FILESDIR}/3.6-disable-nis.patch"
119 -# epatch "${FILESDIR}/python-3.5.5-libressl-compatibility.patch"
120 - epatch "${FILESDIR}/python-3.5.5-hash-unaligned.patch"
121 + local PATCHES=(
122 + "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
123 + "${FILESDIR}/${PN}-3.5-distutils-OO-build.patch"
124 + "${FILESDIR}/3.6-disable-nis.patch"
125 + "${FILESDIR}/python-3.5.5-hash-unaligned.patch"
126 + )
127
128 - epatch_user
129 + default
130
131 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
132 configure.ac \
133 @@ -96,13 +92,13 @@ src_configure() {
134 local disable
135 # disable automagic bluetooth headers detection
136 use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
137 - use gdbm || disable+=" gdbm"
138 - use ncurses || disable+=" _curses _curses_panel"
139 - use readline || disable+=" readline"
140 - use sqlite || disable+=" _sqlite3"
141 - use ssl || export PYTHON_DISABLE_SSL="1"
142 - use tk || disable+=" _tkinter"
143 - use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
144 + use gdbm || disable+=" gdbm"
145 + use ncurses || disable+=" _curses _curses_panel"
146 + use readline || disable+=" readline"
147 + use sqlite || disable+=" _sqlite3"
148 + use ssl || export PYTHON_DISABLE_SSL="1"
149 + use tk || disable+=" _tkinter"
150 + use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat.
151 export PYTHON_DISABLE_MODULES="${disable}"
152
153 if ! use xml; then
154 @@ -144,10 +140,6 @@ src_configure() {
155 dbmliborder+="${dbmliborder:+:}gdbm"
156 fi
157
158 - BUILD_DIR="${WORKDIR}/${CHOST}"
159 - mkdir -p "${BUILD_DIR}" || die
160 - cd "${BUILD_DIR}" || die
161 -
162 local myeconfargs=(
163 --with-fpectl
164 --enable-shared
165 @@ -164,7 +156,7 @@ src_configure() {
166 --with-system-ffi
167 )
168
169 - ECONF_SOURCE="${S}" OPT="" econf "${myeconfargs[@]}"
170 + OPT="" econf "${myeconfargs[@]}"
171
172 if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
173 eerror "configure has detected that the sem_open function is broken."
174 @@ -178,8 +170,6 @@ src_compile() {
175 # https://bugs.gentoo.org/594768
176 local -x LC_ALL=C
177
178 - cd "${BUILD_DIR}" || die
179 -
180 emake CPPFLAGS= CFLAGS= LDFLAGS=
181
182 # Work around bug 329499. See also bug 413751 and 457194.
183 @@ -197,8 +187,6 @@ src_test() {
184 return
185 fi
186
187 - cd "${BUILD_DIR}" || die
188 -
189 # Skip failing tests.
190 local skipped_tests="gdb"
191
192 @@ -206,7 +194,11 @@ src_test() {
193 mv "${S}"/Lib/test/test_${test}.py "${T}"
194 done
195
196 + # bug 660358
197 + local -x COLUMNS=80
198 +
199 local -x PYTHONDONTWRITEBYTECODE=
200 +
201 emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
202 local result=$?
203
204 @@ -231,23 +223,24 @@ src_test() {
205 src_install() {
206 local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
207
208 - cd "${BUILD_DIR}" || die
209 -
210 emake DESTDIR="${D}" altinstall
211
212 + # Remove static library
213 + rm "${ED}"/usr/$(get_libdir)/libpython*.a || die
214 +
215 sed \
216 -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \
217 -e "s/\(PY_LDFLAGS=\).*/\1/" \
218 -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed"
219
220 # Fix collisions between different slots of Python.
221 - rm -f "${ED}usr/$(get_libdir)/libpython3.so"
222 + rm "${ED}/usr/$(get_libdir)/libpython3.so" || die
223
224 # Cheap hack to get version with ABIFLAGS
225 - local abiver=$(cd "${ED}usr/include"; echo python*)
226 + local abiver=$(cd "${ED}/usr/include"; echo python*)
227 if [[ ${abiver} != python${PYVER} ]]; then
228 # Replace python3.X with a symlink to python3.Xm
229 - rm "${ED}usr/bin/python${PYVER}" || die
230 + rm "${ED}/usr/bin/python${PYVER}" || die
231 dosym "${abiver}" "/usr/bin/python${PYVER}"
232 # Create python3.X-config symlink
233 dosym "${abiver}-config" "/usr/bin/python${PYVER}-config"
234 @@ -258,24 +251,23 @@ src_install() {
235 # python seems to get rebuilt in src_install (bug 569908)
236 # Work around it for now.
237 if has_version dev-libs/libffi[pax_kernel]; then
238 - pax-mark E "${ED}usr/bin/${abiver}"
239 + pax-mark E "${ED}/usr/bin/${abiver}"
240 else
241 - pax-mark m "${ED}usr/bin/${abiver}"
242 + pax-mark m "${ED}/usr/bin/${abiver}"
243 fi
244
245 - use elibc_uclibc && rm -fr "${libdir}/test"
246 - use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
247 - use tk || rm -fr "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
248 + use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
249 + use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
250
251 - use threads || rm -fr "${libdir}/multiprocessing"
252 - use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
253 + use threads || rm -r "${libdir}/multiprocessing" || die
254 + use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
255
256 - dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
257 + dodoc Misc/{ACKS,HISTORY,NEWS}
258
259 if use examples; then
260 docinto examples
261 - find "${S}"/Tools -name __pycache__ -print0 | xargs -0 rm -fr
262 - dodoc -r "${S}"/Tools
263 + find Tools -name __pycache__ -exec rm -fr {} + || die
264 + dodoc -r Tools
265 fi
266 insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
267 local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
268 @@ -287,7 +279,8 @@ src_install() {
269 sed \
270 -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \
271 -e "s:@PYDOC@:pydoc${PYVER}:" \
272 - -i "${ED}etc/conf.d/pydoc-${PYVER}" "${ED}etc/init.d/pydoc-${PYVER}" || die "sed failed"
273 + -i "${ED}/etc/conf.d/pydoc-${PYVER}" \
274 + "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed"
275
276 # for python-exec
277 local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
278 @@ -310,8 +303,7 @@ src_install() {
279 # python and pythonX
280 ln -s "../../../bin/${abiver}" \
281 "${D}${PYTHON_SCRIPTDIR}/python${pymajor}" || die
282 - ln -s "python${pymajor}" \
283 - "${D}${PYTHON_SCRIPTDIR}/python" || die
284 + ln -s "python${pymajor}" "${D}${PYTHON_SCRIPTDIR}/python" || die
285 # python-config and pythonX-config
286 # note: we need to create a wrapper rather than symlinking it due
287 # to some random dirname(argv[0]) magic performed by python-config
288 @@ -343,11 +335,14 @@ pkg_preinst() {
289 }
290
291 eselect_python_update() {
292 - if [[ -z "$(eselect python show)" || ! -f "${EROOT}usr/bin/$(eselect python show)" ]]; then
293 + if [[ -z "$(eselect python show)" || \
294 + ! -f "${EROOT}/usr/bin/$(eselect python show)" ]]; then
295 eselect python update
296 fi
297
298 - if [[ -z "$(eselect python show --python${PV%%.*})" || ! -f "${EROOT}usr/bin/$(eselect python show --python${PV%%.*})" ]]; then
299 + if [[ -z "$(eselect python show --python${PV%%.*})" || \
300 + ! -f "${EROOT}/usr/bin/$(eselect python show --python${PV%%.*})" ]]
301 + then
302 eselect python update --python${PV%%.*}
303 fi
304 }