git: 9c479631884e - main - net-p2p/c-lightning: upgrade from 24.02.2 to 24.05

From: Vasil Dimov <vd_at_FreeBSD.org>
Date: Tue, 11 Jun 2024 17:16:42 UTC
The branch main has been updated by vd:

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

commit 9c479631884e33136a2bbaad45b8a924e90a12e7
Author:     Vasil Dimov <vd@FreeBSD.org>
AuthorDate: 2024-06-11 17:16:08 +0000
Commit:     Vasil Dimov <vd@FreeBSD.org>
CommitDate: 2024-06-11 17:16:08 +0000

    net-p2p/c-lightning: upgrade from 24.02.2 to 24.05
---
 net-p2p/c-lightning/Makefile                       | 34 +++++++++++++++++-----
 net-p2p/c-lightning/distinfo                       |  6 ++--
 .../c-lightning/files/check_python_plugins_deps.sh | 23 +++++++++++++++
 net-p2p/c-lightning/pkg-plist                      | 11 ++++++-
 4 files changed, 63 insertions(+), 11 deletions(-)

diff --git a/net-p2p/c-lightning/Makefile b/net-p2p/c-lightning/Makefile
index ba3da417b8bb..cda21ede037f 100644
--- a/net-p2p/c-lightning/Makefile
+++ b/net-p2p/c-lightning/Makefile
@@ -1,11 +1,10 @@
 PORTNAME=	c-lightning
 # To build from an arbitrary git commit comment PORTVERSION and PORTREVISION (if present)
-PORTVERSION=	24.02.2
+PORTVERSION=	24.05
 DISTVERSIONPREFIX=	v
 # and uncomment the following two lines (use for example -git-HEAD or -git-f8d8348c)
 #PORTVERSION=	0
 #PKGNAMESUFFIX=	-git-f8d8348c
-PORTREVISION=	1
 CATEGORIES=	net-p2p finance
 
 MAINTAINER=	vd@FreeBSD.org
@@ -16,6 +15,7 @@ LICENSE=	MIT
 
 BUILD_DEPENDS=	bash:shells/bash \
 		lowdown:textproc/lowdown \
+		jq:textproc/jq \
 		${PYTHON_PKGNAMEPREFIX}mako>=1.0.14:textproc/py-mako@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}mrkd>=0.2.0_1:devel/py-mrkd@${PY_FLAVOR}
 LIB_DEPENDS=	libsodium.so:security/libsodium
@@ -31,18 +31,18 @@ USES=		autoreconf:build \
 CPE_VENDOR=	elementsproject
 BINARY_ALIAS=	python=${PYTHON_CMD} python3=${PYTHON_CMD}
 ALL_TARGET=	default
-SHEBANG_FILES=	plugins/clnrest/clnrest.py \
+SHEBANG_FILES=	plugins/wss-proxy/wss-proxy.py \
+		plugins/clnrest/clnrest.py \
 		tools/reckless
 
-OPTIONS_DEFINE=		CLNRESTDEPS COMPATIBILITY DEBUG
+OPTIONS_DEFINE=		CLNRESTDEPS COMPATIBILITY DEBUG WSSPROXYDEPS
 OPTIONS_MULTI=		STORAGE
 OPTIONS_MULTI_STORAGE=	POSTGRESQL SQLITE
 OPTIONS_RADIO=		TESTING
 OPTIONS_RADIO_TESTING=	ASAN VALGRIND
 
 CLNRESTDEPS_DESC=	Install and depend on packages required by the clnrest plugin
-# for d in $(grep -E '^[^[:space:]]' work/lightning-*/plugins/clnrest/requirements.txt |cut -f 1 -d =) ; do if [ -z "$(make -V CLNRESTDEPS_RUN_DEPENDS |grep -i "$(make -V PYTHON_PKGNAMEPREFIX)${d/-/.}>")" ] ; then echo "$d" ; fi ; done
-# ignore cryptography (handled separately via USE_PYTHON+=cryptography) and pkgutil-resolve-name (included in Python 3.9)
+# run files/check_python_plugins_deps.sh to verify the list below
 CLNRESTDEPS_RUN_DEPENDS=\
 	${PYTHON_PKGNAMEPREFIX}Flask-Cors>0:www/py-flask-cors@${PY_FLAVOR} \
 	${PYTHON_PKGNAMEPREFIX}Jinja2>0:devel/py-Jinja2@${PY_FLAVOR} \
