public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-sound/apetag/, media-sound/apetag/files/
@ 2020-08-23  9:36 Miroslav Šulc
  0 siblings, 0 replies; only message in thread
From: Miroslav Šulc @ 2020-08-23  9:36 UTC (permalink / raw
  To: gentoo-commits

commit:     c4983aece587ea393b87d30b6757069a5768c8e1
Author:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 23 09:36:28 2020 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Sun Aug 23 09:36:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4983aec

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 <AT> gentoo.org>

 media-sound/apetag/apetag-1.12-r3.ebuild       |  57 +++++++++++++
 media-sound/apetag/files/apetag-1.12-py3.patch | 112 +++++++++++++++++++++++++
 2 files changed, 169 insertions(+)

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 00000000000..c485ce96090
--- /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 00000000000..c91f5c1a37a
--- /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)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-23  9:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-23  9:36 [gentoo-commits] repo/gentoo:master commit in: media-sound/apetag/, media-sound/apetag/files/ Miroslav Šulc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox