Diff python-3.5.7 with a python-3.6.5

/usr/portage/dev-lang/python/python-3.6.5.ebuild 2019-10-11 18:40:00.000000000 +0300
1 1
# Copyright 1999-2019 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI="5"
4
EAPI="6"
5 5
WANT_LIBTOOL="none"
6 6

  
7
inherit autotools eutils flag-o-matic multilib pax-utils python-utils-r1 toolchain-funcs
7
inherit autotools flag-o-matic pax-utils python-utils-r1 toolchain-funcs
8 8

  
9
MY_P="Python-${PV/_/}"
10
PATCHSET_VERSION="3.5.4-0"
9
MY_P="Python-${PV}"
10
PATCHSET_VERSION="3.6.4"
11 11

  
12 12
DESCRIPTION="An interpreted, interactive, object-oriented programming language"
13 13
HOMEPAGE="https://www.python.org/"
14
SRC_URI="https://www.python.org/ftp/python/${PV%_rc*}/${MY_P}.tar.xz
14
SRC_URI="https://www.python.org/ftp/python/${PV}/${MY_P}.tar.xz
15 15
	https://dev.gentoo.org/~floppym/python/python-gentoo-patches-${PATCHSET_VERSION}.tar.xz"
16 16

  
17 17
LICENSE="PSF-2"
18
SLOT="3.5/3.5m"
19
KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
20
IUSE="bluetooth build elibc_uclibc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
18
SLOT="3.6/3.6m"
19
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
20
IUSE="build examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl test +threads tk wininst +xml"
21 21
RESTRICT="!test? ( test )"
22 22

  
23 23
# Do not add a dependency on dev-lang/python to this ebuild.
......
46 46
	)
47 47
	xml? ( >=dev-libs/expat-2.1:0= )
48 48
	!!<sys-apps/sandbox-2.6-r1"
49
# bluetooth requires headers from bluez
50 49
DEPEND="${RDEPEND}
51
	bluetooth? ( net-wireless/bluez )
50
	test? ( app-arch/xz-utils[extra-filters(+)] )
52 51
	virtual/pkgconfig
53 52
	!sys-devel/gcc[libffi(-)]"