@@ -100,12 +100,27 @@ ASAN_CONFIGURE_ENABLE=		address-sanitizer
 ASAN_DESC=			Compile with address-sanitizer
 VALGRIND_CONFIGURE_ENABLE=	valgrind
 VALGRIND_DESC=			Run tests with Valgrind
+WSSPROXYDEPS_DESC=	Install and depend on packages required by the wss-proxy plugin
+# run files/check_python_plugins_deps.sh to verify the list below
+WSSPROXYDEPS_RUN_DEPENDS=\
+	${PYTHON_PKGNAMEPREFIX}asn1crypto>0:devel/py-asn1crypto@${PY_FLAVOR} \
+	${PYTHON_PKGNAMEPREFIX}base58>0:security/py-base58@${PY_FLAVOR} \
+	${PYTHON_PKGNAMEPREFIX}bitarray>0:devel/py-bitarray@${PY_FLAVOR} \
+	${PYTHON_PKGNAMEPREFIX}bitstring>0:devel/py-bitstring@${PY_FLAVOR} \
+	${PYTHON_PKGNAMEPREFIX}cffi>0:devel/py-cffi@${PY_FLAVOR} \
+	${PYTHON_PKGNAMEPREFIX}coincurve>0:security/py-coincurve@${PY_FLAVOR} \
+	${PYTHON_PKGNAMEPREFIX}pycparser>0:devel/py-pycparser@${PY_FLAVOR} \
+	${PYTHON_PKGNAMEPREFIX}pyln-bolt7>0:net-p2p/pyln-bolt7@${PY_FLAVOR} \
+	${PYTHON_PKGNAMEPREFIX}pyln-client>0:net-p2p/pyln-client@${PY_FLAVOR} \
+	${PYTHON_PKGNAMEPREFIX}pyln-proto>0:net-p2p/pyln-proto@${PY_FLAVOR} \
+	${PYTHON_PKGNAMEPREFIX}pysocks>0:net/py-pysocks@${PY_FLAVOR} \
+	${PYTHON_PKGNAMEPREFIX}websockets>0:devel/py-websockets@${PY_FLAVOR}
 
 OPTIONS_DEFAULT=COMPATIBILITY SQLITE
 
 .include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MCLNRESTDEPS}
+.if ${PORT_OPTIONS:MCLNRESTDEPS} || ${PORT_OPTIONS:MWSSPROXYDEPS}
 USES+=		python:3.9+
 USE_PYTHON+=	cryptography
 .else
@@ -146,6 +161,11 @@ PLIST_SUB=	U="${USERS}" G="${GROUPS}"
 CPPFLAGS+=	-Wno-error=unused-but-set-variable
 .endif
 
+post-patch:
+	${REINPLACE_CMD} -e "s|python3|${PYTHON_CMD}|" \
+		${WRKSRC}/plugins/clnrest/clnrest \
+		${WRKSRC}/plugins/wss-proxy/wss-proxy
+
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/lightning-cli
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/lightning-hsmtool
diff --git a/net-p2p/c-lightning/distinfo b/net-p2p/c-lightning/distinfo
index 58560532c06d..4b5a33037071 100644
--- a/net-p2p/c-lightning/distinfo
+++ b/net-p2p/c-lightning/distinfo
@@ -1,6 +1,6 @@
-TIMESTAMP = 1713678971
-SHA256 (ElementsProject-lightning-v24.02.2_GH0.tar.gz) = b9841132e7e66f56e21f3a8b46e29add26476cbd5421db0d3e5bbb0e147316c0
-SIZE (ElementsProject-lightning-v24.02.2_GH0.tar.gz) = 12913908
+TIMESTAMP = 1718103408
+SHA256 (ElementsProject-lightning-v24.05_GH0.tar.gz) = a1eeaa7e6c26f7db9693979ce0606dee726310404b8718850f8bb19985458b66
+SIZE (ElementsProject-lightning-v24.05_GH0.tar.gz) = 13234942
 SHA256 (ElementsProject-libwally-core-ec348c884e93a_GH0.tar.gz) = 6a56dcc73f589951db058eb66a3e95e33890c416492f9d1cdf4c68f0b31847c8
 SIZE (ElementsProject-libwally-core-ec348c884e93a_GH0.tar.gz) = 1037396
 SHA256 (ElementsProject-secp256k1-zkp-1e04d324476f9_GH0.tar.gz) = b987949687db5290fd9cf84029df7ccfecc6787358f9350c7190645969957e0a
