2021-04-19 08:24:57 +00:00
|
|
|
{ fetchFromGitLab
|
|
|
|
, lib
|
|
|
|
, python3Packages
|
|
|
|
, gobject-introspection
|
|
|
|
, gtk3
|
|
|
|
, pango
|
|
|
|
, wrapGAppsHook
|
2021-05-08 13:45:03 +00:00
|
|
|
, xvfb-run
|
2020-07-25 15:32:23 +00:00
|
|
|
, chromecastSupport ? false
|
|
|
|
, serverSupport ? false
|
|
|
|
, keyringSupport ? true
|
|
|
|
, notifySupport ? true, libnotify
|
|
|
|
, networkSupport ? true, networkmanager
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "sublime-music";
|
2021-08-23 20:26:03 +00:00
|
|
|
version = "0.11.13";
|
2021-04-19 08:24:57 +00:00
|
|
|
format = "pyproject";
|
2020-07-25 15:32:23 +00:00
|
|
|
|
2020-09-30 23:54:06 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "sublime-music";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-08-23 20:26:03 +00:00
|
|
|
sha256 = "sha256-NzbQtRcsRVppyuG1UuS3IidSnniUOavf5YoAf/kcZqw=";
|
2020-07-25 15:32:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gobject-introspection
|
2021-04-19 08:24:57 +00:00
|
|
|
python3Packages.poetry-core
|
2020-07-25 15:32:23 +00:00
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gtk3
|
|
|
|
pango
|
|
|
|
]
|
|
|
|
++ lib.optional notifySupport libnotify
|
|
|
|
++ lib.optional networkSupport networkmanager
|
|
|
|
;
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2020-09-30 23:54:06 +00:00
|
|
|
bleach
|
2020-07-25 15:32:23 +00:00
|
|
|
dataclasses-json
|
|
|
|
deepdiff
|
|
|
|
fuzzywuzzy
|
|
|
|
mpv
|
|
|
|
peewee
|
|
|
|
pygobject3
|
|
|
|
python-Levenshtein
|
|
|
|
python-dateutil
|
|
|
|
requests
|
|
|
|
semver
|
|
|
|
]
|
|
|
|
++ lib.optional chromecastSupport PyChromecast
|
|
|
|
++ lib.optional keyringSupport keyring
|
|
|
|
++ lib.optional serverSupport bottle
|
|
|
|
;
|
|
|
|
|
|
|
|
# hook for gobject-introspection doesn't like strictDeps
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/56943
|
|
|
|
strictDeps = false;
|
|
|
|
|
2021-04-19 08:24:57 +00:00
|
|
|
# Use the test suite provided by the upstream project.
|
|
|
|
checkInputs = with python3Packages; [
|
|
|
|
pytest
|
|
|
|
pytest-cov
|
|
|
|
];
|
2021-05-08 13:45:03 +00:00
|
|
|
checkPhase = "${xvfb-run}/bin/xvfb-run pytest";
|
2021-04-19 08:24:57 +00:00
|
|
|
|
|
|
|
# Also run the python import check for sanity
|
2020-09-30 23:54:06 +00:00
|
|
|
pythonImportsCheck = [ "sublime_music" ];
|
2021-01-04 02:30:21 +00:00
|
|
|
|
2020-09-30 23:54:40 +00:00
|
|
|
postInstall = ''
|
|
|
|
install -Dm444 sublime-music.desktop -t $out/share/applications
|
|
|
|
install -Dm444 sublime-music.metainfo.xml -t $out/share/metainfo
|
|
|
|
|
|
|
|
for size in 16 22 32 48 64 72 96 128 192 512 1024; do
|
|
|
|
install -Dm444 logo/rendered/"$size".png \
|
|
|
|
$out/share/icons/hicolor/"$size"x"$size"/apps/sublime-music.png
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2020-07-25 15:32:23 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "GTK3 Subsonic/Airsonic client";
|
|
|
|
homepage = "https://sublimemusic.app/";
|
|
|
|
license = licenses.gpl3Plus;
|
2021-03-22 01:20:46 +00:00
|
|
|
maintainers = with maintainers; [ albakham sumnerevans ];
|
2020-07-25 15:32:23 +00:00
|
|
|
};
|
|
|
|
}
|