git: 85c3d8fce457 - main - textproc/py-furo: Convert to USE_PYTHON=pep517

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 08 Sep 2024 18:45:40 UTC
The branch main has been updated by sunpoet:

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

commit 85c3d8fce45774b0bef77570016e59232d9bc5da
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2024-09-08 18:21:18 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-09-08 18:37:47 +0000

    textproc/py-furo: Convert to USE_PYTHON=pep517
    
    - Bump PORTREVISION for package change
    
    Upstream builds this port with sphinx-theme-builder. However, it does not work
    on FreeBSD yet since the nodeenv would try to download pre-built node.js binary
    executable which is unavailable for FreeBSD. Therefore, I use flit-core with
    pre-built static files instead.
---
 textproc/py-furo/Makefile                   |  6 ++-
 textproc/py-furo/files/patch-pyproject.toml | 20 +++++++++
 textproc/py-furo/files/setup.py             | 64 -----------------------------
 3 files changed, 24 insertions(+), 66 deletions(-)

diff --git a/textproc/py-furo/Makefile b/textproc/py-furo/Makefile
index 65c50eb76961..87880e65bbcb 100644
--- a/textproc/py-furo/Makefile
+++ b/textproc/py-furo/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	furo
 PORTVERSION=	2024.8.6
+PORTREVISION=	1
 CATEGORIES=	textproc python
 MASTER_SITES=	PYPI \
 		LOCAL/sunpoet:static
@@ -15,18 +16,19 @@ WWW=		https://pradyunsg.me/furo/ \
 LICENSE=	MIT
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}flit-core>=3.9.0:devel/py-flit-core@${PY_FLAVOR}
 RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}beautifulsoup>=0:www/py-beautifulsoup@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}pygments>=2.7:textproc/py-pygments@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}sphinx>=5.0,1<9.0,1:textproc/py-sphinx@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}sphinx-basic-ng>=1.0.0b2:textproc/py-sphinx-basic-ng@${PY_FLAVOR}
 
 USES=		python
-USE_PYTHON=	autoplist concurrent distutils
+USE_PYTHON=	autoplist concurrent pep517
 
 NO_ARCH=	yes
 
 post-patch:
-	@${SED} -e 's|%%PORTVERSION%%|${PORTVERSION}|' ${FILESDIR}/setup.py > ${WRKSRC}/setup.py
+	@${FIND} ${WRKSRC} -name .gitignore -delete
 
 post-install:
 	cd ${WRKDIR}/static/ && ${COPYTREE_SHARE} . ${STAGEDIR}${PYTHON_SITELIBDIR}/furo/theme/furo/static/
diff --git a/textproc/py-furo/files/patch-pyproject.toml b/textproc/py-furo/files/patch-pyproject.toml
new file mode 100644
index 000000000000..3b6bc146f138
--- /dev/null
+++ b/textproc/py-furo/files/patch-pyproject.toml
@@ -0,0 +1,20 @@
+--- pyproject.toml.orig	2024-07-24 09:09:51 UTC
++++ pyproject.toml
+@@ -1,6 +1,6 @@
+ [build-system]
+-requires = ["sphinx-theme-builder >= 0.2.0a10"]
+-build-backend = "sphinx_theme_builder"
++requires = ["flit-core >= 3.9.0"]
++build-backend = "flit_core.buildapi"
+ 
+ [tool.sphinx-theme-builder]
+ node-version = "18.16.0"
+@@ -15,7 +15,7 @@ dependencies = [
+ requires-python = ">=3.8"
+ dependencies = [
+   "beautifulsoup4",
+-  "sphinx >= 6.0,<9.0",
++  "sphinx >= 5.0,<9.0",
+   "sphinx-basic-ng >= 1.0.0.beta2",
+   "pygments >= 2.7",
+ ]
diff --git a/textproc/py-furo/files/setup.py b/textproc/py-furo/files/setup.py
deleted file mode 100644
index e06f11d12151..000000000000
--- a/textproc/py-furo/files/setup.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-# setup.py generated by flit for tools that don't yet use PEP 517
-
-from distutils.core import setup
-
-packages = \
-['furo']
-
-package_data = \
-{'': ['*'],
- 'furo': ['assets/*',
-          'assets/scripts/*',
-          'assets/styles/*',
-          'assets/styles/base/*',
-          'assets/styles/components/*',
-          'assets/styles/content/*',
-          'assets/styles/extensions/*',
-          'assets/styles/variables/*',
-          'theme/*',
-          'theme/furo/*',
-          'theme/furo/components/*',
-          'theme/furo/partials/*',
-          'theme/furo/sidebar/*',
-          'theme/furo/static/*']}
-
-package_dir = \
-{'': 'src'}
-
-install_requires = \
-['beautifulsoup4', 'sphinx >= 5.0,<9.0', 'sphinx-basic-ng >= 1.0.0.beta2', 'pygments >= 2.7']
-
-entry_points = \
-{'sphinx.html_themes': ['furo = furo']}
-
-setup(name='furo',
-      version='%%PORTVERSION%%',
-      description='A clean customisable Sphinx documentation theme.',
-      author=None,
-      author_email='Pradyun Gedam <mail@pradyunsg.me>',
-      classifiers=[
-          'Framework :: Sphinx',
-          'Framework :: Sphinx :: Theme',
-          'Development Status :: 5 - Production/Stable',
-          'License :: OSI Approved :: MIT License',
-          'Environment :: Web Environment',
-          'Intended Audience :: Developers',
-          'Programming Language :: Python :: 3',
-          'Programming Language :: Python :: 3.8',
-          'Programming Language :: Python :: 3.9',
-          'Programming Language :: Python :: 3.10',
-          'Programming Language :: Python :: 3.11',
-          'Programming Language :: Python :: 3.12',
-          'Operating System :: OS Independent',
-          'Topic :: Documentation',
-          'Topic :: Software Development :: Documentation',
-      ],
-      url=None,
-      packages=packages,
-      package_data=package_data,
-      package_dir=package_dir,
-      install_requires=install_requires,
-      entry_points=entry_points,
-      python_requires='>=3.8',
-     )