diff --git a/net-p2p/c-lightning/files/check_python_plugins_deps.sh b/net-p2p/c-lightning/files/check_python_plugins_deps.sh
new file mode 100755
index 000000000000..172be8d8874a
--- /dev/null
+++ b/net-p2p/c-lightning/files/check_python_plugins_deps.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+declare -A requirements=(["plugins/clnrest/requirements.txt"]="CLNRESTDEPS_RUN_DEPENDS"
+                         ["plugins/wss-proxy/requirements.txt"]="WSSPROXYDEPS_RUN_DEPENDS")
+
+for file in ${!requirements[@]} ; do
+    make_var="${requirements[${file}]}"
+    ok=1
+    for req in $(grep -E '^[^[:space:]]' "$(make -V WRKSRC)/${file}" |cut -f 1 -d =) ; do
+        # "cryptography" is handled separately via USE_PYTHON+=cryptography
+        # "pkgutil-resolve-name" is included in Python 3.9
+        if [ "${req}" != "cryptography" -a \
+             "${req}" != "pkgutil-resolve-name" -a \
+             -z "$(make -V "${make_var}" |grep -i "$(make -V PYTHON_PKGNAMEPREFIX)${req/-/.}>")" ] ; then
+
+            echo "missing in ${file}: ${req}"
+            ok=0
+        fi
+    done
+    if [ ${ok} -eq 1 ] ; then
+        echo "ok: ${file}"
+    fi
+done
diff --git a/net-p2p/c-lightning/pkg-plist b/net-p2p/c-lightning/pkg-plist
index bd910ce57941..24e557aa5333 100644
--- a/net-p2p/c-lightning/pkg-plist
+++ b/net-p2p/c-lightning/pkg-plist
@@ -26,6 +26,7 @@ libexec/c-lightning/plugins/clnrest/.github/screenshots/Swagger-rpc-method.png
 libexec/c-lightning/plugins/clnrest/.github/screenshots/Swagger.png
 libexec/c-lightning/plugins/clnrest/Makefile
 libexec/c-lightning/plugins/clnrest/__init__.py
+libexec/c-lightning/plugins/clnrest/clnrest
 libexec/c-lightning/plugins/clnrest/clnrest.py
 libexec/c-lightning/plugins/clnrest/poetry.lock
 libexec/c-lightning/plugins/clnrest/pyproject.toml
@@ -46,6 +47,13 @@ libexec/c-lightning/plugins/spenderp
 libexec/c-lightning/plugins/sql
 libexec/c-lightning/plugins/topology
 libexec/c-lightning/plugins/txprepare
+libexec/c-lightning/plugins/wss-proxy/Makefile
+libexec/c-lightning/plugins/wss-proxy/poetry.lock
+libexec/c-lightning/plugins/wss-proxy/pyproject.toml
+libexec/c-lightning/plugins/wss-proxy/requirements.txt
+libexec/c-lightning/plugins/wss-proxy/wss-proxy
+libexec/c-lightning/plugins/wss-proxy/wss-proxy.py
+libexec/c-lightning/plugins/wss-proxy/wss_proxy/__init__.py
 share/doc/c-lightning/LICENSE
 share/doc/c-lightning/README.md
 share/man/man1/lightning-cli.1.gz
@@ -79,11 +87,11 @@ share/man/man7/lightning-datastoreusage.7.gz
 share/man/man7/lightning-decode.7.gz
 share/man/man7/lightning-decodepay.7.gz
 share/man/man7/lightning-deldatastore.7.gz
-share/man/man7/lightning-delexpiredinvoice.7.gz
 share/man/man7/lightning-delforward.7.gz
 share/man/man7/lightning-delinvoice.7.gz
 share/man/man7/lightning-delpay.7.gz
 share/man/man7/lightning-deprecations.7.gz
+share/man/man7/lightning-dev-forget-channel.7.gz
 share/man/man7/lightning-disableinvoicerequest.7.gz
 share/man/man7/lightning-disableoffer.7.gz
 share/man/man7/lightning-disconnect.7.gz
@@ -165,6 +173,7 @@ share/man/man7/lightning-txdiscard.7.gz
 share/man/man7/lightning-txprepare.7.gz
 share/man/man7/lightning-txsend.7.gz
 share/man/man7/lightning-unreserveinputs.7.gz
+share/man/man7/lightning-upgradewallet.7.gz
 share/man/man7/lightning-utxopsbt.7.gz
 share/man/man7/lightning-wait.7.gz
 share/man/man7/lightning-waitanyinvoice.7.gz