Merge pull request #185236 from mweinelt/quodlibet
This commit is contained in:
commit
1e6af0cdc8
2 changed files with 161 additions and 48 deletions
|
@ -1,66 +1,168 @@
|
|||
{ lib, fetchurl, python3, wrapGAppsHook, gettext, libsoup, gnome, gtk3, gdk-pixbuf, librsvg,
|
||||
tag ? "", xvfb-run, dbus, glibcLocales, glib, glib-networking, gobject-introspection, hicolor-icon-theme,
|
||||
gst_all_1, withGstPlugins ? true,
|
||||
xineBackend ? false, xine-lib,
|
||||
withDbusPython ? false, withPyInotify ? false, withMusicBrainzNgs ? false, withPahoMqtt ? false,
|
||||
webkitgtk ? null,
|
||||
keybinder3 ? null, gtksourceview ? null, libmodplug ? null, kakasi ? null, libappindicator-gtk3 ? null }:
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, tag ? ""
|
||||
|
||||
# build time
|
||||
, gettext
|
||||
, gobject-introspection
|
||||
, wrapGAppsHook
|
||||
|
||||
# runtime
|
||||
, adwaita-icon-theme
|
||||
, gdk-pixbuf
|
||||
, glib
|
||||
, glib-networking
|
||||
, gtk3
|
||||
, gtksourceview
|
||||
, kakasi
|
||||
, keybinder3
|
||||
, libappindicator-gtk3
|
||||
, libmodplug
|
||||
, librsvg
|
||||
, libsoup
|
||||
, webkitgtk
|
||||
|
||||
# optional features
|
||||
, withDbusPython ? false
|
||||
, withPypresence ? false
|
||||
, withPyInotify ? false
|
||||
, withMusicBrainzNgs ? false
|
||||
, withPahoMqtt ? false
|
||||
, withSoco ? false
|
||||
|
||||
# backends
|
||||
, withGstreamerBackend ? true, gst_all_1
|
||||
, withGstPlugins ? withGstreamerBackend
|
||||
, withXineBackend ? true, xine-lib
|
||||
|
||||
# tests
|
||||
, dbus
|
||||
, glibcLocales
|
||||
, hicolor-icon-theme
|
||||
, python3
|
||||
, xvfb-run
|
||||
}:
|
||||
|
||||
let optionals = lib.optionals; in
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "quodlibet${tag}";
|
||||
version = "4.5.0";
|
||||
format = "pyproject";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/quodlibet/quodlibet/releases/download/release-${version}/quodlibet-${version}.tar.gz";
|
||||
sha256 = "sha256-MBYVgp9lLLr+2zVTkjcWKli8HucaVn0kn3eJ2SaCRbw=";
|
||||
src = fetchFromGitHub {
|
||||
owner = "quodlibet";
|
||||
repo = "quodlibet";
|
||||
rev = "refs/tags/release-${version}";
|
||||
hash = "sha256-G6zcdnHkevbVCrMoseWoSia5ajEor8nZhee6NeZIs8Q=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ wrapGAppsHook gettext ];
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
# Fixes cover globbing under python 3.10.5+
|
||||
url = "https://github.com/quodlibet/quodlibet/commit/5eb7c30766e1dcb30663907664855ee94a3accc0.patch";
|
||||
hash = "sha256-bDyEOE7Vs4df4BeN4QMvt6niisVEpvc1onmX5rtoAWc=";
|
||||
})
|
||||
];
|
||||
|
||||
checkInputs = [ gdk-pixbuf hicolor-icon-theme ] ++ (with python3.pkgs; [ pytest pytest-xdist polib xvfb-run dbus.daemon glibcLocales ]);
|
||||
outputs = [
|
||||
"out"
|
||||
"doc"
|
||||
];
|
||||
|
||||
buildInputs = [ gnome.adwaita-icon-theme libsoup glib glib-networking gtk3 webkitgtk gdk-pixbuf keybinder3 gtksourceview libmodplug libappindicator-gtk3 kakasi gobject-introspection ]
|
||||
++ (if xineBackend then [ xine-lib ] else with gst_all_1;
|
||||
[ gstreamer gst-plugins-base ] ++ optionals withGstPlugins [ gst-plugins-good gst-plugins-ugly gst-plugins-bad ]);
|
||||
nativeBuildInputs = [
|
||||
gettext
|
||||
gobject-introspection
|
||||
wrapGAppsHook
|
||||
] ++ (with python3.pkgs; [
|
||||
sphinxHook
|
||||
sphinx-rtd-theme
|
||||
]);
|
||||
|
||||
propagatedBuildInputs = with python3.pkgs; [ pygobject3 pycairo mutagen gst-python feedparser ]
|
||||
++ optionals withDbusPython [ dbus-python ]
|
||||
++ optionals withPyInotify [ pyinotify ]
|
||||
++ optionals withMusicBrainzNgs [ musicbrainzngs ]
|
||||
++ optionals withPahoMqtt [ paho-mqtt ];
|
||||
buildInputs = [
|
||||
adwaita-icon-theme
|
||||
gdk-pixbuf
|
||||
glib
|
||||
glib-networking
|
||||
gtk3
|
||||
gtksourceview
|
||||
kakasi
|
||||
keybinder3
|
||||
libappindicator-gtk3
|
||||
libmodplug
|
||||
libsoup
|
||||
webkitgtk
|
||||
] ++ lib.optionals (withXineBackend) [
|
||||
xine-lib
|
||||
] ++ lib.optionals (withGstreamerBackend) (with gst_all_1; [
|
||||
gst-plugins-base
|
||||
gstreamer
|
||||
] ++ lib.optionals (withGstPlugins) [
|
||||
gst-plugins-bad
|
||||
gst-plugins-good
|
||||
gst-plugins-ugly
|
||||
]);
|
||||
|
||||
propagatedBuildInputs = with python3.pkgs; [
|
||||
feedparser
|
||||
gst-python
|
||||
mutagen
|
||||
pycairo
|
||||
pygobject3
|
||||
]
|
||||
++ lib.optionals withDbusPython [ dbus-python ]
|
||||
++ lib.optionals withPypresence [ pypresence ]
|
||||
++ lib.optionals withPyInotify [ pyinotify ]
|
||||
++ lib.optionals withMusicBrainzNgs [ musicbrainzngs ]
|
||||
++ lib.optionals withPahoMqtt [ paho-mqtt ]
|
||||
++ lib.optionals withSoco [ soco ];
|
||||
|
||||
LC_ALL = "en_US.UTF-8";
|
||||
|
||||
pytestFlags = lib.optionals (xineBackend || !withGstPlugins) [
|
||||
"--ignore=tests/plugin/test_replaygain.py"
|
||||
] ++ [
|
||||
checkInputs = [
|
||||
dbus.daemon
|
||||
gdk-pixbuf
|
||||
glibcLocales
|
||||
hicolor-icon-theme
|
||||
xvfb-run
|
||||
] ++ (with python3.pkgs; [
|
||||
polib
|
||||
pytest
|
||||
pytest-xdist
|
||||
]);
|
||||
|
||||
pytestFlags = [
|
||||
# requires networking
|
||||
"--ignore=tests/test_browsers_iradio.py"
|
||||
# the default theme doesn't have the required icons
|
||||
"--ignore=tests/plugin/test_trayicon.py"
|
||||
"--deselect=tests/test_browsers_iradio.py::TIRFile::test_download_tags"
|
||||
# missing translation strings in potfiles
|
||||
"--deselect=tests/test_po.py::TPOTFILESIN::test_missing"
|
||||
# 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"
|
||||
] ++ lib.optionals (withXineBackend || !withGstPlugins) [
|
||||
"--ignore=tests/plugin/test_replaygain.py"
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
export XDG_DATA_DIRS="$out/share:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_ICON_DIRS:$XDG_DATA_DIRS"
|
||||
export GDK_PIXBUF_MODULE_FILE=${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
|
||||
export HOME=$(mktemp -d)
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
# 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" \
|
||||
GDK_PIXBUF_MODULE_FILE=${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
|
||||
HOME=$(mktemp -d) \
|
||||
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
|
||||
--config-file=${dbus.daemon}/share/dbus-1/session.conf \
|
||||
py.test $pytestFlags
|
||||
|
||||
xvfb-run -s '-screen 0 1920x1080x24' \
|
||||
dbus-run-session --config-file=${dbus.daemon}/share/dbus-1/session.conf \
|
||||
pytest $pytestFlags
|
||||
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
preFixup = lib.optionalString (kakasi != null) "gappsWrapperArgs+=(--prefix PATH : ${kakasi}/bin)";
|
||||
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";
|
||||
|
|
|
@ -30543,33 +30543,44 @@ with pkgs;
|
|||
quiterss = libsForQt514.callPackage ../applications/networking/newsreaders/quiterss {};
|
||||
|
||||
quodlibet = callPackage ../applications/audio/quodlibet {
|
||||
keybinder3 = null;
|
||||
libmodplug = null;
|
||||
inherit (gnome) adwaita-icon-theme;
|
||||
kakasi = null;
|
||||
keybinder3 = null;
|
||||
libappindicator-gtk3 = null;
|
||||
libmodplug = null;
|
||||
};
|
||||
|
||||
quodlibet-without-gst-plugins = quodlibet.override {
|
||||
withGstPlugins = false;
|
||||
tag = "-without-gst-plugins";
|
||||
withGstPlugins = false;
|
||||
};
|
||||
|
||||
quodlibet-xine = quodlibet.override { xineBackend = true; tag = "-xine"; };
|
||||
quodlibet-xine = quodlibet.override {
|
||||
tag = "-xine";
|
||||
withGstreamerBackend = false;
|
||||
withXineBackend = true;
|
||||
};
|
||||
|
||||
quodlibet-full = quodlibet.override {
|
||||
inherit gtksourceview webkitgtk;
|
||||
kakasi = kakasi;
|
||||
keybinder3 = keybinder3;
|
||||
libappindicator-gtk3 = libappindicator-gtk3;
|
||||
libmodplug = libmodplug;
|
||||
tag = "-full";
|
||||
withDbusPython = true;
|
||||
withPyInotify = true;
|
||||
withMusicBrainzNgs = true;
|
||||
withPahoMqtt = true;
|
||||
keybinder3 = keybinder3;
|
||||
libmodplug = libmodplug;
|
||||
kakasi = kakasi;
|
||||
libappindicator-gtk3 = libappindicator-gtk3;
|
||||
tag = "-full";
|
||||
withPyInotify = true;
|
||||
withPypresence = true;
|
||||
withSoco = true;
|
||||
};
|
||||
|
||||
quodlibet-xine-full = quodlibet-full.override { xineBackend = true; tag = "-xine-full"; };
|
||||
quodlibet-xine-full = quodlibet-full.override {
|
||||
tag = "-xine-full";
|
||||
withGstreamerBackend = false;
|
||||
withXineBackend = true;
|
||||
};
|
||||
|
||||
qutebrowser = libsForQt5.callPackage ../applications/networking/browsers/qutebrowser { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue