diff --git a/net-im/weechat-matrix/files/weechat-matrix-0.3.0-ssl_set_npn_protocols.patch b/net-im/weechat-matrix/files/weechat-matrix-0.3.0-ssl_set_npn_protocols.patch new file mode 100644 index 0000000..29cb063 --- /dev/null +++ b/net-im/weechat-matrix/files/weechat-matrix-0.3.0-ssl_set_npn_protocols.patch @@ -0,0 +1,27 @@ +From 4e585d5f4628e6fbeba9ec4560b440d731e076f5 Mon Sep 17 00:00:00 2001 +From: Jonas Witschel +Date: Sat, 11 Dec 2021 19:47:16 +0100 +Subject: [PATCH] server: remove set_npn_protocols() + +This function is deprecated in favour of set_alpn_protocols(), which is already +called, and is currently broken in Python 3.10, so remove it altogether. +--- + matrix/server.py | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/matrix/server.py b/matrix/server.py +index dda861e..0f34c1e 100644 +--- a/matrix/server.py ++++ b/matrix/server.py +@@ -303,11 +303,6 @@ def __init__(self, name, config_ptr): + # Enable http2 negotiation on the ssl context. + self.ssl_context.set_alpn_protocols(["h2", "http/1.1"]) + +- try: +- self.ssl_context.set_npn_protocols(["h2", "http/1.1"]) +- except NotImplementedError: +- pass +- + self.address = None + self.homeserver = None + self.client = None # type: Optional[HttpClient] diff --git a/net-im/weechat-matrix/weechat-matrix-0.3.0.ebuild b/net-im/weechat-matrix/weechat-matrix-0.3.0.ebuild index c5b18de..a89fb25 100644 --- a/net-im/weechat-matrix/weechat-matrix-0.3.0.ebuild +++ b/net-im/weechat-matrix/weechat-matrix-0.3.0.ebuild @@ -36,8 +36,10 @@ DEPEND=" RDEPEND="${DEPEND}" BDEPEND="" +PATCHES=( "${FILESDIR}/${P}-ssl_set_npn_protocols.patch" ) + src_install() { python_domodule matrix exeinto /usr/lib/weechat - newexe main.py matrix.py + newexe main.py ${PN}.py }