2023-02-02 18:25:31 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitLab
|
2021-04-22 02:08:21 +00:00
|
|
|
, python3Packages
|
|
|
|
, gobject-introspection
|
|
|
|
, gtk3
|
|
|
|
, pango
|
|
|
|
, wrapGAppsHook
|
2021-05-20 23:08:51 +00:00
|
|
|
, xvfb-run
|
2020-08-20 17:08:02 +00:00
|
|
|
, chromecastSupport ? false
|
|
|
|
, serverSupport ? false
|
|
|
|
, keyringSupport ? true
|
2023-02-02 18:25:31 +00:00
|
|
|
, notifySupport ? true
|
|
|
|
, libnotify
|
|
|
|
, networkSupport ? true
|
|
|
|
, networkmanager
|
2020-08-20 17:08:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "sublime-music";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.11.16";
|
2021-04-22 02:08:21 +00:00
|
|
|
format = "pyproject";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "sublime-music";
|
|
|
|
repo = pname;
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-n77mTgElwwFaX3WQL8tZzbkPwnsyQ08OW9imSOjpBlg=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gobject-introspection
|
2021-04-22 02:08:21 +00:00
|
|
|
python3Packages.poetry-core
|
2022-09-30 11:47:45 +00:00
|
|
|
python3Packages.pythonRelaxDepsHook
|
2020-08-20 17:08:02 +00:00
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
# Can be removed in later versions (probably > 0.11.16)
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"deepdiff"
|
|
|
|
"python-mpv"
|
|
|
|
];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "/--cov/d" setup.cfg
|
|
|
|
sed -i "/--no-cov-on-fail/d" setup.cfg
|
|
|
|
# https://github.com/sublime-music/sublime-music/pull/370
|
|
|
|
# Can be removed in later versions (probably > 0.11.16)
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'python-Levenshtein = "^0.12.0"' 'Levenshtein = ">0.12.0"'
|
|
|
|
'';
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
buildInputs = [
|
|
|
|
gtk3
|
|
|
|
pango
|
|
|
|
]
|
2023-02-02 18:25:31 +00:00
|
|
|
++ lib.optional notifySupport libnotify
|
|
|
|
++ lib.optional networkSupport networkmanager
|
2020-08-20 17:08:02 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2021-04-05 15:23:46 +00:00
|
|
|
bleach
|
2020-08-20 17:08:02 +00:00
|
|
|
dataclasses-json
|
|
|
|
deepdiff
|
|
|
|
fuzzywuzzy
|
|
|
|
mpv
|
|
|
|
peewee
|
|
|
|
pygobject3
|
2023-01-20 10:41:00 +00:00
|
|
|
levenshtein
|
2020-08-20 17:08:02 +00:00
|
|
|
python-dateutil
|
|
|
|
requests
|
|
|
|
semver
|
|
|
|
]
|
2023-02-02 18:25:31 +00:00
|
|
|
++ lib.optional chromecastSupport PyChromecast
|
|
|
|
++ lib.optional keyringSupport keyring
|
|
|
|
++ lib.optional serverSupport bottle
|
2020-08-20 17:08:02 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
# hook for gobject-introspection doesn't like strictDeps
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/56943
|
|
|
|
strictDeps = false;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [
|
2021-04-22 02:08:21 +00:00
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
checkPhase = ''
|
|
|
|
${xvfb-run}/bin/xvfb-run pytest
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"sublime_music"
|
|
|
|
];
|
2021-04-05 15:23:46 +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
|
|
|
|
'';
|
2021-01-09 10:05:03 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "GTK3 Subsonic/Airsonic client";
|
|
|
|
homepage = "https://sublimemusic.app/";
|
2023-02-02 18:25:31 +00:00
|
|
|
changelog = "https://github.com/sublime-music/sublime-music/blob/v${version}/CHANGELOG.rst";
|
2020-08-20 17:08:02 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2021-04-05 15:23:46 +00:00
|
|
|
maintainers = with maintainers; [ albakham sumnerevans ];
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
}
|