diff --git a/pkgs/development/python-modules/samplerate-ledfx/default.nix b/pkgs/development/python-modules/samplerate-ledfx/default.nix new file mode 100644 index 000000000000..cd95073ca359 --- /dev/null +++ b/pkgs/development/python-modules/samplerate-ledfx/default.nix @@ -0,0 +1,63 @@ +{ + lib, + buildPythonPackage, + cmake, + fetchFromGitHub, + libsamplerate, + numpy, + pybind11, + pytest-asyncio, + pytestCheckHook, + pythonAtLeast, + setuptools, + setuptools-scm, +}: + +buildPythonPackage (finalAttrs: { + pname = "samplerate-ledfx"; + version = "0.2.6"; + pyproject = true; + + disabled = pythonAtLeast "3.14"; + + src = fetchFromGitHub { + owner = "LedFx"; + repo = "python-samplerate-ledfx"; + tag = "v${finalAttrs.version}"; + hash = "sha256-SLmaWSq/Ou23BfdWKlzE9gIfORgF9skUVEw1Tzpd5b4="; + }; + + # unvendor pybind11, libsamplerate + postPatch = '' + rm -r external + substituteInPlace CMakeLists.txt \ + --replace-fail "add_subdirectory(external)" "find_package(pybind11 REQUIRED)" + ''; + + build-system = [ + cmake + pybind11 + setuptools + setuptools-scm + ]; + + dontUseCmakeConfigure = true; + + buildInputs = [ libsamplerate ]; + + dependencies = [ numpy ]; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + pythonImportsCheck = [ "samplerate" ]; + + meta = { + description = "Bindings for libsamplerate based on CFFI and NumPy"; + homepage = "https://github.com/LedFx/python-samplerate-ledfx"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ SuperSandro2000 ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1a12878ebcf6..215bfb2f5329 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -17316,6 +17316,10 @@ self: super: with self; { samplerate = callPackage ../development/python-modules/samplerate { inherit (pkgs) libsamplerate; }; + samplerate-ledfx = callPackage ../development/python-modules/samplerate-ledfx { + inherit (pkgs) libsamplerate; + }; + samsungctl = callPackage ../development/python-modules/samsungctl { }; samsungtvws = callPackage ../development/python-modules/samsungtvws { };