mypaint: add upstream patch for Python 3.11 compatibility

This commit is contained in:
wiz 2024-01-28 08:19:18 +00:00
parent 819caf0b87
commit ca14c85d92
4 changed files with 91 additions and 9 deletions

View File

@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.65 2023/11/14 14:02:08 wiz Exp $
# $NetBSD: Makefile,v 1.66 2024/01/28 08:19:18 wiz Exp $
DISTNAME= mypaint-2.0.0
PKGREVISION= 17
PKGREVISION= 18
CATEGORIES= graphics
MASTER_SITES= ${MASTER_SITE_GITHUB:=mypaint/}
EXTRACT_SUFX= .tar.xz
@ -19,9 +19,6 @@ TOOL_DEPENDS+= swig3-[0-9]*:../../devel/swig3
EGG_NAME= MyPaint-${PKGVERSION_NOREV}a0
PYTHON_VERSIONS_INCOMPATIBLE= 27 38
# might be fixed by:
# https://github.com/mypaint/mypaint/commit/032a155b72f2b021f66a994050d83f07342d04af
PYTHON_VERSIONS_INCOMPATIBLE+= 311
USE_LANGUAGES= c c++

View File

@ -1,7 +1,8 @@
$NetBSD: distinfo,v 1.13 2021/10/26 10:46:32 nia Exp $
$NetBSD: distinfo,v 1.14 2024/01/28 08:19:18 wiz Exp $
BLAKE2s (mypaint-2.0.0.tar.xz) = b12a8e163e3f362b079a4e672502e0b2f2e0ca0ccd360942cb9a36f8fee3892d
SHA512 (mypaint-2.0.0.tar.xz) = 118d905f4d7ce6adb9779b59d6b3f51b94a9937778b8fe3ed1b31c9b5b77d63110134bdc74849a91d8095e905664227ff43ffe183ad9c7c7ba18fa954ade8a84
Size (mypaint-2.0.0.tar.xz) = 7316680 bytes
SHA1 (patch-lib_gettext__setup.py) = 08a93e37a410f7a7392e575fa06c10bdd13e6ef6
SHA1 (patch-lib_meta.py) = 1c8832ff06154255d7ea14037dc728d1fa0ba50e
SHA1 (patch-setup.py) = 55b5c2ef1ef8612999c1630b2259f7f54a5cf264
SHA1 (patch-setup.py) = 399bed73657bb7abf1a949e83f39ca0e0e9821fb

View File

@ -0,0 +1,71 @@
$NetBSD: patch-lib_gettext__setup.py,v 1.1 2024/01/28 08:19:19 wiz Exp $
https://github.com/mypaint/mypaint/commit/032a155b72f2b021f66a994050d83f07342d04af
--- lib/gettext_setup.py.orig 2020-02-15 15:05:22.000000000 +0000
+++ lib/gettext_setup.py
@@ -71,13 +71,11 @@ def init_gettext(localepath):
# yanked in over GI.
# https://bugzilla.gnome.org/show_bug.cgi?id=574520#c26
bindtextdomain = None
- bind_textdomain_codeset = None
textdomain = None
# Try the POSIX/Linux way first.
try:
bindtextdomain = locale.bindtextdomain
- bind_textdomain_codeset = locale.bind_textdomain_codeset
textdomain = locale.textdomain
except AttributeError:
logger.warning(
@@ -106,12 +104,6 @@ def init_gettext(localepath):
ctypes.c_char_p,
)
bindtextdomain.restype = ctypes.c_char_p
- bind_textdomain_codeset = libintl.bind_textdomain_codeset
- bind_textdomain_codeset.argtypes = (
- ctypes.c_char_p,
- ctypes.c_char_p,
- )
- bind_textdomain_codeset.restype = ctypes.c_char_p
textdomain = libintl.textdomain
textdomain.argtypes = (
ctypes.c_char_p,
@@ -160,35 +152,22 @@ def init_gettext(localepath):
# complete set from the same source.
# Required for translatable strings in GtkBuilder XML
# to be translated.
- if bindtextdomain and bind_textdomain_codeset and textdomain:
+ if bindtextdomain and textdomain:
assert os.path.exists(path)
assert os.path.isdir(path)
if sys.platform == 'win32':
p = bindtextdomain(dom.encode('utf-8'), path.encode('utf-8'))
- c = bind_textdomain_codeset(
- dom.encode('utf-8'), codeset.encode('utf-8')
- )
else:
p = bindtextdomain(dom, path)
- c = bind_textdomain_codeset(dom, codeset)
logger.debug("C bindtextdomain(%r, %r): %r", dom, path, p)
- logger.debug(
- "C bind_textdomain_codeset(%r, %r): %r",
- dom, codeset, c,
- )
# Call the implementations in Python's standard gettext module
# too. This has proper cross-platform support, but it only
# initializes the native Python "gettext" module.
# Required for marked strings in Python source to be translated.
# See http://docs.python.org/release/2.7/library/locale.html
p = gettext.bindtextdomain(dom, path)
- c = gettext.bind_textdomain_codeset(dom, codeset)
logger.debug("Python bindtextdomain(%r, %r): %r", dom, path, p)
- logger.debug(
- "Python bind_textdomain_codeset(%r, %r): %r",
- dom, codeset, c,
- )
- if bindtextdomain and bind_textdomain_codeset and textdomain:
+ if bindtextdomain and textdomain:
if sys.platform == 'win32':
d = textdomain(defaultdom.encode('utf-8'))
else:

View File

@ -1,11 +1,24 @@
$NetBSD: patch-setup.py,v 1.1 2020/05/30 20:46:09 joerg Exp $
$NetBSD: patch-setup.py,v 1.2 2024/01/28 08:19:19 wiz Exp $
First chunk:
https://github.com/mypaint/mypaint/commit/032a155b72f2b021f66a994050d83f07342d04af
Chunks two & three:
Don't force pure standard mode as it depends on various extensions
anyway. Explicitly set _NETBSD_SOURCE since Python's config.h pollutes
the namespace with it.
--- setup.py.orig 2020-02-15 15:05:23.000000000 +0000
--- setup.py.orig 2024-01-28 08:16:11.582259663 +0000
+++ setup.py
@@ -570,7 +570,7 @@ class InstallScripts (install_scripts):
self.announce("installing %s as %s" % (src, targ_basename), level=2)
if self.dry_run:
return []
- with open(src, "rU") as in_fp:
+ with open(src, "r") as in_fp:
with open(targ, "w") as out_fp:
line = in_fp.readline().rstrip()
if line.startswith("#!"):
@@ -801,7 +801,7 @@ def get_ext_modules():
import numpy