GNU bug report logs - #33042
[PATCH] gnu: Add soundconverter.

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Sun, 14 Oct 2018 20:19:01 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33042 in the body.
You can then email your comments to 33042 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#33042; Package guix-patches. (Sun, 14 Oct 2018 20:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Baines <mail <at> cbaines.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 14 Oct 2018 20:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add soundconverter.
Date: Sun, 14 Oct 2018 21:18:10 +0100
* gnu/packages/gnome.scm (soundconverter): New variable.
---
 gnu/packages/gnome.scm | 61 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index de938e4b14..ab7352e104 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -7220,6 +7220,67 @@ It supports ripping to any audio codec supported by a GStreamer plugin, such as
 mp3, Ogg Vorbis and FLAC")
     (license license:gpl2+)))
 
+(define-public soundconverter
+  (package
+    (name "soundconverter")
+    (version "3.0.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://launchpad.net/soundconverter/trunk/"
+                           version "/+download/"
+                           "soundconverter-" version ".tar.xz"))
+
+       (sha256
+        (base32
+         "1wrxf5py54xplrf97qp24pzbis0cvax5c6k0c7vr3z3ry8r7gd7c"))
+       (patches
+        (list
+         (origin
+           (method url-fetch)
+           (uri (string-append
+                 "https://salsa.debian.org/multimedia-team/soundconverter"
+                 "/raw/master/debian/patches/"
+                 "0002-Only-fetch-profiles-if-GConf-is-still-available.patch"))
+           (sha256
+            (base32
+             "00nxpbkz7ihzrbz91ms7bd2mjgyhkbxpaa8zxj4xnkv4pjmg61hh")))))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-POTFILES.in
+           (lambda _
+             (substitute* "po/POTFILES.in"
+               (("soundconverter/gconfstore\\.py") ""))))
+         (add-after 'install 'wrap-rhythmbox
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out               (assoc-ref outputs "out"))
+                   (python-path       (getenv "PYTHONPATH"))
+                   (gi-typelib-path   (getenv "GI_TYPELIB_PATH"))
+                   (gst-plugin-path   (getenv "GST_PLUGIN_SYSTEM_PATH")))
+               (wrap-program (string-append out "/bin/soundconverter")
+                 `("PYTHONPATH"             ":" prefix (,python-path))
+                 `("GI_TYPELIB_PATH"        ":" prefix (,gi-typelib-path))
+                 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
+             #t)))))
+    (native-inputs
+     `(("intltool" ,intltool)
+       ("pkg-config" ,pkg-config)
+       ("glib:bin" ,glib "bin")))
+    (inputs
+     `(("gtk+" ,gtk+)
+       ("python" ,python)
+       ("python-pygobject" ,python-pygobject)
+       ("gstreamer" ,gstreamer)))
+    (home-page "http://soundconverter.org/")
+    (synopsis "Audio file converter for the GNOME Desktop")
+    (description
+     "SoundConverter supports converting between many audio formats including
+Opus, Ogg Vorbis, FLAC and more.  It supports parallel conversion, and
+configurable file renaming. ")
+    (license license:gpl3)))
+
 (define-public workrave
   (let ((commit "v1_10_21"))
     (package
-- 
2.19.1





Information forwarded to guix-patches <at> gnu.org:
bug#33042; Package guix-patches. (Tue, 16 Oct 2018 16:44:01 GMT) Full text and rfc822 format available.

Message #8 received at 33042 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 33042 <at> debbugs.gnu.org
Subject: Re: [bug#33042] [PATCH] gnu: Add soundconverter.
Date: Tue, 16 Oct 2018 12:43:27 -0400
[Message part 1 (text/plain, inline)]
On Sun, Oct 14, 2018 at 09:18:10PM +0100, Christopher Baines wrote:
> * gnu/packages/gnome.scm (soundconverter): New variable.

Thanks, it's nice to have graphical programs for this sort of task :)

> +       (patches
> +        (list
> +         (origin
> +           (method url-fetch)
> +           (uri (string-append
> +                 "https://salsa.debian.org/multimedia-team/soundconverter"
> +                 "/raw/master/debian/patches/"
> +                 "0002-Only-fetch-profiles-if-GConf-is-still-available.patch"))
> +           (sha256
> +            (base32
> +             "00nxpbkz7ihzrbz91ms7bd2mjgyhkbxpaa8zxj4xnkv4pjmg61hh")))))))

I think it's better if we include this file in our source code, since
it's not very big and Debian's code infrastructure URLs seem to change
every few years. Also, the URL is not versioned, so maybe the patch
would change in the future.

> +         (add-after 'unpack 'fix-POTFILES.in
> +           (lambda _
> +             (substitute* "po/POTFILES.in"
> +               (("soundconverter/gconfstore\\.py") ""))))

Please add an explanatory comment for this.

> +         (add-after 'install 'wrap-rhythmbox
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let ((out               (assoc-ref outputs "out"))
> +                   (python-path       (getenv "PYTHONPATH"))
> +                   (gi-typelib-path   (getenv "GI_TYPELIB_PATH"))
> +                   (gst-plugin-path   (getenv "GST_PLUGIN_SYSTEM_PATH")))
> +               (wrap-program (string-append out "/bin/soundconverter")
> +                 `("PYTHONPATH"             ":" prefix (,python-path))
> +                 `("GI_TYPELIB_PATH"        ":" prefix (,gi-typelib-path))
> +                 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
> +             #t)))))

If possible, I think it's better to use the python-build-system's wrap
phase for PYTHONPATH. The hplip package has an example.

> +    (synopsis "Audio file converter for the GNOME Desktop")

It works in i3, too :)
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33042; Package guix-patches. (Fri, 19 Oct 2018 13:44:01 GMT) Full text and rfc822 format available.

Message #11 received at 33042 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: 33042 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Add soundconverter.
Date: Fri, 19 Oct 2018 14:43:25 +0100
* gnu/packages/gnome.scm (soundconverter): New variable.
* gnu/packages/patches/soundconverter-remove-gconf-dependency.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/gnome.scm                        | 65 +++++++++++++++
 ...undconverter-remove-gconf-dependency.patch | 83 +++++++++++++++++++
 3 files changed, 149 insertions(+)
 create mode 100644 gnu/packages/patches/soundconverter-remove-gconf-dependency.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index af3773c893..6108ba8b82 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1146,6 +1146,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/slim-reset.patch				\
   %D%/packages/patches/slim-login.patch				\
   %D%/packages/patches/sooperlooper-build-with-wx-30.patch 	\
+  %D%/packages/patches/soundconverter-remove-gconf-dependency.patch	\
   %D%/packages/patches/soundtouch-CVE-2018-14044-14045.patch 	\
   %D%/packages/patches/soundtouch-CVE-2018-1000223.patch 	\
   %D%/packages/patches/steghide-fixes.patch			\
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index de938e4b14..2b75439a95 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -7220,6 +7220,71 @@ It supports ripping to any audio codec supported by a GStreamer plugin, such as
 mp3, Ogg Vorbis and FLAC")
     (license license:gpl2+)))
 
+(define-public soundconverter
+  (package
+    (name "soundconverter")
+    (version "3.0.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://launchpad.net/soundconverter/trunk/"
+                           version "/+download/"
+                           "soundconverter-" version ".tar.xz"))
+
+       (sha256
+        (base32
+         "1wrxf5py54xplrf97qp24pzbis0cvax5c6k0c7vr3z3ry8r7gd7c"))
+       (patches
+        (search-patches
+         "soundconverter-remove-gconf-dependency.patch"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     `(#:imported-modules ((guix build python-build-system)
+                           (guix build glib-or-gtk-build-system)
+                           ,@%gnu-build-system-modules)
+
+       #:modules ((guix build glib-or-gtk-build-system)
+                  (guix build utils)
+                  ((guix build gnu-build-system) #:prefix gnu:)
+                  ((guix build python-build-system) #:prefix python:))
+
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-POTFILES.in
+           (lambda _
+             (substitute* "po/POTFILES.in"
+               ;; This file doesn't exist, so without removing it, the 'check
+               ;; phase fails for the po directory
+               (("soundconverter/gconfstore\\.py") ""))))
+         (add-after 'install 'wrap-soundconverter-for-python
+           (assoc-ref python:%standard-phases 'wrap))
+         (add-after 'install 'wrap-soundconverter
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out               (assoc-ref outputs "out"))
+                   (gi-typelib-path   (getenv "GI_TYPELIB_PATH"))
+                   (gst-plugin-path   (getenv "GST_PLUGIN_SYSTEM_PATH")))
+               (wrap-program (string-append out "/bin/soundconverter")
+                 `("GI_TYPELIB_PATH"        ":" prefix (,gi-typelib-path))
+                 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
+             #t)))))
+    (native-inputs
+     `(("intltool" ,intltool)
+       ("pkg-config" ,pkg-config)
+       ("glib:bin" ,glib "bin")))
+    (inputs
+     `(("gtk+" ,gtk+)
+       ("python" ,python)
+       ("python-pygobject" ,python-pygobject)
+       ("gstreamer" ,gstreamer)
+       ("gst-plugins-base" ,gst-plugins-base)))
+    (home-page "http://soundconverter.org/")
+    (synopsis "Audio file converter for the GNOME Desktop")
+    (description
+     "SoundConverter supports converting between many audio formats including
+Opus, Ogg Vorbis, FLAC and more.  It supports parallel conversion, and
+configurable file renaming. ")
+    (license license:gpl3)))
+
 (define-public workrave
   (let ((commit "v1_10_21"))
     (package
diff --git a/gnu/packages/patches/soundconverter-remove-gconf-dependency.patch b/gnu/packages/patches/soundconverter-remove-gconf-dependency.patch
new file mode 100644
index 0000000000..f065b9a3d4
--- /dev/null
+++ b/gnu/packages/patches/soundconverter-remove-gconf-dependency.patch
@@ -0,0 +1,83 @@
+From: Sebastian Ramacher <sebastian <at> ramacher.at>
+Date: Fri, 6 Apr 2018 13:25:35 +0200
+Subject: Only fetch profiles if GConf is still available
+
+---
+ bin/soundconverter.py       |  1 -
+ soundconverter/gstreamer.py | 44 ++++++++++++++++++++++++--------------------
+ 2 files changed, 24 insertions(+), 21 deletions(-)
+
+diff --git a/bin/soundconverter.py b/bin/soundconverter.py
+index 39055ce..5198443 100644
+--- a/bin/soundconverter.py
++++ b/bin/soundconverter.py
+@@ -66,7 +66,6 @@ def _check_libs():
+         import gi
+         gi.require_version('Gst', '1.0')
+         gi.require_version('Gtk', '3.0')
+-        gi.require_version('GConf', '2.0')
+         from gi.repository import GObject
+         # force GIL creation - see https://bugzilla.gnome.org/show_bug.cgi?id=710447
+         import threading
+diff --git a/soundconverter/gstreamer.py b/soundconverter/gstreamer.py
+index 23aaa9b..211b052 100644
+--- a/soundconverter/gstreamer.py
++++ b/soundconverter/gstreamer.py
+@@ -25,7 +25,7 @@ from urllib.parse import urlparse
+ from gettext import gettext as _
+ 
+ import gi
+-from gi.repository import Gst, Gtk, GObject, GConf, Gio
++from gi.repository import Gst, Gtk, GObject, Gio
+ 
+ from soundconverter.fileoperations import vfs_encode_filename, file_encode_filename
+ from soundconverter.fileoperations import unquote_filename, vfs_makedirs, vfs_unlink
+@@ -66,25 +66,29 @@ _GCONF_PROFILE_LIST_PATH = "/system/gstreamer/1.0/audio/global/profile_list"
+ audio_profiles_list = []
+ audio_profiles_dict = {}
+ 
+-_GCONF = GConf.Client.get_default()
+-profiles = _GCONF.all_dirs(_GCONF_PROFILE_LIST_PATH)
+-for name in profiles:
+-    if _GCONF.get_bool(_GCONF_PROFILE_PATH + name + "/active"):
+-        # get profile
+-        description = _GCONF.get_string(_GCONF_PROFILE_PATH + name + "/name")
+-        extension = _GCONF.get_string(_GCONF_PROFILE_PATH + name + "/extension")
+-        pipeline = _GCONF.get_string(_GCONF_PROFILE_PATH + name + "/pipeline")
+-        # check profile validity
+-        if not extension or not pipeline:
+-            continue
+-        if not description:
+-            description = extension
+-        if description in audio_profiles_dict:
+-            continue
+-            # store
+-        profile = description, extension, pipeline
+-        audio_profiles_list.append(profile)
+-        audio_profiles_dict[description] = profile
++try:
++    from gi.repository import GConf
++    _GCONF = GConf.Client.get_default()
++    profiles = _GCONF.all_dirs(_GCONF_PROFILE_LIST_PATH)
++    for name in profiles:
++        if _GCONF.get_bool(_GCONF_PROFILE_PATH + name + "/active"):
++            # get profile
++            description = _GCONF.get_string(_GCONF_PROFILE_PATH + name + "/name")
++            extension = _GCONF.get_string(_GCONF_PROFILE_PATH + name + "/extension")
++            pipeline = _GCONF.get_string(_GCONF_PROFILE_PATH + name + "/pipeline")
++            # check profile validity
++            if not extension or not pipeline:
++                continue
++            if not description:
++                description = extension
++            if description in audio_profiles_dict:
++                continue
++                # store
++            profile = description, extension, pipeline
++            audio_profiles_list.append(profile)
++            audio_profiles_dict[description] = profile
++except ImportError:
++    pass
+ 
+ required_elements = ('decodebin', 'fakesink', 'audioconvert', 'typefind', 'audiorate')
+ for element in required_elements:
-- 
2.19.1





Information forwarded to guix-patches <at> gnu.org:
bug#33042; Package guix-patches. (Fri, 19 Oct 2018 14:06:02 GMT) Full text and rfc822 format available.

Message #14 received at 33042 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Leo Famulari <leo <at> famulari.name>
Cc: 33042 <at> debbugs.gnu.org
Subject: Re: [bug#33042] [PATCH] gnu: Add soundconverter.
Date: Fri, 19 Oct 2018 15:05:35 +0100
[Message part 1 (text/plain, inline)]
Leo Famulari <leo <at> famulari.name> writes:

> On Sun, Oct 14, 2018 at 09:18:10PM +0100, Christopher Baines wrote:
>> * gnu/packages/gnome.scm (soundconverter): New variable.
>
> Thanks, it's nice to have graphical programs for this sort of task :)

Yeah, thanks for taking a look. I've sent an updated patch :)

>> +       (patches
>> +        (list
>> +         (origin
>> +           (method url-fetch)
>> +           (uri (string-append
>> +                 "https://salsa.debian.org/multimedia-team/soundconverter"
>> +                 "/raw/master/debian/patches/"
>> +                 "0002-Only-fetch-profiles-if-GConf-is-still-available.patch"))
>> +           (sha256
>> +            (base32
>> +             "00nxpbkz7ihzrbz91ms7bd2mjgyhkbxpaa8zxj4xnkv4pjmg61hh")))))))
>
> I think it's better if we include this file in our source code, since
> it's not very big and Debian's code infrastructure URLs seem to change
> every few years. Also, the URL is not versioned, so maybe the patch
> would change in the future.

Sure, I've included the file now. This patch has been merged upstream,
so hopefully it can be removed here when the next release comes out.

>> +         (add-after 'unpack 'fix-POTFILES.in
>> +           (lambda _
>> +             (substitute* "po/POTFILES.in"
>> +               (("soundconverter/gconfstore\\.py") ""))))
>
> Please add an explanatory comment for this.

I have done. This has also been fixed upstream, so hopefully can also be
removed on the next release.

>> +         (add-after 'install 'wrap-rhythmbox
>> +           (lambda* (#:key inputs outputs #:allow-other-keys)
>> +             (let ((out               (assoc-ref outputs "out"))
>> +                   (python-path       (getenv "PYTHONPATH"))
>> +                   (gi-typelib-path   (getenv "GI_TYPELIB_PATH"))
>> +                   (gst-plugin-path   (getenv "GST_PLUGIN_SYSTEM_PATH")))
>> +               (wrap-program (string-append out "/bin/soundconverter")
>> +                 `("PYTHONPATH"             ":" prefix (,python-path))
>> +                 `("GI_TYPELIB_PATH"        ":" prefix (,gi-typelib-path))
>> +                 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))))
>> +             #t)))))
>
> If possible, I think it's better to use the python-build-system's wrap
> phase for PYTHONPATH. The hplip package has an example.

I've changed this now.

>> +    (synopsis "Audio file converter for the GNOME Desktop")
>
> It works in i3, too :)

I couldn't quite work out how better to get across that it's a graphical
application, as compared to a command line tool. But, as you say, it's
not specific to GNOME.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33042; Package guix-patches. (Fri, 19 Oct 2018 20:09:01 GMT) Full text and rfc822 format available.

Message #17 received at 33042 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 33042 <at> debbugs.gnu.org
Subject: Re: [bug#33042] [PATCH] gnu: Add soundconverter.
Date: Fri, 19 Oct 2018 16:08:32 -0400
[Message part 1 (text/plain, inline)]
On Fri, Oct 19, 2018 at 03:05:35PM +0100, Christopher Baines wrote:
> >> +    (synopsis "Audio file converter for the GNOME Desktop")
> >
> > It works in i3, too :)
> 
> I couldn't quite work out how better to get across that it's a graphical
> application, as compared to a command line tool. But, as you say, it's
> not specific to GNOME.

I would say something like this: "Convert between audio formats in a
graphical interface".

LGTM with that change!
[signature.asc (application/pgp-signature, inline)]

Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Sat, 20 Oct 2018 11:32:02 GMT) Full text and rfc822 format available.

Notification sent to Christopher Baines <mail <at> cbaines.net>:
bug acknowledged by developer. (Sat, 20 Oct 2018 11:32:02 GMT) Full text and rfc822 format available.

Message #22 received at 33042-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Leo Famulari <leo <at> famulari.name>
Cc: 33042-done <at> debbugs.gnu.org
Subject: Re: [bug#33042] [PATCH] gnu: Add soundconverter.
Date: Sat, 20 Oct 2018 12:31:12 +0100
[Message part 1 (text/plain, inline)]
Leo Famulari <leo <at> famulari.name> writes:

> On Fri, Oct 19, 2018 at 03:05:35PM +0100, Christopher Baines wrote:
>> >> +    (synopsis "Audio file converter for the GNOME Desktop")
>> >
>> > It works in i3, too :)
>> 
>> I couldn't quite work out how better to get across that it's a graphical
>> application, as compared to a command line tool. But, as you say, it's
>> not specific to GNOME.
>
> I would say something like this: "Convert between audio formats in a
> graphical interface".
>
> LGTM with that change!

Great, I went with "with a" rather than "in a" as that reads a bit
better to me, and I've pushed this to master now.

Chris
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33042; Package guix-patches. (Sun, 21 Oct 2018 19:21:02 GMT) Full text and rfc822 format available.

Message #25 received at 33042-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 33042-done <at> debbugs.gnu.org
Subject: Re: [bug#33042] [PATCH] gnu: Add soundconverter.
Date: Sun, 21 Oct 2018 15:20:56 -0400
[Message part 1 (text/plain, inline)]
On Sat, Oct 20, 2018 at 12:31:12PM +0100, Christopher Baines wrote:
> Great, I went with "with a" rather than "in a" as that reads a bit
> better to me, and I've pushed this to master now.

Perfect! That does sound better.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 19 Nov 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 210 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.