[PATCH 0/2] gnu: easytag: Fix mp3 support.

  • Done
  • quality assurance status badge
Details
2 participants
  • Danny Milosavljevic
  • Pierre Langlois
Owner
unassigned
Submitted by
Pierre Langlois
Severity
normal
P
P
Pierre Langlois wrote on 12 Oct 2019 23:25
(address . guix-patches@gnu.org)(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
87tv8dy7uc.fsf@gmx.com
Hello Guix!

EasyTag hasn't been working for mp3 files and I couldn't work out why for a
long time. I've finally got around to looking into it properly and it turns
the hack with the temporary .pc file I added back then didn't work because
it's missing some fields.

With that fixed though, EasyTag warns you with a popup that id3lib is buggy
and needs patching. It's something about UTF16 being broken:
applies the same patch.

WDYT?

Pierre Langlois (2):
gnu: id3lib: Apply patch for UTF16 writing bug.
gnu: easytag: Fix mp3 support.

gnu/local.mk | 1 +
gnu/packages/mp3.scm | 5 ++-
gnu/packages/music.scm | 12 ++++--
.../patches/id3lib-UTF16-writing-bug.patch | 39 +++++++++++++++++++
4 files changed, 52 insertions(+), 5 deletions(-)
create mode 100644 gnu/packages/patches/id3lib-UTF16-writing-bug.patch

--
2.23.0
P
P
Pierre Langlois wrote on 12 Oct 2019 23:29
[PATCH 1/2] gnu: id3lib: Apply patch for UTF16 writing bug.
(address . 37720@debbugs.gnu.org)(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
20191012212918.23515-1-pierre.langlois@gmx.com
* gnu/packages/mp3.scm (id3lib)[patches]: Add
"id3lib-UTF16-writing-bug.patch".
* gnu/packages/patches/id3lib-UTF16-writing-bug.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
gnu/local.mk | 1 +
gnu/packages/mp3.scm | 5 ++-
.../patches/id3lib-UTF16-writing-bug.patch | 39 +++++++++++++++++++
3 files changed, 43 insertions(+), 2 deletions(-)
create mode 100644 gnu/packages/patches/id3lib-UTF16-writing-bug.patch

Toggle diff (80 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 0a4ee7c986..f99711e1ac 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -975,6 +975,7 @@ dist_patch_DATA = \
%D%/packages/patches/icedtea-6-hotspot-gcc-segfault-workaround.patch \
%D%/packages/patches/icedtea-7-hotspot-gcc-segfault-workaround.patch \
%D%/packages/patches/id3lib-CVE-2007-4460.patch \
+ %D%/packages/patches/id3lib-UTF16-writing-bug.patch \
%D%/packages/patches/ilmbase-fix-tests.patch \
%D%/packages/patches/ilmbase-openexr-pkg-config.patch \
%D%/packages/patches/inkscape-poppler-0.76.patch \
diff --git a/gnu/packages/mp3.scm b/gnu/packages/mp3.scm
index a218071edb..9a1cf60c2e 100644
--- a/gnu/packages/mp3.scm
+++ b/gnu/packages/mp3.scm
@@ -4,7 +4,7 @@
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
-;;; Copyright © 2017 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2017, 2019 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
@@ -123,7 +123,8 @@ versions of ID3v2.")
(modules '((guix build utils)))
;; Don't use bundled zlib
(snippet '(begin (delete-file-recursively "zlib") #t))
- (patches (search-patches "id3lib-CVE-2007-4460.patch"))))
+ (patches (search-patches "id3lib-CVE-2007-4460.patch"
+ "id3lib-UTF16-writing-bug.patch"))))
(build-system gnu-build-system)
(inputs `(("zlib" ,zlib)))
(arguments
diff --git a/gnu/packages/patches/id3lib-UTF16-writing-bug.patch b/gnu/packages/patches/id3lib-UTF16-writing-bug.patch
new file mode 100644
index 0000000000..b05d2cf298
--- /dev/null
+++ b/gnu/packages/patches/id3lib-UTF16-writing-bug.patch
@@ -0,0 +1,39 @@
+diff -ruN id3lib-3.8.3.orig/ChangeLog id3lib-3.8.3/ChangeLog
+--- id3lib-3.8.3.orig/ChangeLog 2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/ChangeLog 2006-02-22 00:33:59.946214472 +0100
+@@ -1,3 +1,8 @@
++2006-02-17 Jerome Couderc
++
++ * Patch from Spoon to fix UTF-16 writing bug
++ http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
++
+ 2003-03-02 Sunday 17:38 Thijmen Klok <thijmen@id3lib.org>
+
+ * THANKS (1.20): added more people
+diff -ruN id3lib-3.8.3.orig/src/io_helpers.cpp id3lib-3.8.3/src/io_helpers.cpp
+--- id3lib-3.8.3.orig/src/io_helpers.cpp 2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/src/io_helpers.cpp 2006-02-22 00:35:02.926639992 +0100
+@@ -363,11 +363,22 @@
+ // Write the BOM: 0xFEFF
+ unicode_t BOM = 0xFEFF;
+ writer.writeChars((const unsigned char*) &BOM, 2);
++ // Patch from Spoon : 2004-08-25 14:17
++ // http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
++ // Wrong code
++ //for (size_t i = 0; i < size; i += 2)
++ //{
++ // unicode_t ch = (data[i] << 8) | data[i+1];
++ // writer.writeChars((const unsigned char*) &ch, 2);
++ //}
++ // Right code
++ unsigned char *pdata = (unsigned char *) data.c_str();
+ for (size_t i = 0; i < size; i += 2)
+ {
+- unicode_t ch = (data[i] << 8) | data[i+1];
++ unicode_t ch = (pdata[i] << 8) | pdata[i+1];
+ writer.writeChars((const unsigned char*) &ch, 2);
+ }
++ // End patch
+ }
+ return writer.getCur() - beg;
+ }
--
2.23.0
P
P
Pierre Langlois wrote on 12 Oct 2019 23:30
[PATCH 2/2] gnu: easytag: Fix mp3 support.
(address . 37720@debbugs.gnu.org)(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
20191012213008.23574-1-pierre.langlois@gmx.com
* gnu/packages/music.scm (easytag)[arguments]: Add 'Name', 'Description' and
'Version' entries to temporary id3tag.pc pkg-config file. Terminate phases
with #t.
---
gnu/packages/music.scm | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index ac4333168c..4c74ae5ffa 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -11,7 +11,7 @@
;;; Copyright © 2017 ng0 <ng0@n0.is>
;;; Copyright © 2017 Rodger Fox <thylakoid@openmailbox.org>
;;; Copyright © 2017, 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
-;;; Copyright © 2017, 2018 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2017, 2018, 2019 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 nee <nee.git@hidamari.blue>
@@ -593,12 +593,17 @@ enable professional yet simple and intuitive pattern-based drum programming.")
"prefix=~@*~a~@
libdir=${prefix}/lib~@
includedir=${prefix}/include~@
+
+ Name: libid3tag~@
+ Description:~@
+ Version:~@
Libs: -L${libdir} -lid3tag -lz~@
Cflags: -I${includedir}~%"
libid3tag)))
(setenv "PKG_CONFIG_PATH"
(string-append (getenv "PKG_CONFIG_PATH")
- ":" (getcwd) "/pkgconfig")))))
+ ":" (getcwd) "/pkgconfig"))
+ #t)))
(add-after 'unpack 'patch-makefile
(lambda _
(substitute* "Makefile.in"
@@ -606,7 +611,8 @@ enable professional yet simple and intuitive pattern-based drum programming.")
;; script with /bin/sh hard-coded.
(("/bin/sh") (which "sh"))
;; Don't create 'icon-theme.cache'.
- (("gtk-update-icon-cache") "true")))))))
+ (("gtk-update-icon-cache") "true"))
+ #t)))))
(home-page "https://wiki.gnome.org/Apps/EasyTAG")
(synopsis "Simple application for viewing and editing tags in audio files")
(description
--
2.23.0
D
D
Danny Milosavljevic wrote on 13 Oct 2019 14:09
Re: [bug#37720] [PATCH 0/2] gnu: easytag: Fix mp3 support.
(name . Pierre Langlois)(address . pierre.langlois@gmx.com)(address . 37720-done@debbugs.gnu.org)
20191013140924.0e966e3f@scratchpost.org
Hi Pierre,

On Sat, 12 Oct 2019 22:25:31 +0100
Pierre Langlois <pierre.langlois@gmx.com> wrote:

Toggle quote (2 lines)
> WDYT?

Looks good to me, so I pushed the patchset to guix master.

(It's unfortunately that char signedness is unspecified in the C standard.
That maybe made sense in 1980--not today. Sigh)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl2jE/QACgkQ5xo1VCww
uqXx5wf9HQhEy0VLeSUT9raEQwvzMDi0jV3pS2hIdr6lADiRnMp4kpSgns08Lxry
xF3YkKQ7N/RTjNTCgp6iMpLmNT5FQyTxGf3Lepamxee2biYeRL864ddmeRpJnLtK
4w6qQmns8mCGZqkB16ARHlokQUo2tOcaEdWzt3HPzG4koePAZLft7vcWb+gfcwVj
b7IfnXGnsQCNnSTAg5wwI1Q3pavKoMWnlyhXAKX2Afwzm59tBbLCOcq96zn6GUnp
1ga/vpRAsRexTzgVmAvcPtP3WTGMYq67coo4tr0cgsNaP7TvQ+5O3n0aaeRJxit/
n0YWZtuuBRHBsYzn29WZKzPMjzj+Jw==
=W0pZ
-----END PGP SIGNATURE-----


Closed
?