summary refs log tree commit diff
path: root/pkgs/applications/audio/sublime-music/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/audio/sublime-music/default.nix')
-rw-r--r--pkgs/applications/audio/sublime-music/default.nix46
1 files changed, 38 insertions, 8 deletions
diff --git a/pkgs/applications/audio/sublime-music/default.nix b/pkgs/applications/audio/sublime-music/default.nix
index 515a653d6bc..3d25ec3cdbb 100644
--- a/pkgs/applications/audio/sublime-music/default.nix
+++ b/pkgs/applications/audio/sublime-music/default.nix
@@ -1,5 +1,11 @@
-{ lib, python3Packages, gobject-introspection, gtk3, pango, wrapGAppsHook
-
+{ fetchFromGitLab
+, lib
+, python3Packages
+, gobject-introspection
+, gtk3
+, pango
+, wrapGAppsHook
+, xvfb-run
 , chromecastSupport ? false
 , serverSupport ? false
 , keyringSupport ? true
@@ -9,16 +15,19 @@
 
 python3Packages.buildPythonApplication rec {
   pname = "sublime-music";
-  version = "0.11.0";
+  version = "0.11.12";
+  format = "pyproject";
 
-  src = python3Packages.fetchPypi {
-    inherit pname version;
-    sha256 = "1rnjc8pjfaq67mq10gy939g77azc80lxf77s9nsaxds4q5j1yrl2";
+  src = fetchFromGitLab {
+    owner = "sublime-music";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-fcEdpht+xKJRTaD3gKoRdf6O2SAPlZHZ61Jy8bdTKjs=";
   };
 
   nativeBuildInputs = [
     gobject-introspection
-    python3Packages.setuptools
+    python3Packages.poetry-core
     wrapGAppsHook
   ];
 
@@ -31,6 +40,7 @@ python3Packages.buildPythonApplication rec {
   ;
 
   propagatedBuildInputs = with python3Packages; [
+    bleach
     dataclasses-json
     deepdiff
     fuzzywuzzy
@@ -51,10 +61,30 @@ python3Packages.buildPythonApplication rec {
   # https://github.com/NixOS/nixpkgs/issues/56943
   strictDeps = false;
 
+  # Use the test suite provided by the upstream project.
+  checkInputs = with python3Packages; [
+    pytest
+    pytest-cov
+  ];
+  checkPhase = "${xvfb-run}/bin/xvfb-run pytest";
+
+  # Also run the python import check for sanity
+  pythonImportsCheck = [ "sublime_music" ];
+
+  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
+  '';
+
   meta = with lib; {
     description = "GTK3 Subsonic/Airsonic client";
     homepage = "https://sublimemusic.app/";
     license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ albakham ];
+    maintainers = with maintainers; [ albakham sumnerevans ];
   };
 }