commit: 6f5491139c1b6773e5f49fc7018681f5c5bb7b2e Author: Louis Sautier <sbraz <AT> gentoo <DOT> org> AuthorDate: Thu Aug 26 18:01:38 2021 +0000 Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org> CommitDate: Sat Aug 28 17:46:11 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f549113
media-sound/picard: add 2.6.3, enable py3.10 and tests, fix deps * Bump to 2.6.3. * Add Python 3.10 support. * Enable tests. * Fix Python dependencies. * Remove unnecessary dependency on qtgui (pulled by PyQt5[gui]). * Remove the postinst message added as a workaround for a bug in 2008. Closes: https://bugs.gentoo.org/760099 Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org> media-sound/picard/Manifest | 1 + .../picard/files/picard-2.6.3-fix-py3.10.patch | 61 ++++++++++++++++++++ media-sound/picard/picard-2.6.3.ebuild | 67 ++++++++++++++++++++++ 3 files changed, 129 insertions(+) diff --git a/media-sound/picard/Manifest b/media-sound/picard/Manifest index ebbe370f66f..8c10e10ee9b 100644 --- a/media-sound/picard/Manifest +++ b/media-sound/picard/Manifest @@ -1 +1,2 @@ DIST picard-2.6.2.tar.gz 4318817 BLAKE2B 9b4b9837fc7703368f28f2451c230ee9cb4826b61a970c514162bf615461d942512764661295bba98499000e781662e3a001c5fc91571abbafce8d7bc7418a63 SHA512 01fc8f49b273edbd020e3c9f91d622e60a84421b6de9dfd584d086224897b81f5e7c3f94616341c56f952774af7d912a8369d8fff4e47f19e00324c4f6944225 +DIST picard-2.6.3.tar.gz 4320046 BLAKE2B ce308440ed4c6297128a5470b7bdced50fb22e62995c26670339ff71c70d610fc0c4ea8433f9dbacb197b710b8100de171817df604d76986596391d029b3c20f SHA512 71bdeb4777a0d996ac0093edefc448a348aa72e657ec639331e67257c47c389993d2715ccebf715458c3b606051154586d63b22b3cebd541d8b2da5e96a833b5 diff --git a/media-sound/picard/files/picard-2.6.3-fix-py3.10.patch b/media-sound/picard/files/picard-2.6.3-fix-py3.10.patch new file mode 100644 index 00000000000..772cbda3868 --- /dev/null +++ b/media-sound/picard/files/picard-2.6.3-fix-py3.10.patch @@ -0,0 +1,61 @@ +From 452bba954c30d5a642f03c02411529f511bda786 Mon Sep 17 00:00:00 2001 +From: Louis Sautier <sautier.lo...@gmail.com> +Date: Fri, 27 Aug 2021 00:43:48 +0200 +Subject: [PATCH] Fix TypeErrors with Python 3.10 + +Without these changes, running Picard with Python 3.10 results in errors +such as: + File "./picard/ui/coverartbox.py", line 74, in __init__ + self.shadow = self.shadow.scaled(w, h, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) +TypeError: arguments did not match any overloaded call: + scaled(self, int, int, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float' + scaled(self, QSize, aspectRatioMode: Qt.AspectRatioMode = Qt.IgnoreAspectRatio, transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float' +--- + picard/ui/coverartbox.py | 2 +- + picard/ui/itemviews.py | 6 +++--- + picard/util/__init__.py | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/picard/ui/coverartbox.py b/picard/ui/coverartbox.py +index c3eb4ddb74..f3a174664b 100644 +--- a/picard/ui/coverartbox.py ++++ b/picard/ui/coverartbox.py +@@ -135,7 +135,7 @@ def dropEvent(self, event): + event.acceptProposedAction() + + def scaled(self, *dimensions): +- return (self.pixel_ratio * dimension for dimension in dimensions) ++ return (round(self.pixel_ratio * dimension) for dimension in dimensions) + + def show(self): + self.set_data(self.data, True) +diff --git a/picard/ui/itemviews.py b/picard/ui/itemviews.py +index cffab6d70d..d1101b340f 100644 +--- a/picard/ui/itemviews.py ++++ b/picard/ui/itemviews.py +@@ -141,9 +141,9 @@ def get_match_color(similarity, basecolor): + c1 = (basecolor.red(), basecolor.green(), basecolor.blue()) + c2 = (223, 125, 125) + return QtGui.QColor( +- c2[0] + (c1[0] - c2[0]) * similarity, +- c2[1] + (c1[1] - c2[1]) * similarity, +- c2[2] + (c1[2] - c2[2]) * similarity) ++ int(c2[0] + (c1[0] - c2[0]) * similarity), ++ int(c2[1] + (c1[1] - c2[1]) * similarity), ++ int(c2[2] + (c1[2] - c2[2]) * similarity)) + + + class MainPanel(QtWidgets.QSplitter): +diff --git a/picard/util/__init__.py b/picard/util/__init__.py +index 3a4765f7cd..26f7576f56 100644 +--- a/picard/util/__init__.py ++++ b/picard/util/__init__.py +@@ -400,7 +400,7 @@ def throttled_func(*args, **kwargs): + else: + decorator.args = args + decorator.kwargs = kwargs +- QtCore.QTimer.singleShot(r, later) ++ QtCore.QTimer.singleShot(int(r), later) + decorator.is_ticking = True + mutex.unlock() + diff --git a/media-sound/picard/picard-2.6.3.ebuild b/media-sound/picard/picard-2.6.3.ebuild new file mode 100644 index 00000000000..2c7f465e744 --- /dev/null +++ b/media-sound/picard/picard-2.6.3.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) +DISTUTILS_SINGLE_IMPL=1 + +inherit distutils-r1 xdg + +if [[ ${PV} = *9999* ]]; then + EGIT_REPO_URI="https://github.com/metabrainz/picard" + inherit git-r3 +else + SRC_URI="https://musicbrainz.osuosl.org/pub/musicbrainz/${PN}/${P}.tar.gz" + KEYWORDS="~amd64 ~x86" + S="${WORKDIR}/${PN}-release-${PV}" +fi + +DESCRIPTION="Cross-platform music tagger" +HOMEPAGE="https://picard.musicbrainz.org" + +LICENSE="GPL-2+" +SLOT="0" +IUSE="discid fingerprints nls" + +BDEPEND=" + nls? ( dev-qt/linguist-tools:5 ) +" +RDEPEND=" + $(python_gen_cond_dep ' + dev-python/fasteners[${PYTHON_USEDEP}] + dev-python/PyQt5[declarative,gui,network,widgets,${PYTHON_USEDEP}] + dev-python/python-dateutil[${PYTHON_USEDEP}] + media-libs/mutagen[${PYTHON_USEDEP}] + discid? ( dev-python/python-discid[${PYTHON_USEDEP}] ) + ') + fingerprints? ( media-libs/chromaprint[tools] ) +" + +distutils_enable_tests pytest + +PATCHES=( + # https://github.com/metabrainz/picard/commit/452bba954c30d5a642f03c02411529f511bda786 + "${FILESDIR}/${P}-fix-py3.10.patch" +) + +python_compile() { + local build_args=( + --disable-autoupdate + ) + if ! use nls; then + build_args+=( --disable-locales ) + fi + distutils-r1_python_compile ${build_args[@]} +} + +python_install() { + local install_args=( + --disable-autoupdate + --skip-build + ) + if ! use nls; then + install_args+=( --disable-locales ) + fi + distutils-r1_python_install ${install_args[@]} +}