nixpkgs/pkgs/applications/audio/quodlibet/default.nix

92 lines
4.2 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, python3, wrapGAppsHook, gettext, libsoup, gnome3, gtk3, gdk-pixbuf, librsvg,
2020-10-21 19:17:21 +02:00
tag ? "", xvfb_run, dbus, glibcLocales, glib, glib-networking, gobject-introspection, hicolor-icon-theme,
2017-09-17 10:00:36 +02:00
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 }:
2021-01-15 14:21:58 +01:00
let optionals = lib.optionals; in
2018-03-30 14:24:43 +02:00
python3.pkgs.buildPythonApplication rec {
pname = "quodlibet${tag}";
2020-10-21 19:17:21 +02:00
version = "4.3.0";
2017-09-17 10:00:36 +02:00
src = fetchurl {
url = "https://github.com/quodlibet/quodlibet/releases/download/release-${version}/quodlibet-${version}.tar.gz";
2020-10-21 19:17:21 +02:00
sha256 = "1q17ckblfa4fcs7wsjwsq1dj7360ymrdyjkyqmj864wzlqkw1rd2";
2017-09-17 10:00:36 +02:00
};
2020-12-07 02:31:32 +01:00
patches = [ ./quodlibet-feedparser6.patch ];
nativeBuildInputs = [ wrapGAppsHook gettext ];
2020-10-21 19:17:21 +02:00
checkInputs = [ gdk-pixbuf hicolor-icon-theme ] ++ (with python3.pkgs; [ pytest pytest_xdist polib xvfb_run dbus.daemon glibcLocales ]);
2018-03-30 14:24:43 +02:00
2019-05-22 13:03:39 +02:00
buildInputs = [ gnome3.adwaita-icon-theme libsoup glib glib-networking gtk3 webkitgtk gdk-pixbuf keybinder3 gtksourceview libmodplug libappindicator-gtk3 kakasi gobject-introspection ]
2017-09-17 10:00:36 +02:00
++ (if xineBackend then [ xineLib ] else with gst_all_1;
[ gstreamer gst-plugins-base ] ++ optionals withGstPlugins [ gst-plugins-good gst-plugins-ugly gst-plugins-bad ]);
2018-03-30 14:24:43 +02:00
propagatedBuildInputs = with python3.pkgs; [ pygobject3 pycairo mutagen gst-python feedparser ]
2017-09-17 10:00:36 +02:00
++ optionals withDbusPython [ dbus-python ]
++ optionals withPyInotify [ pyinotify ]
++ optionals withMusicBrainzNgs [ musicbrainzngs ]
++ optionals stdenv.isDarwin [ pyobjc ]
++ optionals withPahoMqtt [ paho-mqtt ];
2018-03-30 14:24:43 +02:00
LC_ALL = "en_US.UTF-8";
2021-01-15 14:21:58 +01:00
pytestFlags = lib.optionals (xineBackend || !withGstPlugins) [
"--ignore=tests/plugin/test_replaygain.py"
] ++ [
2020-10-21 19:17:21 +02:00
# requires networking
"--ignore=tests/test_browsers_iradio.py"
# the default theme doesn't have the required icons
"--ignore=tests/plugin/test_trayicon.py"
# upstream does actually not enforce source code linting
"--ignore=tests/quality"
# build failure on Arch Linux
# https://github.com/NixOS/nixpkgs/pull/77796#issuecomment-575841355
"--ignore=tests/test_operon.py"
];
2018-03-30 14:24:43 +02:00
checkPhase = ''
runHook preCheck
2020-10-21 19:17:21 +02:00
# newer gettext spews some warnings which fail the tests
substituteInPlace tests/test_po.py --replace "strict=True" "strict=False"
# otherwise tests can't find the app icons; instead of creating index.theme from scratch
# I re-used the one from hicolor-icon-theme which seems to work
cp "${hicolor-icon-theme}/share/icons/hicolor/index.theme" quodlibet/images/hicolor
env XDG_DATA_DIRS="$out/share:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_ICON_DIRS:$XDG_DATA_DIRS" \
2020-10-21 19:17:21 +02:00
GDK_PIXBUF_MODULE_FILE=${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
HOME=$(mktemp -d) \
2018-03-30 14:24:43 +02:00
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
--config-file=${dbus.daemon}/share/dbus-1/session.conf \
py.test $pytestFlags
2018-03-30 14:24:43 +02:00
runHook postCheck
'';
2021-01-15 14:21:58 +01:00
preFixup = lib.optionalString (kakasi != null) "gappsWrapperArgs+=(--prefix PATH : ${kakasi}/bin)";
meta = with lib; {
description = "GTK-based audio player written in Python, using the Mutagen tagging library";
2018-03-30 14:24:43 +02:00
license = licenses.gpl2Plus;
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.
'';
2020-10-24 18:06:06 +02:00
maintainers = with maintainers; [ coroa pbogdan ];
homepage = "https://quodlibet.readthedocs.io/en/latest/";
};
}