From 7486ae8e7ccc256873982c60445f34dfa72382e9 Mon Sep 17 00:00:00 2001 From: Sauyon Lee Date: Sun, 17 Sep 2017 09:00:36 +0100 Subject: [PATCH] quodlibet: 2.6.3 -> 3.9.1 --- pkgs/applications/audio/quodlibet/default.nix | 80 +++++++------------ .../quodlibet/quodlibet-package-plugins.patch | 18 ----- pkgs/top-level/all-packages.nix | 31 ++++++- 3 files changed, 57 insertions(+), 72 deletions(-) delete mode 100644 pkgs/applications/audio/quodlibet/quodlibet-package-plugins.patch diff --git a/pkgs/applications/audio/quodlibet/default.nix b/pkgs/applications/audio/quodlibet/default.nix index 2e6d61b693d..fd328669846 100644 --- a/pkgs/applications/audio/quodlibet/default.nix +++ b/pkgs/applications/audio/quodlibet/default.nix @@ -1,64 +1,44 @@ -{ stdenv, fetchurl, python2Packages, intltool -, gst-python, withGstPlugins ? false, gst-plugins-base ? null -, gst-plugins-good ? null, gst-plugins-ugly ? null, gst-plugins-bad ? null }: +{ stdenv, fetchurl, python2Packages, wrapGAppsHook, gettext, intltool, libsoup, gnome3, + tag ? "", + gst_all_1, withGstPlugins ? true, + xineBackend ? false, xineLib, + withDbusPython ? false, withPyInotify ? false, withMusicBrainzNgs ? false, withPahoMqtt ? false, + webkitgtk ? null, + keybinder3 ? null, gtksourceview ? null, libmodplug ? null, kakasi ? null, libappindicator-gtk3 ? null }: -assert withGstPlugins -> gst-plugins-base != null - || gst-plugins-good != null - || gst-plugins-ugly != null - || gst-plugins-bad != null; - -let - version = "2.6.3"; - inherit (python2Packages) buildPythonApplication python mutagen pygtk pygobject2 dbus-python; -in buildPythonApplication { - # call the package quodlibet and just quodlibet - name = "quodlibet${stdenv.lib.optionalString (!withGstPlugins) "-without-gst-plugins"}-${version}"; +let optionals = stdenv.lib.optionals; in +python2Packages.buildPythonApplication rec { + name = "quodlibet${tag}-${version}"; + version = "3.9.1"; # XXX, tests fail doCheck = false; - srcs = [ - (fetchurl { - url = "https://bitbucket.org/lazka/quodlibet-files/raw/default/releases/quodlibet-${version}.tar.gz"; - sha256 = "0ilasi4b0ay8r6v6ba209wsm80fq2nmzigzc5kvphrk71jwypx6z"; - }) - (fetchurl { - url = "https://bitbucket.org/lazka/quodlibet-files/raw/default/releases/quodlibet-plugins-${version}.tar.gz"; - sha256 = "1rv08rhdjad8sjhplqsspcf4vkazgkxyshsqmbfbrrk5kvv57ybc"; - }) - ]; + src = fetchurl { + url = "https://github.com/quodlibet/quodlibet/releases/download/release-${version}/quodlibet-${version}.tar.gz"; + sha256 = "d2b42df5d439213973dc97149fddc779a6c90cec389c24baf1c0bdcc39ffe591"; + }; - preConfigure = '' - # TODO: for now don't a apply gdist overrides, will be needed for shipping icons, gtk, etc - sed -i /distclass/d setup.py - ''; + nativeBuildInputs = [ wrapGAppsHook gettext intltool ]; + # ++ (with python2Packages; [ pytest pyflakes pycodestyle polib ]); # test deps - sourceRoot = "quodlibet-${version}"; + buildInputs = [ gnome3.defaultIconTheme libsoup webkitgtk keybinder3 gtksourceview libmodplug libappindicator-gtk3 kakasi ] + ++ (if xineBackend then [ xineLib ] else with gst_all_1; + [ gstreamer gst-plugins-base ] ++ optionals withGstPlugins [ gst-plugins-good gst-plugins-ugly gst-plugins-bad ]); - postUnpack = '' - # the patch searches for plugins in directory ../plugins - # so link the appropriate directory there - ln -sf quodlibet-plugins-${version} plugins - ''; + propagatedBuildInputs = with python2Packages; + [ pygobject3 pycairo mutagen pygtk gst-python feedparser faulthandler futures ] + ++ optionals withDbusPython [ dbus-python ] + ++ optionals withPyInotify [ pyinotify ] + ++ optionals withMusicBrainzNgs [ musicbrainzngs ] + ++ optionals stdenv.isDarwin [ pyobjc ] + ++ optionals withPahoMqtt [ paho-mqtt ]; - patches = [ ./quodlibet-package-plugins.patch ]; - - buildInputs = stdenv.lib.optionals withGstPlugins [ - gst-plugins-base gst-plugins-good gst-plugins-ugly gst-plugins-bad - ]; - - propagatedBuildInputs = [ - mutagen pygtk pygobject2 dbus-python gst-python intltool - ]; - - postInstall = stdenv.lib.optionalString withGstPlugins '' - # Wrap quodlibet so it finds the GStreamer plug-ins - wrapProgram "$out/bin/quodlibet" --prefix \ - GST_PLUGIN_SYSTEM_PATH ":" "$GST_PLUGIN_SYSTEM_PATH" \ - ''; + makeWrapperArgs = optionals (kakasi != null) [ "--prefix PATH : ${kakasi}/bin" ]; meta = { description = "GTK+-based audio player written in Python, using the Mutagen tagging library"; + license = stdenv.lib.licenses.gpl2; longDescription = '' Quod Libet is a GTK+-based audio player written in Python, using @@ -74,7 +54,7 @@ in buildPythonApplication { & internet radio, and all major audio formats. ''; - maintainers = [ stdenv.lib.maintainers.coroa ]; + maintainers = with stdenv.lib.maintainers; [ coroa sauyon ]; homepage = https://quodlibet.readthedocs.io/en/latest/; }; } diff --git a/pkgs/applications/audio/quodlibet/quodlibet-package-plugins.patch b/pkgs/applications/audio/quodlibet/quodlibet-package-plugins.patch deleted file mode 100644 index d518f857cf1..00000000000 --- a/pkgs/applications/audio/quodlibet/quodlibet-package-plugins.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -Naur quodlibet-2.5.orig/setup.py quodlibet-2.5.new/setup.py ---- quodlibet-2.5.orig/setup.py 2012-12-19 08:47:41.000000000 +0000 -+++ quodlibet-2.5.new/setup.py 2013-04-22 19:27:07.152631051 +0000 -@@ -337,5 +338,14 @@ - } - } - }) -+ else: -+ from os.path import join -+ -+ data_files = [] -+ for type in ["playorder", "songsmenu", "editing", "events", "gstreamer"]: -+ data_files.append((join('quodlibet', 'plugins', type), -+ glob.glob(join('..', 'plugins', type, '*.py')))) -+ setup_kwargs.update({ 'data_files': data_files }); -+ - setup(**setup_kwargs) - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f7eed45314f..a7e1bd3fe2d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16272,14 +16272,37 @@ with pkgs; quiterss = libsForQt5.callPackage ../applications/networking/newsreaders/quiterss {}; - quodlibet-without-gst-plugins = callPackage ../applications/audio/quodlibet { }; + falkon = libsForQt5.callPackage ../applications/networking/browsers/falkon { }; quodlibet = callPackage ../applications/audio/quodlibet { - withGstPlugins = true; - gst-plugins-bad = null; + keybinder3 = null; + libmodplug = null; + kakasi = null; + libappindicator-gtk3 = null; }; - falkon = libsForQt5.callPackage ../applications/networking/browsers/falkon { }; + quodlibet-without-gst-plugins = quodlibet.override { + withGstPlugins = false; + tag = "-without-gst-plugins"; + }; + + quodlibet-xine = quodlibet.override { xineBackend = true; tag = "-xine"; }; + + quodlibet-full = callPackage ../applications/audio/quodlibet { + inherit (gnome2) gtksourceview; + withDbusPython = true; + withPyInotify = true; + withMusicBrainzNgs = true; + withPahoMqtt = true; + keybinder3 = keybinder3; + libmodplug = libmodplug; + kakasi = kakasi; + webkitgtk = webkitgtk24x-gtk3; + libappindicator-gtk3 = libappindicator-gtk3; + tag = "-full"; + }; + + quodlibet-xine-full = quodlibet-full.override { xineBackend = true; tag = "-xine-full"; }; qutebrowser = libsForQt5.callPackage ../applications/networking/browsers/qutebrowser { inherit (python3Packages) buildPythonApplication pyqt5 jinja2 pygments pyyaml pypeg2 cssutils pyopengl attrs;