commit:     7ae0671d3bc11bb18511b02b1466403566330572
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 15 08:01:30 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Oct 15 08:01:30 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ae0671d

dev-util/meld: fix compat w/ py3.13

Closes: https://bugs.gentoo.org/941526
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/meld/files/meld-3.22.2-py3.13.patch | 33 ++++++++++++
 dev-util/meld/meld-3.22.2-r1.ebuild          | 78 ++++++++++++++++++++++++++++
 2 files changed, 111 insertions(+)

diff --git a/dev-util/meld/files/meld-3.22.2-py3.13.patch 
b/dev-util/meld/files/meld-3.22.2-py3.13.patch
new file mode 100644
index 000000000000..b49499f63ce2
--- /dev/null
+++ b/dev-util/meld/files/meld-3.22.2-py3.13.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/941526
+https://gitlab.gnome.org/GNOME/meld/-/issues/873
+https://gitlab.gnome.org/GNOME/meld/-/commit/aa817dce6bb0667fc6ef38163c213803dc8b37b3
+
+From aa817dce6bb0667fc6ef38163c213803dc8b37b3 Mon Sep 17 00:00:00 2001
+From: "FeRD (Frank Dana)" <ferd...@gmail.com>
+Date: Fri, 29 Sep 2023 04:23:22 -0400
+Subject: [PATCH] Don't use deprecated pipes module
+
+Only `pipes.quote()` was being used in Meld, and that symbol in
+pipes is just an import of `shlex.quote()` anyway. Switch to calling
+`shlex.quote()` directly, since pipes will be removed in Python 3.13.
+--- a/meld/melddoc.py
++++ b/meld/melddoc.py
+@@ -17,7 +17,6 @@
+ import enum
+ import logging
+ import os
+-import pipes
+ import shlex
+ import string
+ import subprocess
+@@ -45,7 +44,7 @@ def make_custom_editor_command(path: str, line: int = 0) -> 
Sequence[str]:
+         log.error("Unsupported fields found")
+         return [custom_command, path]
+     else:
+-        cmd = custom_command.format(file=pipes.quote(path), line=line)
++        cmd = custom_command.format(file=shlex.quote(path), line=line)
+     return shlex.split(cmd)
+ 
+ 
+-- 
+GitLab

diff --git a/dev-util/meld/meld-3.22.2-r1.ebuild 
b/dev-util/meld/meld-3.22.2-r1.ebuild
new file mode 100644
index 000000000000..f9be686638ec
--- /dev/null
+++ b/dev-util/meld/meld-3.22.2-r1.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{10..13} )
+PYTHON_REQ_USE="xml(+)"
+
+inherit gnome.org gnome2-utils meson python-single-r1 xdg
+
+DESCRIPTION="A graphical diff and merge tool"
+HOMEPAGE="http://meldmerge.org/";
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 
~amd64-linux ~x86-linux"
+IUSE="test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+       ${PYTHON_DEPS}
+       >=x11-libs/gtk+-3.20:3[introspection]
+       >=dev-libs/glib-2.48:2
+       >=x11-libs/gtksourceview-4.0.0:4[introspection]
+       $(python_gen_cond_dep '
+               >=dev-python/pygobject-3.30:3[cairo,${PYTHON_USEDEP}]
+       ')
+       gnome-base/gsettings-desktop-schemas
+       >=x11-libs/pango-1.34[introspection]
+       x11-themes/hicolor-icon-theme
+"
+DEPEND="${RDEPEND}
+       test? (
+               dev-util/desktop-file-utils
+               dev-libs/appstream-glib
+       )
+"
+BDEPEND="
+       dev-util/intltool
+       dev-util/itstool
+       sys-devel/gettext
+       $(python_gen_cond_dep 'dev-python/distro[${PYTHON_USEDEP}]')
+"
+# dev-python/distro is soft-required in BDEPEND for python3.8 and onwards,
+# but it's mainly needed for debian and derivatives - seems the fallback
+# works fine, as we aren't a special_case, just an annoying warning.
+
+PATCHES=(
+       "${FILESDIR}"/meld-3.22.2-py3.13.patch
+)
+
+pkg_setup() {
+       python-single-r1_pkg_setup
+}
+
+src_configure() {
+       local emesonargs=(
+               -Dprofile=''
+               -Dbyte-compile=false
+       )
+       meson_src_configure
+}
+
+src_install() {
+       meson_src_install
+       python_optimize
+       python_fix_shebang "${ED}"/usr/bin/meld
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+       gnome2_schemas_update
+}
+
+pkg_postrm() {
+       xdg_pkg_postrm
+       gnome2_schemas_update
+}

Reply via email to