Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libmypaint/files/, media-libs/libmypaint/
Date: Thu, 20 Feb 2020 13:27:35
Message-Id: 1582204814.f7b2a6506e3a962f973dc6d2a774404853d5a648.juippis@gentoo
1 commit: f7b2a6506e3a962f973dc6d2a774404853d5a648
2 Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
3 AuthorDate: Tue Feb 4 15:03:13 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 20 13:20:14 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7b2a650
7
8 media-libs/libmypaint: python2 removal
9
10 libmypaint runs a code generator that until recently was python2-only.
11 This changeset applies selected patches from upstream and makes
12 PYTHON_COMPAT 3.x-only. No references to python2 remain.
13
14 Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
15 Closes: https://github.com/gentoo/gentoo/pull/14553
16 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
17
18 ...t-generation-script-to-be-runnable-in-Py3.patch | 31 ++++++++++
19 ...0-drop-python2-requirement-recommendation.patch | 34 +++++++++++
20 media-libs/libmypaint/libmypaint-1.4.0-r1.ebuild | 71 ++++++++++++++++++++++
21 3 files changed, 136 insertions(+)
22
23 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
24 new file mode 100644
25 index 00000000000..8f4b713b3af
26 --- /dev/null
27 +++ b/media-libs/libmypaint/files/libmypaint-1.4.0-adjust-generation-script-to-be-runnable-in-Py3.patch
28 @@ -0,0 +1,31 @@
29 +From 748e735e7fffd2524bb3552fd79b2a2c13f60711 Mon Sep 17 00:00:00 2001
30 +From: Jesper Lloyd <jpl.lloyd@×××××.com>
31 +Date: Wed, 11 Dec 2019 18:02:35 +0100
32 +Subject: [PATCH] Adjust generation script to be runnable in Py3
33 +
34 +---
35 + generate.py | 4 +++-
36 + 1 file changed, 3 insertions(+), 1 deletion(-)
37 +
38 +diff --git a/generate.py b/generate.py
39 +index 6ab3dd0e..1e0b4ee9 100644
40 +--- a/generate.py
41 ++++ b/generate.py
42 +@@ -26,6 +26,7 @@
43 + import json
44 + from collections import namedtuple
45 +
46 ++PY3 = sys.version_info >= (3,)
47 +
48 + _SETTINGS = [] # brushsettings.settings
49 + _SETTING_ORDER = [
50 +@@ -82,7 +83,8 @@ def validate(self):
51 +
52 + def _init_globals_from_json(filename):
53 + """Populate global variables above from the canonical JSON definition."""
54 +- with open(filename, "rb") as fp:
55 ++ flag = "r" if PY3 else "rb"
56 ++ with open(filename, flag) as fp:
57 + defs = json.load(fp)
58 + for input_def in defs["inputs"]:
59 + input = _BrushInput(**input_def)
60
61 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
62 new file mode 100644
63 index 00000000000..1413868094d
64 --- /dev/null
65 +++ b/media-libs/libmypaint/files/libmypaint-1.4.0-drop-python2-requirement-recommendation.patch
66 @@ -0,0 +1,34 @@
67 +From 68e2c33add0aec09f1898aa80ef4f822bed67b87 Mon Sep 17 00:00:00 2001
68 +From: Jesper Lloyd <jpl.lloyd@×××××.com>
69 +Date: Tue, 17 Dec 2019 17:36:22 +0100
70 +Subject: [PATCH] Drop python2 requirement/recommendation
71 +
72 +---
73 + README.md | 2 +-
74 + autogen.sh | 2 +-
75 + generate.py | 2 +-
76 + 3 files changed, 3 insertions(+), 3 deletions(-)
77 +
78 +diff --git a/README.md b/README.md
79 +index 96c748da..fae90566 100644
80 +--- a/README.md
81 ++++ b/README.md
82 +@@ -35,7 +35,7 @@ to get started with a standard configuration:
83 +
84 + When building from git:
85 +
86 +- $ sudo apt install -y python2.7 autotools-dev intltool gettext libtool
87 ++ $ sudo apt install -y python autotools-dev intltool gettext libtool
88 +
89 + ### Install dependencies (Red Hat and derivatives)
90 +
91 +diff --git a/generate.py b/generate.py
92 +index b613f91d..cd7e99e8 100644
93 +--- a/generate.py
94 ++++ b/generate.py
95 +@@ -1,4 +1,4 @@
96 +-#!/usr/bin/env python2
97 ++#!/usr/bin/env python
98 + # libmypaint - The MyPaint Brush Library
99 + # Copyright (C) 2007-2012 Martin Renold <martinxyz@×××.ch>
100 + # Copyright (C) 2012-2016 by the MyPaint Development Team.
101
102 diff --git a/media-libs/libmypaint/libmypaint-1.4.0-r1.ebuild b/media-libs/libmypaint/libmypaint-1.4.0-r1.ebuild
103 new file mode 100644
104 index 00000000000..b72e0e05248
105 --- /dev/null
106 +++ b/media-libs/libmypaint/libmypaint-1.4.0-r1.ebuild
107 @@ -0,0 +1,71 @@
108 +# Copyright 1999-2020 Gentoo Authors
109 +# Distributed under the terms of the GNU General Public License v2
110 +
111 +EAPI=7
112 +PYTHON_COMPAT=( python3_{6,7,8} )
113 +
114 +inherit autotools python-any-r1 xdg-utils toolchain-funcs
115 +
116 +MY_PV=${PV/_beta/-beta.}
117 +MY_P=${PN}-${MY_PV}
118 +
119 +DESCRIPTION="Library for making brushstrokes"
120 +HOMEPAGE="https://github.com/mypaint/libmypaint"
121 +SRC_URI="https://github.com/mypaint/libmypaint/releases/download/v${MY_PV}/${MY_P}.tar.xz"
122 +
123 +LICENSE="ISC"
124 +SLOT="0/$(ver_cut 1-2)" # https://github.com/mypaint/libmypaint/wiki/Versioning
125 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
126 +IUSE="gegl introspection nls openmp"
127 +
128 +CDEPEND="
129 + dev-libs/glib:2
130 + dev-libs/json-c:=
131 + gegl? (
132 + media-libs/babl
133 + >=media-libs/gegl-0.4.14:0.4[introspection?]
134 + )
135 + introspection? ( >=dev-libs/gobject-introspection-1.32 )
136 + openmp? ( sys-devel/gcc:*[openmp] )
137 + nls? ( sys-devel/gettext )
138 + "
139 +DEPEND="${CDEPEND}
140 + ${PYTHON_DEPS}
141 + nls? ( dev-util/intltool )
142 + "
143 +RDEPEND="${CDEPEND}
144 + !<media-gfx/mypaint-1.2.1
145 + "
146 +
147 +S="${WORKDIR}"/${MY_P}
148 +
149 +PATCHES=(
150 + "${FILESDIR}"/${PN}-1.4.0-drop-libmypaint-gegl-versioning.patch
151 + "${FILESDIR}"/${PN}-1.4.0-gegl-0.4.14.patch
152 + "${FILESDIR}"/${PN}-1.4.0-adjust-generation-script-to-be-runnable-in-Py3.patch
153 + "${FILESDIR}"/${PN}-1.4.0-drop-python2-requirement-recommendation.patch
154 +)
155 +
156 +src_prepare() {
157 + xdg_environment_reset
158 + default
159 + eautoreconf
160 +}
161 +
162 +src_configure() {
163 + tc-ld-disable-gold # bug 589266
164 + econf \
165 + --disable-debug \
166 + --disable-docs \
167 + $(use_enable gegl) \
168 + --disable-gperftools \
169 + $(use_enable nls i18n) \
170 + $(use_enable introspection) \
171 + $(use_enable openmp) \
172 + --disable-profiling
173 +}
174 +
175 +src_install() {
176 + default
177 + find "${D}" -name '*.la' -type f -delete || die
178 +}