2023-01-24 16:41:24 +00:00
|
|
|
{ lib
|
2023-05-04 11:33:55 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
2021-04-19 08:24:57 +00:00
|
|
|
, 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
|
2023-01-24 16:41:24 +00:00
|
|
|
, notifySupport ? true
|
|
|
|
, libnotify
|
|
|
|
, networkSupport ? true
|
|
|
|
, networkmanager
|
2020-07-25 15:32:23 +00:00
|
|
|
}:
|
|
|
|
|
2023-05-04 11:33:55 +00:00
|
|
|
let
|
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
semver = super.semver.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "2.13.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-semver";
|
|
|
|
repo = "python-semver";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-IWTo/P9JRxBQlhtcH3JMJZZrwAA8EALF4dtHajWUc4w=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
python.pkgs.buildPythonApplication rec {
|
2020-07-25 15:32:23 +00:00
|
|
|
pname = "sublime-music";
|
2023-06-10 19:20:45 +00:00
|
|
|
version = "0.12.0";
|
|
|
|
format = "flit";
|
2020-07-25 15:32:23 +00:00
|
|
|
|
2023-06-10 19:20:45 +00:00
|
|
|
src = fetchFromGitHub {
|
2020-09-30 23:54:06 +00:00
|
|
|
owner = "sublime-music";
|
|
|
|
repo = pname;
|
2023-01-24 12:58:17 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-06-10 19:20:45 +00:00
|
|
|
hash = "sha256-FPzeFqDOcaiariz7qJwz6P3Wd+ZDxNP57uj+ptMtEyM=";
|
2020-07-25 15:32:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gobject-introspection
|
|
|
|
wrapGAppsHook
|
2022-10-23 08:32:11 +00:00
|
|
|
];
|
2022-09-08 08:17:09 +00:00
|
|
|
|
2023-01-24 16:41:24 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "/--cov/d" setup.cfg
|
|
|
|
sed -i "/--no-cov-on-fail/d" setup.cfg
|
|
|
|
'';
|
|
|
|
|
2020-07-25 15:32:23 +00:00
|
|
|
buildInputs = [
|
|
|
|
gtk3
|
|
|
|
pango
|
|
|
|
]
|
2023-01-24 16:41:24 +00:00
|
|
|
++ lib.optional notifySupport libnotify
|
|
|
|
++ lib.optional networkSupport networkmanager
|
2020-07-25 15:32:23 +00:00
|
|
|
;
|
|
|
|
|
2023-05-04 11:33:55 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
2020-09-30 23:54:06 +00:00
|
|
|
bleach
|
2023-06-10 19:20:45 +00:00
|
|
|
bottle
|
2020-07-25 15:32:23 +00:00
|
|
|
dataclasses-json
|
|
|
|
deepdiff
|
2023-06-10 19:20:45 +00:00
|
|
|
levenshtein
|
2020-07-25 15:32:23 +00:00
|
|
|
mpv
|
|
|
|
peewee
|
2023-06-10 19:20:45 +00:00
|
|
|
pychromecast
|
2020-07-25 15:32:23 +00:00
|
|
|
pygobject3
|
|
|
|
python-dateutil
|
|
|
|
requests
|
|
|
|
semver
|
2023-06-10 19:20:45 +00:00
|
|
|
thefuzz
|
2020-07-25 15:32:23 +00:00
|
|
|
]
|
2023-01-24 16:41:24 +00:00
|
|
|
++ lib.optional keyringSupport keyring
|
2020-07-25 15:32:23 +00:00
|
|
|
;
|
|
|
|
|
2023-05-04 11:33:55 +00:00
|
|
|
nativeCheckInputs = with python.pkgs; [
|
2021-04-19 08:24:57 +00:00
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
2021-11-09 12:36:51 +00:00
|
|
|
checkPhase = ''
|
2021-11-11 06:54:42 +00:00
|
|
|
${xvfb-run}/bin/xvfb-run pytest
|
2021-11-09 12:36:51 +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/";
|
2023-01-24 12:58:17 +00:00
|
|
|
changelog = "https://github.com/sublime-music/sublime-music/blob/v${version}/CHANGELOG.rst";
|
2020-07-25 15:32:23 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2021-03-22 01:20:46 +00:00
|
|
|
maintainers = with maintainers; [ albakham sumnerevans ];
|
2020-07-25 15:32:23 +00:00
|
|
|
};
|
|
|
|
}
|