public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/mypaint/
Date: Mon, 31 Mar 2025 16:33:04 +0000 (UTC)	[thread overview]
Message-ID: <1743438712.5a04eede34734659c7bf34fae34a1de4bb15babf.sam@gentoo> (raw)

commit:     5a04eede34734659c7bf34fae34a1de4bb15babf
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 31 16:31:11 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 31 16:31:52 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a04eede

media-gfx/mypaint: port to python-single-r1

The package isn't suitable for PEP517, as it installs data files and
it simply happens to be written in Python, rather than intending to be
imported and so on.

Unfortunately, for the remaining PEP517 holdouts, there's little pressure
upstream for them to port to a proper build system yet, as while setuptools
deprecated the `setup.py` entrypoint some time ago, there's no removal
in sight yet, so the only pressing side is on Gentoo's where we want
to cleanup distutils-r1's support for that.

It was arguably a mistake to really have these packages use distutils-r1
in the first place.

The obvious workaround for now is to invoke setup.py manually w/ python-single-r1,
and punt the question until setuptools removal of the entrypoint looks
closer (at which time, other distros will be putting pressure on upstreams
too). Of course, if at the time of such a setuptools change, the package
is still not fixed, then we'd have to remove it.

(In this case, upstream are preparing a port to Meson.)

Bug: https://bugs.gentoo.org/836232
Closes: https://bugs.gentoo.org/909985
Closes: https://bugs.gentoo.org/927525
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-gfx/mypaint/mypaint-2.0.1-r4.ebuild | 88 +++++++++++++++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/media-gfx/mypaint/mypaint-2.0.1-r4.ebuild b/media-gfx/mypaint/mypaint-2.0.1-r4.ebuild
new file mode 100644
index 000000000000..b48b461f743e
--- /dev/null
+++ b/media-gfx/mypaint/mypaint-2.0.1-r4.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+
+inherit desktop edo python-single-r1 xdg
+
+DESCRIPTION="Fast and easy graphics application for digital painters"
+HOMEPAGE="http://mypaint.app/"
+SRC_URI="https://github.com/mypaint/${PN}/releases/download/v${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="openmp"
+LANGS="cs de en_CA en_GB es fr hu id it ja ko nb nn_NO pl pt_BR ro ru sl sv uk zh_CN zh_TW"
+# Relies on setup.py test (long-removed) and nose (also long-removed)
+# See bug #927525 and https://github.com/mypaint/mypaint/issues/1191
+RESTRICT="test"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+	${PYTHON_DEPS}
+	$(python_gen_cond_dep '
+		dev-python/pygobject:3[${PYTHON_USEDEP}]
+		dev-python/numpy[${PYTHON_USEDEP}]
+		>=dev-python/pycairo-1.4[${PYTHON_USEDEP}]
+		dev-python/protobuf[${PYTHON_USEDEP}]
+	')
+	>=dev-libs/json-c-0.11:=
+	gnome-base/librsvg
+	media-gfx/mypaint-brushes:2.0
+	media-libs/lcms:2
+	>=media-libs/libmypaint-1.5.0[openmp?]
+	media-libs/libpng:=
+	sys-devel/gettext
+	llvm-runtimes/openmp
+	x11-libs/gdk-pixbuf[jpeg]
+	x11-libs/gtk+:3
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	${PYTHON_DEPS}
+	$(python_gen_cond_dep '
+		dev-python/setuptools[${PYTHON_USEDEP}]
+	')
+	dev-lang/swig
+	sys-devel/gettext
+	virtual/pkgconfig
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.0.1-r1-build-system.patch
+	"${FILESDIR}"/${P}-GIL-hold.patch
+	"${FILESDIR}"/${P}-setuptools.patch
+	"${FILESDIR}"/${PN}-2.0.1-python3.11.patch
+)
+
+src_compile() {
+	# --disable-openmp can't be passed to setup.py build,
+	# only setup.py build_ext.
+	# Trying to call build_ext then build and such fails.
+	#
+	# We just override the environment instead for simplicity.
+	local openmp=$(usex openmp '-fopenmp' '-fno-openmp')
+
+	local -x OPENMP_CFLAG="${openmp}" OPENMP_LDFLAG="${openmp}"
+	edo ${EPYTHON} setup.py build
+}
+
+src_install() {
+	edo ${EPYTHON} setup.py install --prefix="${EPREFIX}/usr" --root="${D}"
+	python_fix_shebang "${ED}"/usr/bin
+	python_optimize
+	python_optimize "${ED}/usr/lib/mypaint"
+	einstalldocs
+
+	newicon pixmaps/${PN}_logo.png ${PN}.png
+
+	local lang=
+	for lang in ${LANGS}; do
+		if ! has ${lang} ${LINGUAS}; then
+			rm -rf "${ED}"/usr/share/locale/${lang} || die
+		fi
+	done
+}


             reply	other threads:[~2025-03-31 16:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 16:33 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-10-01 22:23 [gentoo-commits] repo/gentoo:master commit in: media-gfx/mypaint/ Sam James
2025-10-01 22:23 Sam James
2025-06-06 14:42 Sam James
2025-06-03  3:32 Sam James
2025-06-03  3:32 Sam James
2025-06-03  3:30 Sam James
2025-04-09 13:44 Michał Górny
2025-04-02  9:28 Arthur Zamarin
2025-04-02  9:28 Arthur Zamarin
2024-07-17  5:54 Sam James
2024-03-06 19:47 Arthur Zamarin
2023-12-28  3:43 Sam James
2023-06-04 15:49 Arthur Zamarin
2023-03-10  8:21 Arthur Zamarin
2023-03-09  8:54 Sam James
2022-01-04 20:45 Sam James
2020-10-20  9:07 Sam James
2020-09-25  8:46 Agostino Sarubbo
2020-09-19 21:29 Sam James
2020-09-18 13:56 Sam James
2020-08-16 19:48 Sam James
2020-02-09 16:29 Michał Górny
2020-01-22 21:50 Michał Górny
2020-01-16  6:39 Michał Górny
2019-04-01 17:21 Thomas Deutschmann
2019-03-17 18:13 Agostino Sarubbo
2018-10-13 17:36 Pacho Ramos
2018-10-13 17:36 Pacho Ramos
2018-08-08 17:22 Sebastian Pipping
2018-07-31 22:05 Michał Górny
2018-04-30 15:58 Mike Gilbert
2018-01-05 22:02 Ulrich Müller
2017-09-21 21:06 Mike Gilbert
2017-01-22  0:18 Lars Wendler
2016-12-20 15:51 Tobias Klausmann
2016-03-06 11:45 Markos Chandras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1743438712.5a04eede34734659c7bf34fae34a1de4bb15babf.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox