summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Hoffstätte <holger@applied-asynchrony.com>2020-02-04 16:03:13 +0100
committerJoonas Niilola <juippis@gentoo.org>2020-02-20 15:20:14 +0200
commitf7b2a6506e3a962f973dc6d2a774404853d5a648 (patch)
tree24810108219e303301bb51dc26e8e04a29c8f2dc /media-libs/libmypaint/files
parentsci-calculators/bc-gh: version bump to 2.5.3 (diff)
downloadgentoo-f7b2a6506e3a962f973dc6d2a774404853d5a648.tar.gz
gentoo-f7b2a6506e3a962f973dc6d2a774404853d5a648.tar.bz2
gentoo-f7b2a6506e3a962f973dc6d2a774404853d5a648.zip
media-libs/libmypaint: python2 removal
libmypaint runs a code generator that until recently was python2-only. This changeset applies selected patches from upstream and makes PYTHON_COMPAT 3.x-only. No references to python2 remain. Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com> Closes: https://github.com/gentoo/gentoo/pull/14553 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'media-libs/libmypaint/files')
-rw-r--r--media-libs/libmypaint/files/libmypaint-1.4.0-adjust-generation-script-to-be-runnable-in-Py3.patch31
-rw-r--r--media-libs/libmypaint/files/libmypaint-1.4.0-drop-python2-requirement-recommendation.patch34
2 files changed, 65 insertions, 0 deletions
diff --git a/media-libs/libmypaint/files/libmypaint-1.4.0-adjust-generation-script-to-be-runnable-in-Py3.patch b/media-libs/libmypaint/files/libmypaint-1.4.0-adjust-generation-script-to-be-runnable-in-Py3.patch
new file mode 100644
index 000000000000..8f4b713b3af7
--- /dev/null
+++ b/media-libs/libmypaint/files/libmypaint-1.4.0-adjust-generation-script-to-be-runnable-in-Py3.patch
@@ -0,0 +1,31 @@
+From 748e735e7fffd2524bb3552fd79b2a2c13f60711 Mon Sep 17 00:00:00 2001
+From: Jesper Lloyd <jpl.lloyd@gmail.com>
+Date: Wed, 11 Dec 2019 18:02:35 +0100
+Subject: [PATCH] Adjust generation script to be runnable in Py3
+
+---
+ generate.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/generate.py b/generate.py
+index 6ab3dd0e..1e0b4ee9 100644
+--- a/generate.py
++++ b/generate.py
+@@ -26,6 +26,7 @@
+ import json
+ from collections import namedtuple
+
++PY3 = sys.version_info >= (3,)
+
+ _SETTINGS = [] # brushsettings.settings
+ _SETTING_ORDER = [
+@@ -82,7 +83,8 @@ def validate(self):
+
+ def _init_globals_from_json(filename):
+ """Populate global variables above from the canonical JSON definition."""
+- with open(filename, "rb") as fp:
++ flag = "r" if PY3 else "rb"
++ with open(filename, flag) as fp:
+ defs = json.load(fp)
+ for input_def in defs["inputs"]:
+ input = _BrushInput(**input_def)
diff --git a/media-libs/libmypaint/files/libmypaint-1.4.0-drop-python2-requirement-recommendation.patch b/media-libs/libmypaint/files/libmypaint-1.4.0-drop-python2-requirement-recommendation.patch
new file mode 100644
index 000000000000..1413868094d5
--- /dev/null
+++ b/media-libs/libmypaint/files/libmypaint-1.4.0-drop-python2-requirement-recommendation.patch
@@ -0,0 +1,34 @@
+From 68e2c33add0aec09f1898aa80ef4f822bed67b87 Mon Sep 17 00:00:00 2001
+From: Jesper Lloyd <jpl.lloyd@gmail.com>
+Date: Tue, 17 Dec 2019 17:36:22 +0100
+Subject: [PATCH] Drop python2 requirement/recommendation
+
+---
+ README.md | 2 +-
+ autogen.sh | 2 +-
+ generate.py | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/README.md b/README.md
+index 96c748da..fae90566 100644
+--- a/README.md
++++ b/README.md
+@@ -35,7 +35,7 @@ to get started with a standard configuration:
+
+ When building from git:
+
+- $ sudo apt install -y python2.7 autotools-dev intltool gettext libtool
++ $ sudo apt install -y python autotools-dev intltool gettext libtool
+
+ ### Install dependencies (Red Hat and derivatives)
+
+diff --git a/generate.py b/generate.py
+index b613f91d..cd7e99e8 100644
+--- a/generate.py
++++ b/generate.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2
++#!/usr/bin/env python
+ # libmypaint - The MyPaint Brush Library
+ # Copyright (C) 2007-2012 Martin Renold <martinxyz@gmx.ch>
+ # Copyright (C) 2012-2016 by the MyPaint Development Team.