commit:     87bc53fbc14cc579a8a58a4a65c72e7a99870fd4
Author:     Jakov Smolic <jakov.smolic <AT> sartura <DOT> hr>
AuthorDate: Wed Nov 18 18:57:49 2020 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Wed Nov 18 18:57:49 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87bc53fb

dev-python/line_profiler: add python3_9

Closes: https://github.com/gentoo/gentoo/pull/18312
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Jakov Smolic <jakov.smolic <AT> sartura.hr>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../files/line_profiler-3.0.2-python3_9.patch      | 35 ++++++++++++++++++++++
 .../line_profiler/line_profiler-3.0.2.ebuild       |  6 +++-
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/dev-python/line_profiler/files/line_profiler-3.0.2-python3_9.patch 
b/dev-python/line_profiler/files/line_profiler-3.0.2-python3_9.patch
new file mode 100644
index 00000000000..74b0677bc70
--- /dev/null
+++ b/dev-python/line_profiler/files/line_profiler-3.0.2-python3_9.patch
@@ -0,0 +1,35 @@
+From f40a6e102d3c4808155af601ddba7733e597e604 Mon Sep 17 00:00:00 2001
+From: Stefano Rivera <[email protected]>
+Date: Thu, 15 Oct 2020 22:44:50 -0700
+Subject: [PATCH] Python 3.9 dropped gettimeofday configure checks
+
+Upstream status: Accepted [https://github.com/pyutils/line_profiler/pull/31}
+Signed-off-by: Jakov Smolic <[email protected]>
+
+diff --git a/line_profiler/timers.c b/line_profiler/timers.c
+index ae01060..e8ee6c6 100644
+--- a/line_profiler/timers.c
++++ b/line_profiler/timers.c
+@@ -32,10 +32,6 @@ hpTimerUnit(void)
+ 
+ #else  /* !MS_WINDOWS */
+ 
+-#ifndef HAVE_GETTIMEOFDAY
+-#error "This module requires gettimeofday() on non-Windows platforms!"
+-#endif
+-
+ #if (defined(PYOS_OS2) && defined(PYCC_GCC))
+ #include <sys/time.h>
+ #else
+@@ -48,11 +44,7 @@ hpTimer(void)
+ {
+         struct timeval tv;
+         PY_LONG_LONG ret;
+-#ifdef GETTIMEOFDAY_NO_TZ
+-        gettimeofday(&tv);
+-#else
+         gettimeofday(&tv, (struct timezone *)NULL);
+-#endif
+         ret = tv.tv_sec;
+         ret = ret * 1000000 + tv.tv_usec;
+         return ret;

diff --git a/dev-python/line_profiler/line_profiler-3.0.2.ebuild 
b/dev-python/line_profiler/line_profiler-3.0.2.ebuild
index a48003e8777..5c557811592 100644
--- a/dev-python/line_profiler/line_profiler-3.0.2.ebuild
+++ b/dev-python/line_profiler/line_profiler-3.0.2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-PYTHON_COMPAT=( python3_{6,7,8} )
+PYTHON_COMPAT=( python3_{6..9} )
 
 DISTUTILS_USE_SETUPTOOLS=rdepend
 
@@ -26,6 +26,10 @@ DEPEND="test? (
        dev-python/coverage[${PYTHON_USEDEP}]
        dev-python/ubelt[${PYTHON_USEDEP}] )"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-python3_9.patch
+)
+
 distutils_enable_tests pytest
 
 python_test() {

Reply via email to