54 53
RDEPEND+=" !build? ( app-misc/mime-types )"
55 54
PDEPEND=">=app-eselect/eselect-python-20140125-r1"
56 55

  
57 56
S="${WORKDIR}/${MY_P}"
58

  
59 57
PYVER=${SLOT%/*}
60 58

  
61 59
src_prepare() {
......
64 62
	rm -fr Modules/_ctypes/libffi*
65 63
	rm -fr Modules/zlib
66 64

  
67
	if tc-is-cross-compiler; then
68
		# Invokes BUILDPYTHON, which is built for the host arch
69
		local EPATCH_EXCLUDE="*_regenerate_platform-specific_modules.patch"
70
	fi
71

  
72
	EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
73
	epatch "${FILESDIR}/${PN}-3.4.3-ncurses-pkg-config.patch"
74
	epatch "${FILESDIR}/${PN}-3.5-distutils-OO-build.patch"
75
	epatch "${FILESDIR}/3.6-disable-nis.patch"
76
#	epatch "${FILESDIR}/python-3.5.5-libressl-compatibility.patch"
77
	epatch "${FILESDIR}/python-3.5.5-hash-unaligned.patch"
65
	local PATCHES=(
66
		"${WORKDIR}/patches"
67
		"${FILESDIR}/${PN}-3.5-distutils-OO-build.patch"
68
		"${FILESDIR}/3.6.5-disable-nis.patch"
69
		"${FILESDIR}/python-3.6.5-libressl-compatibility.patch"
70
		"${FILESDIR}/python-3.6.5-hash-unaligned.patch"
71
	)
78 72

  
79
	epatch_user
73
	default
80 74

  
81 75
	sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \
82
		configure.ac \
83 76
		Lib/distutils/command/install.py \
84 77
		Lib/distutils/sysconfig.py \
85 78
		Lib/site.py \
86 79
		Lib/sysconfig.py \
87 80
		Lib/test/test_site.py \
88 81
		Makefile.pre.in \
89
		Modules/getpath.c \
90 82
		Modules/Setup.dist \
83
		Modules/getpath.c \
84
		configure.ac \
91 85
		setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@"
92 86

  
93 87
	eautoreconf
......
95 89

  
96 90
src_configure() {
97 91
	local disable
98
	# disable automagic bluetooth headers detection
99
	use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
100 92
	use gdbm     || disable+=" gdbm"
101 93
	use ncurses  || disable+=" _curses _curses_panel"
102 94
	use readline || disable+=" readline"
......
131 123
	# Export CXX so it ends up in /usr/lib/python3.X/config/Makefile.
132 124
	tc-export CXX
133 125

  
134
	# The configure script fails to use pkg-config correctly.
135
	# http://bugs.python.org/issue15506
136
	export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG)
137

  
138 126
	# Set LDFLAGS so we link modules with -lpython3.2 correctly.
139 127
	# Needed on FreeBSD unless Python 3.2 is already installed.
140 128
	# Please query BSD team before removing this!
......
145 133
		dbmliborder+="${dbmliborder:+:}gdbm"
146 134
	fi
147 135

  
148
	BUILD_DIR="${WORKDIR}/${CHOST}"
149
	mkdir -p "${BUILD_DIR}" || die
150
	cd "${BUILD_DIR}" || die
151

  
152 136
	local myeconfargs=(
153 137
		--with-fpectl
154 138
		--enable-shared
......
165 149
		--with-system-ffi
166 150
	)
167 151

  
168
	ECONF_SOURCE="${S}" OPT="" econf "${myeconfargs[@]}"
152
	OPT="" econf "${myeconfargs[@]}"
169 153

  
170 154
	if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
171 155
		eerror "configure has detected that the sem_open function is broken."
......
179 163
	# https://bugs.gentoo.org/594768
180 164
	local -x LC_ALL=C
181 165

  
182
	cd "${BUILD_DIR}" || die
183

  
184 166
	emake CPPFLAGS= CFLAGS= LDFLAGS=
185 167

  
186 168
	# Work around bug 329499. See also bug 413751 and 457194.
......
198 180
		return
199 181
	fi
200 182

  
201
	cd "${BUILD_DIR}" || die
202

  
203 183
	# Skip failing tests.
204 184
	local skipped_tests="gdb"
205 185

  
......
208 188
	done
209 189

  
210 190
	local -x PYTHONDONTWRITEBYTECODE=
191

  
211 192
	emake test EXTRATESTOPTS="-u-network" CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
212 193
	local result=$?
213 194

  
......
232 213
src_install() {
233 214
	local libdir=${ED}/usr/$(get_libdir)/python${PYVER}
234 215

  
235
	cd "${BUILD_DIR}" || die
236

  
237 216
	emake DESTDIR="${D}" altinstall
238 217

  
239 218
	sed \
......
264 243
		pax-mark m "${ED}usr/bin/${abiver}"
265 244
	fi
266 245

  
267
	use elibc_uclibc && rm -fr "${libdir}/test"
268
	use sqlite || rm -fr "${libdir}/"{sqlite3,test/test_sqlite*}
269
	use tk || rm -fr "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*}
246
	use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die
247
	use tk || rm -r "${ED}usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
270 248

  
271
	use threads || rm -fr "${libdir}/multiprocessing"
272
	use wininst || rm -f "${libdir}/distutils/command/"wininst-*.exe
249
	use threads || rm -r "${libdir}/multiprocessing" || die
250
	use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die
273 251

  
274 252
	dodoc "${S}"/Misc/{ACKS,HISTORY,NEWS}
275 253

  
Thank you!