From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1653693-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id D7EB61581C1
	for <garchives@archives.gentoo.org>; Tue, 16 Jul 2024 21:28:42 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id E008D2BC01F;
	Tue, 16 Jul 2024 21:28:41 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id C0E4B2BC01F
	for <gentoo-commits@lists.gentoo.org>; Tue, 16 Jul 2024 21:28:41 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 950FD3406D1
	for <gentoo-commits@lists.gentoo.org>; Tue, 16 Jul 2024 21:28:40 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id CF4581B89
	for <gentoo-commits@lists.gentoo.org>; Tue, 16 Jul 2024 21:28:38 +0000 (UTC)
From: "Conrad Kostecki" <conikost@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Conrad Kostecki" <conikost@gentoo.org>
Message-ID: <1721165095.2d9fa2ef2f89fb72275dab73204ad2404b22d666.conikost@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/elinks/, www-client/elinks/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: www-client/elinks/elinks-0.16.1.1-r3.ebuild www-client/elinks/files/elinks-0.16.1.1-ecmascript-implicit-declaration.patch www-client/elinks/files/elinks-0.16.1.1-python-3.12.patch
X-VCS-Directories: www-client/elinks/ www-client/elinks/files/
X-VCS-Committer: conikost
X-VCS-Committer-Name: Conrad Kostecki
X-VCS-Revision: 2d9fa2ef2f89fb72275dab73204ad2404b22d666
X-VCS-Branch: master
Date: Tue, 16 Jul 2024 21:28:38 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: a42a0220-c6d1-4fd7-a38f-aa334b6082f3
X-Archives-Hash: 3fdef9dac1ef3f6b6903e63528eed807

commit:     2d9fa2ef2f89fb72275dab73204ad2404b22d666
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 16 21:24:55 2024 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Tue Jul 16 21:24:55 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d9fa2ef

www-client/elinks: fix python3.12 support

Closes: https://bugs.gentoo.org/929876
Bug: https://bugs.gentoo.org/919372
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 www-client/elinks/elinks-0.16.1.1-r3.ebuild        |  2 ++
 ...-0.16.1.1-ecmascript-implicit-declaration.patch | 36 ++++++++++++++++++++++
 .../elinks/files/elinks-0.16.1.1-python-3.12.patch | 26 ++++++++++++++++
 3 files changed, 64 insertions(+)

diff --git a/www-client/elinks/elinks-0.16.1.1-r3.ebuild b/www-client/elinks/elinks-0.16.1.1-r3.ebuild
index bef5b7bb9a45..a56703fb7e56 100644
--- a/www-client/elinks/elinks-0.16.1.1-r3.ebuild
+++ b/www-client/elinks/elinks-0.16.1.1-r3.ebuild
@@ -72,7 +72,9 @@ BDEPEND="
 "
 
 PATCHES=(
+	"${FILESDIR}"/${PN}-0.16.1.1-ecmascript-implicit-declaration.patch
 	"${FILESDIR}"/${PN}-0.16.1.1-perl-5.38.patch
+	"${FILESDIR}"/${PN}-0.16.1.1-python-3.12.patch
 )
 
 pkg_setup() {

diff --git a/www-client/elinks/files/elinks-0.16.1.1-ecmascript-implicit-declaration.patch b/www-client/elinks/files/elinks-0.16.1.1-ecmascript-implicit-declaration.patch
new file mode 100644
index 000000000000..58c98cc27da0
--- /dev/null
+++ b/www-client/elinks/files/elinks-0.16.1.1-ecmascript-implicit-declaration.patch
@@ -0,0 +1,36 @@
+--- elinks-0.16.1.1/src/document/html/parser/general.c	2024-06-06 07:10:40.163191871 +0200
++++ elinks-0.16.1.1/src/document/html/parser/general.c	2024-06-06 07:11:45.913711031 +0200
+@@ -38,6 +38,10 @@
+ #include "util/memory.h"
+ #include "util/string.h"
+ 
++#ifdef CONFIG_ECMASCRIPT
++#include "ecmascript/ecmascript.h"
++#endif
++
+ /* Unsafe macros */
+ #include "document/html/internal.h"
+ 
+--- elinks-0.16.1.1/src/document/html/parser/stack.c	2023-05-01 10:45:22.000000000 +0200
++++ elinks-0.16.1.1/src/document/html/parser/stack.c	2024-06-06 07:11:29.892765184 +0200
+@@ -24,6 +24,10 @@
+ #include "util/memory.h"
+ #include "util/string.h"
+ 
++#ifdef CONFIG_ECMASCRIPT
++#include "ecmascript/ecmascript.h"
++#endif
++
+ /* Unsafe macros */
+ #include "document/html/internal.h"
+ 
+--- elinks-0.16.1.1/src/ecmascript/ecmascript.h.orig	2024-06-06 07:18:53.237018842 +0200
++++ elinks-0.16.1.1/src/ecmascript/ecmascript.h	2024-06-06 07:20:04.434093077 +0200
+@@ -26,6 +26,7 @@
+ #include "main/module.h"
+ #include "main/timer.h"
+ #include "util/time.h"
++#include <stdbool.h>
+ 
+ //#define ECMASCRIPT_DEBUG 1
+ 

diff --git a/www-client/elinks/files/elinks-0.16.1.1-python-3.12.patch b/www-client/elinks/files/elinks-0.16.1.1-python-3.12.patch
new file mode 100644
index 000000000000..e6ac9f004463
--- /dev/null
+++ b/www-client/elinks/files/elinks-0.16.1.1-python-3.12.patch
@@ -0,0 +1,26 @@
+From 2577da89420ce2a1d58fadd7f2e6809d2ba70dd8 Mon Sep 17 00:00:00 2001
+From: Witold Filipczyk <witekfl@poczta.onet.pl>
+Date: Mon, 10 Jun 2024 13:07:23 +0200
+Subject: [PATCH] [python] module imp is deprecated. Refs #313
+
+---
+ src/scripting/python/core.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/scripting/python/core.c b/src/scripting/python/core.c
+index 185561108..4a69e4293 100644
+--- a/src/scripting/python/core.c
++++ b/src/scripting/python/core.c
+@@ -138,10 +138,10 @@ hooks_module_exists(void)
+ 	 * indicates that no such module was found; any other exception will
+ 	 * be reported as an error.
+ 	 */
+-	imp_module = PyImport_ImportModule("imp");
++	imp_module = PyImport_ImportModule("importlib.util");
+ 	if (!imp_module) goto python_error;
+ 
+-	result = PyObject_CallMethod(imp_module, "find_module", "s", "hooks");
++	result = PyObject_CallMethod(imp_module, "find_spec", "s", "hooks");
+ 	if (result) {
+ 		found_hooks = 1;
+ 		goto end;