diff mbox series

[bug#55516] gnu: Add quod-libet.

Message ID BY5PR07MB70294AEFE275BAB09B56682599D09@BY5PR07MB7029.namprd07.prod.outlook.com
State Accepted
Headers show
Series [bug#55516] gnu: Add quod-libet. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Wamm K. D May 19, 2022, 4:41 a.m. UTC
---
 gnu/packages/music.scm | 61 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

Comments

Liliana Marie Prikler May 19, 2022, 6:15 a.m. UTC | #1
Am Mittwoch, dem 18.05.2022 um 23:41 -0500 schrieb Wamm K. D:
> ---
Missing ChangeLog.

> [...]
> +    (native-inputs (list gettext-minimal python-pytest))
> +    (inputs (list ;;; Per their documentation:
I suggest putting the list on a new line.

> [...]
> +    (arguments `(#:phases (modify-phases %standard-phases
Use a list of G-Expressions, also put them on a new line.

> +                                 '("quodlibet" "exfalso")))))
What about operon?

> [...]
> +                 ;; Gtk.init_check requires an internet connection
> to initialize
> +                 #:tests? #f))
I'd be surprised if it did.  You do need xorg-server-for-tests, spawn
an Xvfb and probably also disable some dbus warnings though.  Look at
pretty much every other GTK app that has tests and copypasta :)

> +    (home-page "https://quodlibet.readthedocs.io/en/latest/")
> +    (synopsis "Music player and music library manager for Linux,
> Windows, and macOS")
Reduce to "Music player and music library manager".

> +    (description "Quod Libet is a cross-platform audio / music
> management program.  It can be used to view your local library and
> supports streaming audio and feeds (podcasts, etc.).  It, also, has
> metadata editing and searching capabilities.")
"Cross-platform" is not meaningful for a description in Guix.  With
searching being a very basic capability of any library management
thing, I suggest rewriting the last sentence into "It can also be used
to edit metadata."

> +    (license license:gpl2)))
Should probably be gpl2+.

Cheers
Wamm K. D May 19, 2022, 7:49 a.m. UTC | #2
> On Thursday, May 19, 2022, 01:15:35 AM CDT, Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> wrote:
>
>
>
>
>
> Am Mittwoch, dem 18.05.2022 um 23:41 -0500 schrieb Wamm K. D:
> > ---
> Missing ChangeLog.

Is there a particular flag I need to set for ~git send-email~? I'm just sending what it generates; I assumed, as it's putting my commit message in the Subject header, that that was the means by which it gets passed on via this format but I seem mistaken.

> > [...]
> > +    (arguments `(#:phases (modify-phases %standard-phases
> Use a list of G-Expressions, also put them on a new line.
>
> > +                                '("quodlibet" "exfalso")))))
> What about operon?

I don't think, as I think it's purely a CLI command, that it needs it but you're right; better safe, than sorry.

> > [...]
> > +                 ;; Gtk.init_check requires an internet connection
> > to initialize
> > +                 #:tests? #f))
> I'd be surprised if it did.  You do need xorg-server-for-tests, spawn
> an Xvfb and probably also disable some dbus warnings though.  Look at
> pretty much every other GTK app that has tests and copypasta :)

Gotcha; so I tried that but now I keep getting back the error


_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
running "python setup.py" with command "test" and parameters ()
running test
error: [Errno 13] Permission denied: '/homeless-shelter'
error: in phase 'check': uncaught exception:
0.000000e+00xception #<&invoke-error program: "python" arguments: ("-c" "import setuptools, tokenize;__file__='setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" "test") exit-status: 1 term-signal: #f stop-signal: #f> 


Based off of the first line, I dug around and found https://github.com/dimkir/nightmare-lambda-tutorial/issues/10#issuecomment-947244559; based off of that, I tried it with "-nolisten unix" which did get rid of the first error but not the rest:


running "python setup.py" with command "test" and parameters ()
running test
error: [Errno 13] Permission denied: '/homeless-shelter'
error: in phase 'check': uncaught exception:
0.000000e+00xception #<&invoke-error program: "python" arguments: ("-c" "import setuptools, tokenize;__file__='setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" "test") exit-status: 1 term-signal: #f stop-signal: #f> 


I'm afraid I don't know enough to know what to do with this error.


> > +    (license license:gpl2)))
>
> Should probably be gpl2+.

How do you distinguish between the two, again? GitHub listed it as just GPL2 and I didn't think I'd seen the necessary "or any later version" phrase when I checked the license text but I'm definitely not used to distinguishing often so I may've missed something.
Liliana Marie Prikler May 19, 2022, 7:58 a.m. UTC | #3
Am Donnerstag, dem 19.05.2022 um 07:49 +0000 schrieb Jaft:
> > On Thursday, May 19, 2022, 01:15:35 AM CDT, Liliana Marie Prikler
> > <liliana.prikler@ist.tugraz.at> wrote:
> > Am Mittwoch, dem 18.05.2022 um 23:41 -0500 schrieb Wamm K. D:
> > > ---
> > Missing ChangeLog.
> 
> Is there a particular flag I need to set for ~git send-email~? I'm
> just sending what it generates; I assumed, as it's putting my commit
> message in the Subject header, that that was the means by which it
> gets passed on via this format but I seem mistaken.
I don't think it's a send-email flag, you need to type out the actual
ChangeLog into your commit message with one blank line between the
header and the ChangeLog.

> > > [...]
> > > +    (arguments `(#:phases (modify-phases %standard-phases
> > Use a list of G-Expressions, also put them on a new line.
> > 
> > > +                                '("quodlibet" "exfalso")))))
> > What about operon?
> 
> I don't think, as I think it's purely a CLI command, that it needs it
> but you're right; better safe, than sorry.
I'm pretty sure it still needs some basic GObject stuff. 

> > 
> > > [...]
> > > +                 ;; Gtk.init_check requires an internet
> > > connection
> > > to initialize
> > > +                 #:tests? #f))
> > I'd be surprised if it did.  You do need xorg-server-for-tests,
> > spawn an Xvfb and probably also disable some dbus warnings though. 
> > Look at pretty much every other GTK app that has tests and
> > copypasta :)
> 
> Gotcha; so I tried that but now I keep getting back the error
> 
> _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not
> be created.
> running "python setup.py" with command "test" and parameters ()
> running test
> error: [Errno 13] Permission denied: '/homeless-shelter'
> error: in phase 'check': uncaught exception:
> 0.000000e+00xception #<&invoke-error program: "python" arguments: ("-
> c" "import setuptools,
> tokenize;__file__='setup.py';f=getattr(tokenize, 'open',
> open)(__file__);code=f.read().replace('\r\n',
> '\n');f.close();exec(compile(code, __file__, 'exec'))" "test") exit-
> status: 1 term-signal: #f stop-signal: #f> 
The first one is harmless afaik.  The second means it's trying to write
to $HOME, so you need to (setenv "HOME" (getcwd)) or similar.

> > > +    (license license:gpl2)))
> > 
> > Should probably be gpl2+.
> 
> How do you distinguish between the two, again? GitHub listed it as
> just GPL2 and I didn't think I'd seen the necessary "or any later
> version" phrase when I checked the license text but I'm definitely
> not used to distinguishing often so I may've missed something.
Look at the license headers in the code.  I picked a file at random and
it said "or any later version".  For python in particular, setup.py
would be another oracle, as is meson.build in most GNOME applications.

Cheers
Remco van 't Veer May 21, 2022, 2:45 p.m. UTC | #4
Hi,

I've been working on packaging quodlibet a couple of weeks ago but got
stuck doing the tests because Xvfb dies while running the tests.  They
run fine in a pure guix shell environment.

Here's the output from guix build (using xvfb):

> starting phase `check'
> ============================= test session starts ==============================
> platform linux -- Python 3.9.9, pytest-6.2.5, py-1.10.0, pluggy-0.13.1 -- /gnu/store/j3cx0yaqdpw0mxizp5bayx93pya44dhn-python-wrapper-3.9.9/bin/python
> cachedir: .pytest_cache
> hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/tmp/guix-build-quodlibet-4.5.0.drv-0/source/.hypothesis/examples')
> rootdir: /tmp/guix-build-quodlibet-4.5.0.drv-0/source, configfile: setup.cfg
> plugins: hypothesis-6.0.2
> collecting ... collected 3315 items

> tests/test___init__.py::TQuodlibet::test_dirs PASSED                     [  0%]
> tests/test___init__.py::TQuodlibet::test_first_session PASSED            [  0%]
> tests/test___init__.py::TQuodlibet::test_get_build_description PASSED    [  0%]
> tests/test___init__.py::TQuodlibet::test_get_build_version PASSED        [  0%]
> tests/test___init__.py::TVersion::test_message PASSED                    [  0%]
> tests/test_appdata_files.py::TQLAppDataFile::test_filename SKIPPED (...) [  0%]
> tests/test_appdata_files.py::TQLAppDataFile::test_validate SKIPPED (...) [  0%]
> tests/test_appdata_files.py::TEFAppDataFile::test_filename SKIPPED (...) [  0%]
> tests/test_appdata_files.py::TEFAppDataFile::test_validate SKIPPED (...) [  0%]
> tests/test_browsers___init__.py::TBrowsers::test_default PASSED          [  0%]
> tests/test_browsers___init__.py::TBrowsers::test_get PASSED              [  0%]
> tests/test_browsers___init__.py::TBrowsers::test_get_invalid PASSED      [  0%]
> tests/test_browsers___init__.py::TBrowsers::test_index PASSED            [  0%]
> tests/test_browsers___init__.py::TBrowsers::test_index_invalid PASSED    [  0%]
> tests/test_browsers___init__.py::TBrowsers::test_migrate PASSED          [  0%]
> tests/test_browsers___init__.py::TBrowsers::test_name PASSED             [  0%]
> tests/test_browsers___init__.py::TBrowsers::test_old_names PASSED        [  0%]
> tests/test_browsers___init__.py::TBrowsers::test_presence PASSED         [  0%]
> tests/test_browsers__base.py::new_test::test_active_filter /gnu/store/1hg26c00lzj6kcgzia77gmrs5wx89cjr-xvfb-run-1.20.10-3/bin/xvfb-run: line 184:   221 Trace/breakpoint trap   DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@"
> error: in phase 'check': uncaught exception:
> %exception #<&invoke-error program: "dbus-run-session" arguments: ("--" "xvfb-run" "pytest" "-vv" "--disable-warnings" "--ignore=tests/test_browsers_iradio.py" "--ignore=tests/quality") exit-status: 133 term-signal: #f stop-signal: #f>
> phase `check' failed after 11.4 seconds
> command "dbus-run-session" "--" "xvfb-run" "pytest" "-vv" "--disable-warnings" "--ignore=tests/test_browsers_iradio.py" "--ignore=tests/quality" failed with status 133

One of the tests does depend on a network connection but is easily
disabled (see patch I'll send to this ticket after this).  I started
disabling the tests which kill xvfb but gave up because there were so
many to skip.  Maybe something else is wrong and some more xvfb/dbus
magic is needed?

Also I can confirm operon works fine without GI typelib stuff.

I'll send my patch next and please note don't want to compete with your
work so take whatever you need from it.  I hope it will be helpful.

Cheers,
Remco
Wamm K. D May 22, 2022, 1:27 a.m. UTC | #5
> On Thursday, May 19, 2022, 02:58:45 AM CDT, Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> wrote: 
>
>
>
>
>
> The first one is harmless afaik.  The second means it's trying to write
> to $HOME, so you need to (setenv "HOME" (getcwd)) or similar.

I may be out of my depth, sadly; I added your suggestion, which seems to've worked, but it's failing on one of the test files and I can't seem to find anything that actually outputs why:

 > starting phase `check'
> _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
> running "python setup.py" with command "test" and parameters ()
> running test
> ============================= test session starts ==============================
> platform linux -- Python 3.9.9, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
> rootdir: /tmp/guix-build-quod-libet-4.5.0.drv-0/source, configfile: setup.cfg
> collected 4539 items / 1 skipped / 4538 selected
>
> tests/test___init__.py .....                                             [  0%]
> tests/test_appdata_files.py ssss                                         [  0%]
> tests/test_browsers___init__.py .........                                [  0%]
> tests/test_browsers__base.py error: in phase 'check': uncaught exception:
> %exception #<&invoke-error program: "python" arguments: ("-c" "import setuptools, tokenize;__file__='setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))" "test") exit-status: #f term-signal: 5 stop-signal: #f> 

I tried with ~--keep-failed~ and dug around for logs or something that gave more indication as to why or what in the test file failed but can't seem to find anything. I dunno if you have experience with anything that might lend some insight as to, at least, where to look but, without a better error output, I'm not sure. I tried looking around in the last-listed test file but nothing obvious sticks out to me as would cause an exception, unfortunately.
Ludovic Courtès May 27, 2022, 9:54 p.m. UTC | #6
Hi,

Remco van 't Veer <remco@remworks.net> skribis:

>> tests/test_browsers__base.py::new_test::test_active_filter /gnu/store/1hg26c00lzj6kcgzia77gmrs5wx89cjr-xvfb-run-1.20.10-3/bin/xvfb-run: line 184:   221 Trace/breakpoint trap   DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@"

This is the crux of the problem.  I searched a bit on the intertubes and
the xorg-server code couldn’t find under what circumstances Xvfb would
get SIGTRAP.

In some packages, rather than use xvfb-run, we’d spawn Xvfb directly,
without further ado.  I wonder if this makes any difference?

Thanks,
Ludo’.
Remco van 't Veer May 28, 2022, 8:55 a.m. UTC | #7
2022/05/27 23:54, Ludovic Courtès:

> This is the crux of the problem.  I searched a bit on the intertubes and
> the xorg-server code couldn’t find under what circumstances Xvfb would
> get SIGTRAP.

Just looked at it again and it wasn't xvfb getting a sigtrap but it was
the python test process and I managed to reproduce it in a shell
session.  After some tracing, I finally got the real error message:

 GLib-GIO-ERROR: Settings schema 'org.gnome.system.proxy' is not installed

Adding gsettings-desktop-schemas as an input fixed that!  Hurray!

I'll push out a v2 patch after this email.

Jaft, I am really sorry about hijacking your work, but I am so happy the
tests finally run, I can't contain myself..

Cheers,
Remco
Wamm K. D May 30, 2022, 2:06 a.m. UTC | #8
On Sat. (May 28, 2022) at 10:55:38 AM +02, Remco van 't Veer <remco@remworks.net> wrote:
> 2022/05/27 23:54, Ludovic Courtès:
>
> I'll push out a v2 patch after this email.
>
> Jaft, I am really sorry about hijacking your work, but I am so happy the
> tests finally run, I can't contain myself..

Heh, no worries; I don't mind, at all. The important bit is we got yet
another software option for Guix users available, for them.

Thanks for getting the patch out!
diff mbox series

Patch

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 210af3b166..d3a3064a50 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -45,6 +45,7 @@ 
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;; Copyright © 2021 Thomas Albers Raviola <thomas@thomaslabs.org>
 ;;; Copyright © 2022 Sughosha <sughosha@disroot.org>
+;;; Copyright © 2022 Wamm K. D. <jaft.r@outlook.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -176,6 +177,7 @@  (define-module (gnu packages music)
   #:use-module (gnu packages vim)       ;for 'xxd'
   #:use-module (gnu packages web)
   #:use-module (gnu packages webkit)
+  #:use-module (gnu packages wm)
   #:use-module (gnu packages wxwidgets)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xml)
@@ -6877,3 +6879,62 @@  (define-public musikcube
 streaming audio server.")
     (home-page "https://musikcube.com/")
     (license license:bsd-3)))
+
+(define-public quod-libet
+  (package
+    (name "quod-libet")
+    (version "4.5.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/quodlibet/quodlibet/")
+                    (commit (string-append "release-" version))))
+              (sha256 (base32
+                       "1i5k93k3bfp7hpcwkbr865mbj9jam3jv2a5k1bazcyp4f5vdrb0v"))))
+    (build-system python-build-system)
+    (native-inputs (list gettext-minimal python-pytest))
+    (inputs (list ;;; Per their documentation:
+                  ;; required
+                  python-pygobject
+                  python-pycairo
+                  python-mutagen
+                  gtk+
+                  libsoup-minimal-2
+                  python-feedparser
+                  gstreamer
+                  gst-plugins-base
+                  ;; discovered, while building
+                  gdk-pixbuf
+                  ;; optional but recommended
+                  gst-plugins-good
+                  gst-plugins-bad
+                  gst-plugins-ugly
+                  gst-libav
+                  ;; optional but needed for DBus and
+                  ;; multimedia keys under Gnome
+                  python-dbus
+                  ;; optional but needed for multimedia keys not under Gnome
+                  keybinder-3.0
+                  ;; optional but needed for Undo/Redo
+                  ;; support for multiline text fields
+                  gtksourceview
+                  ;; optional but needed for the auto library update plugin
+                  python-pyinotify
+                  ;; optional but needed for the Musicbrainz plugin
+                  python-musicbrainzngs))
+    (arguments `(#:phases (modify-phases %standard-phases
+                            (add-after 'wrap 'gi-wrap
+                              (lambda* (#:key outputs #:allow-other-keys)
+                                (for-each
+                                 (lambda (binary)
+                                   (wrap-program (string-append (assoc-ref outputs "out")
+                                                                "/bin/"
+                                                                binary)
+                                     `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))))
+                                 '("quodlibet" "exfalso")))))
+                 ;; Gtk.init_check requires an internet connection to initialize
+                 #:tests? #f))
+    (home-page "https://quodlibet.readthedocs.io/en/latest/")
+    (synopsis "Music player and music library manager for Linux, Windows, and macOS")
+    (description "Quod Libet is a cross-platform audio / music management program.  It can be used to view your local library and supports streaming audio and feeds (podcasts, etc.).  It, also, has metadata editing and searching capabilities.")
+    (license license:gpl2)))