diff --git a/pkgs/applications/misc/onthespot/default.nix b/pkgs/applications/misc/onthespot/default.nix new file mode 100644 index 000000000000..642c76563329 --- /dev/null +++ b/pkgs/applications/misc/onthespot/default.nix @@ -0,0 +1,64 @@ +{ lib +, python3 +, fetchFromGitHub +, copyDesktopItems +, wrapQtAppsHook +, makeDesktopItem +}: + +python3.pkgs.buildPythonApplication rec { + pname = "onthespot"; + version = "0.5"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "casualsnek"; + repo = "onthespot"; + rev = "v${version}"; + hash = "sha256-VaJBNsT7uNOGY43GnzhUqDQNiPoFZcc2UaIfOKgkufg="; + }; + + nativeBuildInputs = with python3.pkgs; [ + copyDesktopItems + pythonRelaxDepsHook + wrapQtAppsHook + ]; + + propagatedBuildInputs = with python3.pkgs; [ + charset-normalizer + defusedxml + librespot + music-tag + packaging + pillow + protobuf + pyogg + pyqt5 + pyqt5_sip + pyxdg + requests + setuptools + show-in-file-manager + urllib3 + zeroconf + ]; + + pythonRemoveDeps = [ + "PyQt5-Qt5" + "PyQt5-stubs" + ]; + + pythonRelaxDeps = true; + + preFixup = '' + makeWrapperArgs+=("''${qtWrapperArgs[@]}") + ''; + + meta = { + description = " QT based Spotify music downloader written in Python"; + homepage = "https://github.com/casualsnek/onthespot"; + license = lib.licenses.gpl2; + maintainers = with lib.maintainers; [ onny ]; + platforms = lib.platforms.linux; + }; +} diff --git a/pkgs/development/python-modules/librespot/default.nix b/pkgs/development/python-modules/librespot/default.nix new file mode 100644 index 000000000000..21a25729fa4b --- /dev/null +++ b/pkgs/development/python-modules/librespot/default.nix @@ -0,0 +1,61 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, defusedxml +, protobuf +, pythonRelaxDepsHook +, websocket-client +, pyogg +, zeroconf +, requests +, pycryptodomex +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "librespot"; + version = "0.0.9"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "kokarare1212"; + repo = "librespot-python"; + rev = "v${version}"; + hash = "sha256-k9qVsxjRlUZ7vCBx00quiAR7S+YkfyoZiAKVnOOG4xM="; + }; + + nativeBuildInputs = [ + pythonRelaxDepsHook + ]; + + propagatedBuildInputs = [ + defusedxml + protobuf + pycryptodomex + pyogg + requests + websocket-client + zeroconf + ]; + + pythonRelaxDeps = [ + "protobuf" + "pyogg" + "requests" + "zeroconf" + ]; + + # Doesn't include any tests + doCheck = false; + + pythonImportsCheck = [ + "librespot" + ]; + + meta = with lib; { + description = "Open Source Spotify Client"; + homepage = "https://github.com/kokarare1212/librespot-python"; + license = licenses.asl20; + maintainers = with maintainers; [ onny ]; + }; +} diff --git a/pkgs/development/python-modules/music-tag/default.nix b/pkgs/development/python-modules/music-tag/default.nix new file mode 100644 index 000000000000..f997ca47253c --- /dev/null +++ b/pkgs/development/python-modules/music-tag/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchPypi +, mutagen +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "music-tag"; + version = "0.4.3"; + format = "setuptools"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-Cqtubu2o3w9TFuwtIZC9dFYbfgNWKrCRzo1Wh828//Y="; + }; + + propagatedBuildInputs = [ + mutagen + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pytestFlagsArray = [ "test" ]; + + # Tests fail: ModuleNotFoundError: No module named '_test_common' + doCheck = false; + + pythonImportsCheck = [ + "music_tag" + ]; + + meta = with lib; { + description = "Simple interface to edit audio file metadata"; + homepage = "https://github.com/KristoforMaynard/music-tag"; + license = licenses.mit; + maintainers = with maintainers; [ onny ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 583343fbd9f8..f521fbcb14cd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11141,6 +11141,8 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security; }; + onthespot = libsForQt5.callPackage ../applications/misc/onthespot { }; + opencorsairlink = callPackage ../tools/misc/opencorsairlink { }; openfpgaloader = callPackage ../development/embedded/fpga/openfpgaloader { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5fe2683244c6..983b0569aa9a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5898,6 +5898,8 @@ self: super: with self; { (p: p.py) ]; + librespot = callPackage ../development/python-modules/librespot { }; + libretranslate = callPackage ../development/python-modules/libretranslate { }; librosa = callPackage ../development/python-modules/librosa { }; @@ -6756,6 +6758,8 @@ self: super: with self; { musicbrainzngs = callPackage ../development/python-modules/musicbrainzngs { }; + music-tag = callPackage ../development/python-modules/music-tag { }; + mutag = callPackage ../development/python-modules/mutag { }; mutagen = callPackage ../development/python-modules/mutagen { };