@@ -1,5 +1,5 @@
1−{ stdenv, fetchurl, python2Packages, wrapGAppsHook, gettext, intltool, libsoup, gnome3,
2− tag ? "",
1+{ stdenv, fetchurl, python3, wrapGAppsHook, gettext, intltool, libsoup, gnome3, gtk3, gdk_pixbuf,
2+ tag ? "", xvfb_run, dbus, glibcLocales, glib, gobjectIntrospection,
33 gst_all_1, withGstPlugins ? true,
44 xineBackend ? false, xineLib,
55 withDbusPython ? false, withPyInotify ? false, withMusicBrainzNgs ? false, withPahoMqtt ? false,
@@ -7,38 +7,53 @@
77 keybinder3 ? null, gtksourceview ? null, libmodplug ? null, kakasi ? null, libappindicator-gtk3 ? null }:
88
99let optionals = stdenv.lib.optionals; in
10−python2Packages.buildPythonApplication rec {
10+python3.pkgs.buildPythonApplication rec {
1111 name = "quodlibet${tag}-${version}";
12− version = "3.9.1";
12+ version = "4.0.2";
1313
1414 # XXX, tests fail
15+ # https://github.com/quodlibet/quodlibet/issues/2820
1516 doCheck = false;
1617
1718 src = fetchurl {
1819 url = "https://github.com/quodlibet/quodlibet/releases/download/release-${version}/quodlibet-${version}.tar.gz";
19− sha256 = "d2b42df5d439213973dc97149fddc779a6c90cec389c24baf1c0bdcc39ffe591";
20+ sha256 = "072s983p3n84yl807pbdxsy5vrgs8jzzfl648gsri6kpwsp6w5fz";
2021 };
2122
2223 nativeBuildInputs = [ wrapGAppsHook gettext intltool ];
23− # ++ (with python2Packages; [ pytest pyflakes pycodestyle polib ]); # test deps
2424
25− buildInputs = [ gnome3.defaultIconTheme libsoup webkitgtk keybinder3 gtksourceview libmodplug libappindicator-gtk3 kakasi ]
25+ checkInputs = with python3.pkgs; [ pytest pytest_xdist pyflakes pycodestyle polib xvfb_run dbus.daemon glibcLocales ];
26+
27+ buildInputs = [ gnome3.defaultIconTheme libsoup glib gtk3 webkitgtk gdk_pixbuf keybinder3 gtksourceview libmodplug libappindicator-gtk3 kakasi gobjectIntrospection ]
2628 ++ (if xineBackend then [ xineLib ] else with gst_all_1;
2729 [ gstreamer gst-plugins-base ] ++ optionals withGstPlugins [ gst-plugins-good gst-plugins-ugly gst-plugins-bad ]);
2830
29− propagatedBuildInputs = with python2Packages;
30− [ pygobject3 pycairo mutagen pygtk gst-python feedparser faulthandler futures ]
31+ propagatedBuildInputs = with python3.pkgs; [ pygobject3 pycairo mutagen gst-python feedparser ]
3132 ++ optionals withDbusPython [ dbus-python ]
3233 ++ optionals withPyInotify [ pyinotify ]
3334 ++ optionals withMusicBrainzNgs [ musicbrainzngs ]
3435 ++ optionals stdenv.isDarwin [ pyobjc ]
3536 ++ optionals withPahoMqtt [ paho-mqtt ];
3637
37− makeWrapperArgs = optionals (kakasi != null) [ "--prefix PATH : ${kakasi}/bin" ];
38+ LC_ALL = "en_US.UTF-8";
39+
40+ checkPhase = ''
41+ runHook preCheck
42+ checkHomeDir=$(mktemp -d)
43+ mkdir -p $checkHomeDir/.cache/thumbnails/normal # Required by TThumb.test_recreate_broken_cache_file
44+ env XDG_DATA_DIRS="$out/share:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS" \
45+ HOME=$checkHomeDir \
46+ xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
47+ --config-file=${dbus.daemon}/share/dbus-1/session.conf \
48+ py.test
49+ runHook postCheck
50+ '';
51+
52+ preFixup = stdenv.lib.optionalString (kakasi != null) "gappsWrapperArgs+=(--prefix PATH : ${kakasi}/bin)";
3853
39− meta = {
54+ meta = with stdenv.lib; {
4055 description = "GTK+-based audio player written in Python, using the Mutagen tagging library";
41− license = stdenv.lib.licenses.gpl2;
56+ license = licenses.gpl2Plus;
4257
4358 longDescription = ''
4459 Quod Libet is a GTK+-based audio player written in Python, using
@@ -54,7 +69,7 @@ python2Packages.buildPythonApplication rec {
5469 & internet radio, and all major audio formats.
5570 '';
5671
57− maintainers = with stdenv.lib.maintainers; [ coroa sauyon ];
72+ maintainers = with maintainers; [ coroa sauyon ];
5873 homepage = https://quodlibet.readthedocs.io/en/latest/;
5974 };
6075}