diff options
author | Miroslav Šulc <fordfrog@gentoo.org> | 2020-08-23 11:36:28 +0200 |
---|---|---|
committer | Miroslav Šulc <fordfrog@gentoo.org> | 2020-08-23 11:36:45 +0200 |
commit | c4983aece587ea393b87d30b6757069a5768c8e1 (patch) | |
tree | 15301791384a3cbda1f0d24c1d1c40f8492b46bc /media-sound/apetag | |
parent | dev-haskell/dav: drop old (diff) | |
download | gentoo-c4983aece587ea393b87d30b6757069a5768c8e1.tar.gz gentoo-c4983aece587ea393b87d30b6757069a5768c8e1.tar.bz2 gentoo-c4983aece587ea393b87d30b6757069a5768c8e1.zip |
media-sound/apetag: switched to py3 in 1.12-r3
Closes: https://bugs.gentoo.org/735378
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'media-sound/apetag')
-rw-r--r-- | media-sound/apetag/apetag-1.12-r3.ebuild | 57 | ||||
-rw-r--r-- | media-sound/apetag/files/apetag-1.12-py3.patch | 112 |
2 files changed, 169 insertions, 0 deletions
diff --git a/media-sound/apetag/apetag-1.12-r3.ebuild b/media-sound/apetag/apetag-1.12-r3.ebuild new file mode 100644 index 000000000000..c485ce960902 --- /dev/null +++ b/media-sound/apetag/apetag-1.12-r3.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7,8,9} ) + +inherit python-single-r1 toolchain-funcs + +DESCRIPTION="Command-line ape 2.0 tagger" +HOMEPAGE="http://muth.org/Robert/Apetag/" +SRC_URI="http://muth.org/Robert/Apetag/${PN}.${PV}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" +IUSE="" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RDEPEND="${PYTHON_DEPS}" +DEPEND="${RDEPEND}" + +S=${WORKDIR}/${PN^} + +DOCS=( 00readme ) + +PATCHES=( + "${FILESDIR}/${P}-py3.patch" +) + +src_prepare() { + default + sed -i \ + -e 's:CXXDEBUG:LDFLAGS:' \ + Makefile || die + python_fix_shebang *.py +} + +src_compile() { + tc-export CXX + emake \ + CXXFLAGS="${CXXFLAGS} -Wall -pedantic" \ + LDFLAGS="${LDFLAGS}" +} + +src_install() { + dobin ${PN} + + python_moduleinto /usr/lib/apetag + python_domodule *.py + + fperms +x /usr/lib/apetag/{rmid3tag,tagdir}.py + dosym ../lib/apetag/rmid3tag.py /usr/bin/rmid3tag.py + dosym ../lib/apetag/tagdir.py /usr/bin/tagdir.py + + einstalldocs +} diff --git a/media-sound/apetag/files/apetag-1.12-py3.patch b/media-sound/apetag/files/apetag-1.12-py3.patch new file mode 100644 index 000000000000..c91f5c1a37a0 --- /dev/null +++ b/media-sound/apetag/files/apetag-1.12-py3.patch @@ -0,0 +1,112 @@ +diff --git a/cddb.py b/cddb.py +index f30b3b7..c9cb6dd 100755 +--- a/cddb.py ++++ b/cddb.py +@@ -131,7 +131,7 @@ class Toc: + track = int(match.group(1)) + self._trackext[track] = self._trackext[track] + match.group(2) + continue +- raise SyntaxError, "BAD LINE:" + line ++ raise SyntaxError("BAD LINE:" + line) + + components = self._disctitle.split("/", 1) + self._discartist = components[0].strip() +@@ -160,18 +160,18 @@ class Toc: + return len(self._tracktitle) + + def dump(self): +- print "DISCID: " + self._discid +- print "DISCTITLE: " + self._disctitle +- print "DISKEXT: " + self._discext +- print "TRACK TITLES" ++ print("DISCID: " + self._discid) ++ print("DISCTITLE: " + self._disctitle) ++ print("DISKEXT: " + self._discext) ++ print("TRACK TITLES") + for k in range(len(self._tracktitle)): +- print "%2d:" % k, self._tracktitle[k] +- print "TRACK EXTS" ++ print("%2d:" % k, self._tracktitle[k]) ++ print("TRACK EXTS") + for k in range(len(self._trackext)): +- print "%2d:" % k, self._trackext[k] +- print "TRACK TIMES" ++ print("%2d:" % k, self._trackext[k]) ++ print("TRACK TIMES") + for k in range(len(self._tracktimes)): +- print "%2d:" % k, self._tracktimes[k] ++ print("%2d:" % k, self._tracktimes[k]) + return + + # ====================================================================== +diff --git a/rmid3tag.py b/rmid3tag.py +index 36abe7f..e218638 100755 +--- a/rmid3tag.py ++++ b/rmid3tag.py +@@ -32,7 +32,7 @@ import logging + + # ====================================================================== + def usage(): +- print USAGE ++ print(USAGE) + return -1 + + # ====================================================================== +@@ -44,7 +44,7 @@ def process_file(name): + pos = inp.tell() + tag = inp.read(3) + if tag == "TAG": +- print name + ": found id3v1 tag - truncating at 0x%08x" % pos ++ print(name + ": found id3v1 tag - truncating at 0x%08x" % pos) + inp.truncate(pos) + else: + logging.warning(name + ": no id3v1 tag found\n") +diff --git a/tagdir.py b/tagdir.py +index 87223ef..f45aa9a 100755 +--- a/tagdir.py ++++ b/tagdir.py +@@ -188,7 +188,7 @@ def tag_files(files, toc, cmdpattern, test, verbose): + + realcmd = [tok % args for tok in cmdpattern] + if verbose: +- print realcmd ++ print(realcmd) + if not test: + ret = os.spawnvp(os.P_WAIT, realcmd[0], realcmd) + if ret: +@@ -201,7 +201,7 @@ def mode_dump(files): + perform read test and all (toc) files and dump their content + """ + for i in files: +- print "TOC: ", i ++ print("TOC: ", i) + if not os.access(i, os.R_OK): + logging.warning("cannot open " + i) + continue +@@ -218,7 +218,7 @@ def mode_toc(tocpath, test, check, verbose): + """ + try: + toc = cddb.Toc(tocpath) +- except Exception, ex: ++ except Exception as ex: + logging.error("cannot open toc file at %s %s", + os.path.abspath(tocpath), str(ex)) + return -1 +@@ -261,7 +261,7 @@ def main(argv): + try: + opts, args = getopt.getopt(argv, "t:m:v") + except getopt.error: +- print USAGE ++ print(USAGE) + return -1 + + mode = "tag" +@@ -276,7 +276,7 @@ def main(argv): + verbose = 1 + else: + logging.error("bad option: >" + opt + "<") +- print USAGE ++ print(USAGE) + return -1 + if mode == "dump": + return mode_dump(args) |