From aa88e7269dfaaa6baa034649d30e7daac5c96f40 Mon Sep 17 00:00:00 2001 From: Jonas Hoersch Date: Thu, 18 Apr 2013 01:44:12 +0200 Subject: [PATCH] Add quodlibet-2.5: GTK+Python based music player (close #481) --- pkgs/applications/audio/quodlibet/default.nix | 67 +++++++++++++++++++ .../quodlibet/quodlibet-package-plugins.patch | 18 +++++ pkgs/top-level/all-packages.nix | 4 ++ 3 files changed, 89 insertions(+) create mode 100644 pkgs/applications/audio/quodlibet/default.nix create 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 new file mode 100644 index 0000000000000..d9554d5f7249a --- /dev/null +++ b/pkgs/applications/audio/quodlibet/default.nix @@ -0,0 +1,67 @@ +{ stdenv, fetchurl, python, buildPythonPackage, mutagen, pygtk, pygobject +, pythonDBus, gst_python, gst_plugins_base, gst_plugins_good, gst_plugins_ugly }: + +let version = "2.5"; in + +buildPythonPackage { + # call the package quodlibet and just quodlibet + name = "quodlibet-${version}"; + namePrefix = ""; + + # XXX, tests fail + doCheck = false; + + src = [ + (fetchurl { + url = "https://quodlibet.googlecode.com/files/quodlibet-${version}.tar.gz"; + sha256 = "0qrmlz7m1jpmriy8bgycjiwzbf3annznkn4x5k32yy9bylxa7lwb"; + }) + (fetchurl { + url = "https://quodlibet.googlecode.com/files/quodlibet-plugins-${version}.tar.gz"; + sha256 = "0kf2mkq2zk38626bn48gscvy6ir04f5b2z57ahlxlqy8imv2cjff"; + }) + ]; + + sourceRoot = "quodlibet-${version}"; + postUnpack = '' + # the patch searches for plugins in directory ../plugins + # so link the appropriate directory there + ln -sf quodlibet-plugins-${version} plugins + ''; + patches = [ ./quodlibet-package-plugins.patch ]; + + buildInputs = [ + gst_plugins_base gst_plugins_good gst_plugins_ugly + ]; + + propagatedBuildInputs = [ + mutagen pygtk pygobject pythonDBus gst_python + ]; + + postInstall = '' + # Wrap quodlibet so it finds the GStreamer plug-ins + wrapProgram "$out/bin/quodlibet" --prefix \ + GST_PLUGIN_PATH ":" \ + "${gst_plugins_base}/lib/gstreamer-0.10:${gst_plugins_good}/lib/gstreamer-0.10:${gst_plugins_ugly}/lib/gstreamer-0.10" + ''; + + meta = { + description = "Quod Libet is a GTK+-based audio player written in Python, using the Mutagen tagging library."; + + longDescription = '' + Quod Libet is a GTK+-based audio player written in Python, using + the Mutagen tagging library. It's designed around the idea that + you know how to organize your music better than we do. It lets + you make playlists based on regular expressions (don't worry, + regular searches work too). It lets you display and edit any + tags you want in the file. And it lets you do this for all the + file formats it supports. Quod Libet easily scales to libraries + of thousands (or even tens of thousands) of songs. It also + supports most of the features you expect from a modern media + player, like Unicode support, tag editing, Replay Gain, podcasts + & internet radio, and all major audio formats. + ''; + + homepage = http://code.google.com/p/quodlibet/; + }; +} diff --git a/pkgs/applications/audio/quodlibet/quodlibet-package-plugins.patch b/pkgs/applications/audio/quodlibet/quodlibet-package-plugins.patch new file mode 100644 index 0000000000000..d518f857cf10a --- /dev/null +++ b/pkgs/applications/audio/quodlibet/quodlibet-package-plugins.patch @@ -0,0 +1,18 @@ +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 aa8586d185c3f..b68c7ee17ebc9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8266,6 +8266,10 @@ let qtractor = callPackage ../applications/audio/qtractor { }; + quodlibet = callPackage ../applications/audio/quodlibet { + inherit (pythonPackages) mutagen; + }; + rakarrack = callPackage ../applications/audio/rakarrack { inherit (xorg) libXpm libXft; fltk = fltk13;