git: 41c76d28e133 - main - devel/py-awscrt: Update to 0.27.0

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 18 May 2025 03:38:01 UTC
The branch main has been updated by sunpoet:

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

commit 41c76d28e1333c820f87932bda2bdb0f17344336
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2025-05-18 03:17:35 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2025-05-18 03:34:32 +0000

    devel/py-awscrt: Update to 0.27.0
    
    Changes:        https://github.com/awslabs/aws-crt-python/releases
---
 devel/py-awscrt/Makefile                       | 15 ++++--
 devel/py-awscrt/distinfo                       |  6 +--
 devel/py-awscrt/files/patch-awscrt-__init__.py | 11 ++++
 devel/py-awscrt/files/patch-mqtt               | 70 ++++++++++++++++++++++++++
 4 files changed, 95 insertions(+), 7 deletions(-)

diff --git a/devel/py-awscrt/Makefile b/devel/py-awscrt/Makefile
index 4697f05445a5..8868c424f610 100644
--- a/devel/py-awscrt/Makefile
+++ b/devel/py-awscrt/Makefile
@@ -1,7 +1,8 @@
 PORTNAME=	awscrt
-PORTVERSION=	0.26.1
+PORTVERSION=	0.27.0
+DISTVERSIONPREFIX=	v
 CATEGORIES=	devel python
-MASTER_SITES=	PYPI
+#MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
 MAINTAINER=	sunpoet@FreeBSD.org
@@ -24,13 +25,19 @@ LIB_DEPENDS=	libaws-c-auth.so:security/aws-c-auth \
 		libaws-c-s3.so:devel/aws-c-s3 \
 		libaws-c-sdkutils.so:devel/aws-c-sdkutils \
 		libaws-checksums.so:devel/aws-checksums \
-		libcrypto.so:security/aws-lc \
 		libs2n.so:security/s2n-tls
 
 USES=		localbase:ldflags python ssl
 USE_PYTHON=	autoplist concurrent pep517
 
-MAKE_ENV=	AWS_CRT_BUILD_USE_SYSTEM_LIBCRYPTO=1
+MAKE_ENV=	AWS_CRT_BUILD_FORCE_STATIC_LIBS=0 \
+		AWS_CRT_BUILD_USE_SYSTEM_LIBCRYPTO=1 \
+		AWS_CRT_BUILD_USE_SYSTEM_LIBS=1 \
+		AWS_CRT_BUILD_WARNINGS_ARE_ERRORS=0
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	awslabs
+GH_PROJECT=	aws-crt-python
 
 # Clean up bundled libraries
 post-patch:
