about summary refs log tree commit diff
path: root/pkgs/by-name/su
diff options
context:
space:
mode:
authorJonas Heinrich <onny@project-insanity.org>2024-06-15 16:53:51 +0200
committerGitHub <noreply@github.com>2024-06-15 16:53:51 +0200
commitf15be30a76601a59ff9d97287d8554c34fc04c66 (patch)
tree10a8a2d838eadd834c6f02f6c606d1f7f21dc3e1 /pkgs/by-name/su
parent3da97e2163d090fbf03929971357a6757dc44037 (diff)
parent78c3078a6d512b4283c402832c64a87bcaffc42f (diff)
Merge pull request #319297 from onny/sublime-music2
sublime-music: 0.12.0 -> 0.12.0-unstable-2024-01-06
Diffstat (limited to 'pkgs/by-name/su')
-rw-r--r--pkgs/by-name/su/sublime-music/package.nix109
1 files changed, 109 insertions, 0 deletions
diff --git a/pkgs/by-name/su/sublime-music/package.nix b/pkgs/by-name/su/sublime-music/package.nix
new file mode 100644
index 0000000000000..e2a7874a0eb05
--- /dev/null
+++ b/pkgs/by-name/su/sublime-music/package.nix
@@ -0,0 +1,109 @@
+{ lib
+, fetchFromGitHub
+, python3
+, gobject-introspection
+, gtk3
+, pango
+, wrapGAppsHook3
+, chromecastSupport ? false
+, serverSupport ? false
+, keyringSupport ? true
+, notifySupport ? true
+, libnotify
+, networkSupport ? true
+, networkmanager
+, fetchpatch
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "sublime-music";
+  version = "0.12.0-unstable-2024-01-06";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "sublime-music";
+    repo = "sublime-music";
+    rev = "0b4ba69a7ff7ad2dfcb0a264587921f323030766";
+    hash = "sha256-NoJ50n/AjM738ebQ/Wccwp2l0sC3VBvKovJvDhDa5SU=";
+  };
+
+  patches = [
+    # Fix loadfile command https://github.com/sublime-music/sublime-music/pull/461
+    (fetchpatch {
+      url = "https://github.com/sublime-music/sublime-music/commit/1d107fec2ac7f83e0c49bab663273b31c9072411.patch";
+      hash = "sha256-fUss4kqlFiXRr37AIaeWEv/4Bpzx5xkW28OEnsjQqzY=";
+    })
+  ];
+
+  postPatch = ''
+    sed -i "/--cov/d" setup.cfg
+    sed -i "/--no-cov-on-fail/d" setup.cfg
+  '';
+
+  build-system = with python3.pkgs; [
+    flit-core
+  ];
+
+  nativeBuildInputs = [
+    gobject-introspection
+    wrapGAppsHook3
+  ];
+
+  buildInputs = [
+    gtk3
+    pango
+  ]
+  ++ lib.optional notifySupport libnotify
+  ++ lib.optional networkSupport networkmanager
+  ;
+
+  propagatedBuildInputs = with python3.pkgs; [
+    bleach
+    bottle
+    dataclasses-json
+    deepdiff
+    levenshtein
+    mpv
+    peewee
+    pychromecast
+    pygobject3
+    python-dateutil
+    requests
+    semver
+    thefuzz
+  ]
+  ++ lib.optional keyringSupport keyring
+  ;
+
+  nativeCheckInputs = with python3.pkgs; [
+    pytestCheckHook
+  ];
+
+  disabledTests = [
+    # https://github.com/sublime-music/sublime-music/issues/439
+    "test_get_music_directory"
+  ];
+
+  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";
+    changelog = "https://github.com/sublime-music/sublime-music/blob/v${version}/CHANGELOG.rst";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ albakham sumnerevans ];
+    mainProgram = "sublime-music";
+  };
+}