git: 6af82314f7f4 - main - www/py-nicegui: New port: Create web-based user interfaces with Python

From: Jose Alonso Cardenas Marquez <acm_at_FreeBSD.org>
Date: Fri, 08 Nov 2024 02:33:11 UTC
The branch main has been updated by acm:

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

commit 6af82314f7f431c63cbcc37735e89f7cc47b79f8
Author:     Jesús Daniel Colmenares Oviedo <DtxdF@disroot.org>
AuthorDate: 2024-11-08 02:31:40 +0000
Commit:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
CommitDate: 2024-11-08 02:31:40 +0000

    www/py-nicegui: New port: Create web-based user interfaces with Python
    
    NiceGUI is an easy-to-use, Python-base UI framework, which shows
    up in your web browser. You can create buttons, dialogs, Markdown,
    3D scenes, plots and much more.
    
    WWW: https://nicegui.io/
    PR:             282460
---
 www/Makefile                              |  1 +
 www/py-nicegui/Makefile                   | 63 +++++++++++++++++++++++++++++++
 www/py-nicegui/distinfo                   |  3 ++
 www/py-nicegui/files/patch-pyproject.toml | 11 ++++++
 www/py-nicegui/pkg-descr                  |  3 ++
 5 files changed, 81 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index 6feb49a8df25..780e27f7a10e 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -1767,6 +1767,7 @@
     SUBDIR += py-mwoauth
     SUBDIR += py-nevow
     SUBDIR += py-nh3
+    SUBDIR += py-nicegui
     SUBDIR += py-notebook
     SUBDIR += py-onetimepass
     SUBDIR += py-openbrokerapi
diff --git a/www/py-nicegui/Makefile b/www/py-nicegui/Makefile
new file mode 100644
index 000000000000..4ef7d25ea0e4
--- /dev/null
+++ b/www/py-nicegui/Makefile
@@ -0,0 +1,63 @@
+PORTNAME=	nicegui
+DISTVERSION=	2.5.0
+CATEGORIES=	www graphics python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	DtxdF@disroot.org
+COMMENT?=	Create web-based user interfaces with Python
+WWW=		https://nicegui.io/
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}poetry-core>0:devel/py-poetry-core@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}aiofiles>=0:devel/py-aiofiles@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}aiohttp>=0:www/py-aiohttp@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}certifi>=0:security/py-certifi@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}docutils>=0:textproc/py-docutils@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}fastapi>=0:www/py-fastapi@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}httpx>=0:www/py-httpx@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}ifaddr>=0:net/py-ifaddr@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}itsdangerous>=0:security/py-itsdangerous@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}Jinja2>=0:devel/py-Jinja2@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}libsass>=0:www/py-libsass@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}markdown2>=0:textproc/py-markdown2@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}orjson>=0:devel/py-orjson@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pygments>=0:textproc/py-pygments@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}python-multipart>=0:www/py-python-multipart@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}python-socketio>=0:devel/py-python-socketio@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}requests>=0:www/py-requests@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typing-extensions>=0:devel/py-typing-extensions@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}urllib3>=0:net/py-urllib3@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}uvicorn>=0:www/py-uvicorn@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}vbuild>=0:textproc/py-vbuild@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}watchfiles>=0:devel/py-watchfiles@${PY_FLAVOR}
+
+USES=		python shebangfix
+USE_PYTHON=	autoplist pep517
+
+SHEBANG_FILES=	nicegui/scripts/pack.py
+
+CONFLICTS_INSTALL?=	www/py-nicegui-nogui
+
+NO_ARCH=	yes
+
+OPTIONS_DEFINE=			MATPLOTLIB PLOTLY
+OPTIONS_DEFAULT?=		MATPLOTLIB PLOTLY PYWEBVIEW_QT
+OPTIONS_RADIO=			PYWEBVIEW
+OPTIONS_RADIO_PYWEBVIEW=	PYWEBVIEW_GTK PYWEBVIEW_QT
+
+MATPLOTLIB_DESC=	Enable support for matplotlib
+PLOTLY_DESC=		Enable support for plotly
+PYWEBVIEW_DESC=		Enable support for native mode
+PYWEBVIEW_GTK_DESC=	Use GTK port
+PYWEBVIEW_QT_DESC=	Use QT port
+
+MATPLOTLIB_RUN_DEPENDS=		${PYTHON_PKGNAMEPREFIX}matplotlib>=0:math/py-matplotlib@${PY_FLAVOR}
+PLOTLY_RUN_DEPENDS=		${PYTHON_PKGNAMEPREFIX}plotly>=0:graphics/py-plotly@${PY_FLAVOR}
+PYWEBVIEW_GTK_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pywebview-gtk>=0:www/py-pywebview-gtk@${PY_FLAVOR}
+PYWEBVIEW_QT_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pywebview-qt>=0:www/py-pywebview-qt@${PY_FLAVOR}
+
+.include <bsd.port.mk>
diff --git a/www/py-nicegui/distinfo b/www/py-nicegui/distinfo
new file mode 100644
index 000000000000..d0c42536fea6
--- /dev/null
+++ b/www/py-nicegui/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1729887287
+SHA256 (nicegui-2.5.0.tar.gz) = e848e822dbf9be2c7cf50d27fbb180c096b135e6e1a817b30dd4a1b6aaac457c
+SIZE (nicegui-2.5.0.tar.gz) = 16051000
diff --git a/www/py-nicegui/files/patch-pyproject.toml b/www/py-nicegui/files/patch-pyproject.toml
new file mode 100644
index 000000000000..62dfe68b4047
--- /dev/null
+++ b/www/py-nicegui/files/patch-pyproject.toml
@@ -0,0 +1,11 @@
+--- pyproject.toml.orig	2024-10-25 21:10:42 UTC
++++ pyproject.toml
+@@ -69,7 +69,7 @@ requires = [
+ 
+ [build-system]
+ requires = [
+-    "setuptools>=30.3.0,<50",
++    "setuptools",
+     "poetry-core>=1.0.0"
+ ]
+ build-backend = "poetry.core.masonry.api"
diff --git a/www/py-nicegui/pkg-descr b/www/py-nicegui/pkg-descr
new file mode 100644
index 000000000000..fc645313ba9c
--- /dev/null
+++ b/www/py-nicegui/pkg-descr
@@ -0,0 +1,3 @@
+NiceGUI is an easy-to-use, Python-base UI framework, which shows
+up in your web browser. You can create buttons, dialogs, Markdown,
+3D scenes, plots and much more.