diff --git a/devel/py-awscrt/distinfo b/devel/py-awscrt/distinfo
index 12c9a9828f6d..359b8d1592ed 100644
--- a/devel/py-awscrt/distinfo
+++ b/devel/py-awscrt/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1744288860
-SHA256 (awscrt-0.26.1.tar.gz) = a8d63a7dcc6484c5c1675b31a8d1b6726c3dc85b13796fb143dfb0072260935e
-SIZE (awscrt-0.26.1.tar.gz) = 77265756
+TIMESTAMP = 1745936114
+SHA256 (awslabs-aws-crt-python-v0.27.0_GH0.tar.gz) = 780e56c0eb7b09088084a613e526a271a39ebbb291255163351d2132e114f967
+SIZE (awslabs-aws-crt-python-v0.27.0_GH0.tar.gz) = 293885
diff --git a/devel/py-awscrt/files/patch-awscrt-__init__.py b/devel/py-awscrt/files/patch-awscrt-__init__.py
new file mode 100644
index 000000000000..292f8dd8e792
--- /dev/null
+++ b/devel/py-awscrt/files/patch-awscrt-__init__.py
@@ -0,0 +1,11 @@
+--- awscrt/__init__.py.orig	2025-04-25 19:28:57 UTC
++++ awscrt/__init__.py
+@@ -13,7 +13,7 @@ __all__ = [
+     'websocket',
+ ]
+ 
+-__version__ = '1.0.0.dev0'
++__version__ = '0.27.0'
+ 
+ 
+ class NativeResource:
diff --git a/devel/py-awscrt/files/patch-mqtt b/devel/py-awscrt/files/patch-mqtt
new file mode 100644
index 000000000000..c9cf71ea4487
--- /dev/null
+++ b/devel/py-awscrt/files/patch-mqtt
@@ -0,0 +1,70 @@
+Obtained from:	https://github.com/awslabs/aws-crt-python/pull/651
+		https://github.com/awslabs/aws-crt-python/pull/651/commits/aca159cc63187426a61e6c1cc8e4c18db2d73d71
+--- source/mqtt_request_response.c.orig	2025-04-25 19:28:57 UTC
++++ source/mqtt_request_response.c
+@@ -352,8 +352,7 @@ static void s_on_mqtt_request_complete(
+ }
+ 
+ static void s_on_mqtt_request_complete(
+-    const struct aws_byte_cursor *response_topic,
+-    const struct aws_byte_cursor *payload,
++    const struct aws_mqtt_rr_incoming_publish_event *publish_event,
+     int error_code,
+     void *user_data) {
+ 
+@@ -368,10 +367,10 @@ static void s_on_mqtt_request_complete(
+         request_binding->on_request_complete_callback,
+         "(is#y#)",
+         /* i */ error_code,
+-        /* s */ response_topic ? response_topic->ptr : NULL,
+-        /* # */ response_topic ? response_topic->len : 0,
+-        /* y */ payload ? payload->ptr : NULL,
+-        /* # */ payload ? payload->len : 0);
++        /* s */ publish_event ? publish_event->topic.ptr : NULL,
++        /* # */ publish_event ? publish_event->topic.len : 0,
++        /* y */ publish_event ? publish_event->payload.ptr : NULL,
++        /* # */ publish_event ? publish_event->payload.len : 0);
+     if (!result) {
+         PyErr_WriteUnraisable(PyErr_Occurred());
+     }
+@@ -467,7 +466,7 @@ PyObject *aws_py_mqtt_request_response_client_make_req
+         };
+ 
+         if (aws_mqtt_request_response_client_submit_request(client_binding->native, &request_options)) {
+-            s_on_mqtt_request_complete(NULL, NULL, aws_last_error(), request_binding);
++            s_on_mqtt_request_complete(NULL, aws_last_error(), request_binding);
+         }
+     }
+ 
+@@ -551,8 +550,7 @@ static void s_aws_mqtt_streaming_operation_incoming_pu
+ }
+ 
+ static void s_aws_mqtt_streaming_operation_incoming_publish_callback_python(
+-    struct aws_byte_cursor payload,
+-    struct aws_byte_cursor topic,
++    const struct aws_mqtt_rr_incoming_publish_event *publish_event,
+     void *user_data) {
+ 
+     struct mqtt_streaming_operation_binding *stream_binding = user_data;
+@@ -565,10 +563,10 @@ static void s_aws_mqtt_streaming_operation_incoming_pu
+     PyObject *result = PyObject_CallFunction(
+         stream_binding->incoming_publish_callable,
+         "(s#y#)",
+-        /* s */ topic.ptr,
+-        /* # */ topic.len,
+-        /* y */ payload.ptr,
+-        /* # */ payload.len);
++        /* s */ publish_event->topic.ptr,
++        /* # */ publish_event->topic.len,
++        /* y */ publish_event->payload.ptr,
++        /* # */ publish_event->payload.len);
+     if (!result) {
+         PyErr_WriteUnraisable(PyErr_Occurred());
+     }
+@@ -673,4 +671,4 @@ struct aws_mqtt_rr_client_operation *aws_py_get_mqtt_s
+         s_capsule_name_mqtt_streaming_operation,
+         "StreamingOperation",
+         mqtt_streaming_operation_binding);
+-}
+\ No newline at end of file
++}