git: 56f689af8ef6 - main - devel/py-backports.zoneinfo: unbreak build with py310+ (+)

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Sat, 25 Jun 2022 20:19:34 UTC
The branch main has been updated by fluffy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=56f689af8ef6afc1b39c764256031d7f12263366

commit 56f689af8ef6afc1b39c764256031d7f12263366
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2022-06-25 20:15:34 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2022-06-25 20:15:34 +0000

    devel/py-backports.zoneinfo: unbreak build with py310+ (+)
    
    We already have Python 3.7 as minimal supported release, so
    force #ifdef's for 3.7+ API as always positive to prevent use deprecated types
    
    While here, port upstream patch for MR#97 (https://github.com/pganssle/zoneinfo/pull/97)
    "Decrement the refcount of _PyLong_One in the correct branch"
---
 devel/py-backports.zoneinfo/Makefile                          |  5 ++++-
 .../py-backports.zoneinfo/files/patch-lib_zoneinfo__module.c  | 11 +++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/devel/py-backports.zoneinfo/Makefile b/devel/py-backports.zoneinfo/Makefile
index dc2706066f88..ce0138c1569b 100644
--- a/devel/py-backports.zoneinfo/Makefile
+++ b/devel/py-backports.zoneinfo/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	backports.zoneinfo
 DISTVERSION=	0.2.1
+PORTREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -10,7 +11,9 @@ COMMENT=	Backport of the standard library module zoneinfo
 LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-USES=		python:3.7-3.9
+USES=		python:3.7+
 USE_PYTHON=	autoplist concurrent distutils
+# We already have Python 3.7 as minimal supported release, force positive checks
+CFLAGS+=	-DATLEAST_37
 
 .include <bsd.port.mk>
diff --git a/devel/py-backports.zoneinfo/files/patch-lib_zoneinfo__module.c b/devel/py-backports.zoneinfo/files/patch-lib_zoneinfo__module.c
new file mode 100644
index 000000000000..876f36c8a3ab
--- /dev/null
+++ b/devel/py-backports.zoneinfo/files/patch-lib_zoneinfo__module.c
@@ -0,0 +1,11 @@
+--- lib/zoneinfo_module.c.orig	2020-06-23 13:47:53 UTC
++++ lib/zoneinfo_module.c
+@@ -617,7 +617,7 @@ zoneinfo_fromutc(PyObject *obj_self, PyObject *dt)
+             Py_DECREF(args);
+             Py_DECREF(kwargs);
+             Py_DECREF(replace);
+-#ifndef ATLEAST_37
++#ifdef ATLEAST_37
+             Py_DECREF(one);
+ #endif
+