git: e0d3db201b5f - main - x11-toolkits/py-tktreectrl: Convert to USE_PYTHON=pep517

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sat, 23 Mar 2024 15:02:32 UTC
The branch main has been updated by sunpoet:

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

commit e0d3db201b5f36cdd13e0522eb642ca083650457
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2024-03-23 14:23:55 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-03-23 14:49:41 +0000

    x11-toolkits/py-tktreectrl: Convert to USE_PYTHON=pep517
    
    - Bump PORTREVISION for package change
---
 x11-toolkits/py-tktreectrl/Makefile                        |  8 +++++++-
 .../py-tktreectrl/files/patch-TkTreectrl-__init__.py       | 11 +++++++++++
 x11-toolkits/py-tktreectrl/files/patch-setup.py            | 14 ++++++++++++++
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/x11-toolkits/py-tktreectrl/Makefile b/x11-toolkits/py-tktreectrl/Makefile
index 0109ec97a94e..a195b8bb7641 100644
--- a/x11-toolkits/py-tktreectrl/Makefile
+++ b/x11-toolkits/py-tktreectrl/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	tktreectrl
 PORTVERSION=	2.0.2
+PORTREVISION=	1
 CATEGORIES=	x11-toolkits tk python
 MASTER_SITES=	SF/tkintertreectrl/TkinterTreectrl-${PORTVERSION:R}/
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -12,13 +13,18 @@ WWW=		https://tkintertreectrl.sourceforge.net/
 LICENSE=	PD
 
 # x11-toolkits/tktreectrl does not provide libtreectrl.so
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
 LIB_DEPENDS=	libtreectrl.so.1:x11-toolkits/tktreectrl
 RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}Pmw>=0:x11-toolkits/py-Pmw@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}tkinter>=0:x11-toolkits/py-tkinter@${PY_FLAVOR}
 
 USES=		python tk:run zip
-USE_PYTHON=	autoplist concurrent distutils
+USE_PYTHON=	autoplist concurrent pep517
 
 NO_ARCH=	yes
 
+post-patch:
+	@${REINPLACE_CMD} -e 's|%%PORTVERSION%%|${PORTVERSION}|' ${WRKSRC}/setup.py ${WRKSRC}/TkTreectrl/__init__.py
+
 .include <bsd.port.mk>
diff --git a/x11-toolkits/py-tktreectrl/files/patch-TkTreectrl-__init__.py b/x11-toolkits/py-tktreectrl/files/patch-TkTreectrl-__init__.py
new file mode 100644
index 000000000000..39c2d8349986
--- /dev/null
+++ b/x11-toolkits/py-tktreectrl/files/patch-TkTreectrl-__init__.py
@@ -0,0 +1,11 @@
+--- TkTreectrl/__init__.py.orig	2012-11-20 20:15:04 UTC
++++ TkTreectrl/__init__.py
+@@ -13,7 +13,7 @@ Treectrl, MultiListbox, ScrolledTreectrl, ScrolledMult
+ 
+ Treectrl, MultiListbox, ScrolledTreectrl, ScrolledMultiListbox, ScrolledWidget
+ '''
+-__version__ = '2.0'
++__version__ = '%%PORTVERSION%%'
+ 
+ ABOVE = 'above'
+ ACTIVE = 'active'
diff --git a/x11-toolkits/py-tktreectrl/files/patch-setup.py b/x11-toolkits/py-tktreectrl/files/patch-setup.py
new file mode 100644
index 000000000000..019cb66d7ba6
--- /dev/null
+++ b/x11-toolkits/py-tktreectrl/files/patch-setup.py
@@ -0,0 +1,14 @@
+--- setup.py.orig	2013-05-06 09:00:53 UTC
++++ setup.py
+@@ -1,9 +1,9 @@ from distutils.core import setup
+ from distutils.core import setup
+ 
+-version = '2.0'
++version = '%%PORTVERSION%%'
+ 
+ setup(
+-    name="TkinterTreectrl",
++    name="tktreectrl",
+     version=version,
+     description="Tkinter wrapper for TkTreectrl",
+     author="Michael Lange",