1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

textproc/py-sphinx-book-theme: 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.
This commit is contained in:
Po-Chuan Hsieh 2024-09-09 02:21:30 +08:00
parent 103cdb9f4e
commit fc67766bba
No known key found for this signature in database
GPG Key ID: 9A4BD10F002DD04B
4 changed files with 15 additions and 138 deletions

View File

@ -1,10 +1,10 @@
PORTNAME= sphinx-book-theme
PORTVERSION= 1.1.3
PORTREVISION= 1
CATEGORIES= textproc python
MASTER_SITES= PYPI \
LOCAL/sunpoet:static
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
#DISTNAME= sphinx_book_theme-${PORTVERSION}
DISTFILES= sphinx_book_theme-${PORTVERSION}${EXTRACT_SUFX} \
sphinx_book_theme-${PORTVERSION}-static${EXTRACT_SUFX}:static
@ -16,17 +16,18 @@ WWW= https://sphinx-book-theme.readthedocs.io/en/stable/ \
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}flit-core>=3.9.0:devel/py-flit-core@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pydata-sphinx-theme>=0.15.2:textproc/py-pydata-sphinx-theme@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}sphinx>=5,1:textproc/py-sphinx@${PY_FLAVOR} \
USES= python:3.9+
USE_PYTHON= autoplist concurrent distutils
USE_PYTHON= autoplist concurrent pep517
NO_ARCH= yes
WRKSRC= ${WRKDIR}/sphinx_book_theme-${PORTVERSION}
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}/sphinx_book_theme/

View File

@ -0,0 +1,11 @@
--- pyproject.toml.orig 2024-06-12 14:08:03 UTC
+++ pyproject.toml
@@ -1,6 +1,6 @@
[build-system]
-requires = ["sphinx-theme-builder >= 0.2.0a7"]
-build-backend = "sphinx_theme_builder"
+requires = ["flit-core >= 3.9.0"]
+build-backend = "flit_core.buildapi"
[tool.sphinx-theme-builder]
node-version = "16.13.2"

View File

@ -1,69 +0,0 @@
from setuptools import setup
setup(
name = 'sphinx-book-theme',
version = '%%PORTVERSION%%',
description = 'A clean book theme for scientific explanations and documentation with Sphinx',
maintainer = 'Executable Books Team',
maintainer_email = 'executablebooks@gmail.com',
url = None,
packages = [
'sphinx_book_theme',
'sphinx_book_theme.header_buttons',
],
package_dir = {'': 'src'},
package_data = {'': ['*']},
install_requires = [
'sphinx>=5',
'pydata-sphinx-theme>=0.15.2',
],
extras_require = {
'code_style': [
'pre-commit'
],
'doc': [
'ablog',
'ipywidgets',
'folium',
'numpy',
'matplotlib',
'numpydoc',
'myst-nb',
'nbclient',
'pandas',
'plotly',
'sphinx-design',
'sphinx-examples',
'sphinx-copybutton',
'sphinx-tabs'
'sphinx-togglebutton',
'sphinx-thebe',
'sphinxcontrib-bibtex',
'sphinxcontrib-youtube',
'sphinxext-opengraph',
],
'test': [
'beautifulsoup4',
'coverage',
'defusedxml',
'myst-nb',
'pytest',
'pytest-cov',
'pytest-regressions',
'sphinx_thebe',
],
},
entry_points = {
'sphinx.html_themes': ['sphinx_book_theme = sphinx_book_theme'],
},
classifiers = [
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 3',
'Framework :: Sphinx',
'Framework :: Sphinx :: Theme',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
],
license = 'BSD License',
python_requires = '>= 3.9',
)

View File

@ -1,67 +1,3 @@
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/scripts/index.js
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/abstracts/_mixins.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/abstracts/_variables.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/base/_base.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/base/_print.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/base/_typography.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/components/_back-to-top.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/components/_icon-links.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/components/_logo.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/components/_search.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/content/_code.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/content/_images.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/content/_margin.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/content/_notebooks.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/content/_quotes.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/extensions/_comments.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/extensions/_thebe.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/index.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/sections/_announcement.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/sections/_article-container.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/sections/_article.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/sections/_footer-article.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/sections/_footer-content.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/sections/_header-article.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/sections/_header-primary.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/sections/_sidebar-primary.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/styles/sections/_sidebar-secondary.scss
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/README.md
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/By the.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/By.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Contents.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Copyright.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Download notebook file.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Download source file.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Download this page.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Edit this page.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Fullscreen mode.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Last updated on.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Launch.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Open an issue.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Print to PDF.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Source repository.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Sphinx Book Theme.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Theme by the.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/Toggle navigation.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/next page.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/open issue.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/previous page.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/repository.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/assets/translations/jsons/suggest edit.json
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/components/article-header-buttons.html
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/components/author.html
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/components/extra-footer.html
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/components/page-toc.html
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/components/sbt-sidebar-nav.html
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/components/toggle-primary-sidebar.html
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/components/toggle-secondary-sidebar.html
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/layout.html
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/macros/buttons.html
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/sections/footer-content.html
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/images/logo_binder.svg
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/images/logo_colab.png
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/images/logo_deepnote.svg
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/images/logo_jupyterhub.svg
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/locales/ar/LC_MESSAGES/booktheme.mo
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/locales/ar/LC_MESSAGES/booktheme.po
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/locales/bg/LC_MESSAGES/booktheme.mo
@ -152,9 +88,7 @@
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/locales/zh_CN/LC_MESSAGES/booktheme.po
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/locales/zh_TW/LC_MESSAGES/booktheme.mo
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/locales/zh_TW/LC_MESSAGES/booktheme.po
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/sbt-webpack-macros.html
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/scripts/sphinx-book-theme.js
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/scripts/sphinx-book-theme.js.map
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/styles/sphinx-book-theme.css
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/static/styles/sphinx-book-theme.css.map
%%PYTHON_SITELIBDIR%%/sphinx_book_theme/theme/sphinx_book_theme/theme.conf