Merge pull request #313995 from matthiasdotsh/python3Packages.soundcard
python312Packages.soundcard init at 0.4.3
This commit is contained in:
commit
82acc93ba6
@ -12705,6 +12705,12 @@
|
|||||||
githubId = 427866;
|
githubId = 427866;
|
||||||
name = "Matthias Beyer";
|
name = "Matthias Beyer";
|
||||||
};
|
};
|
||||||
|
matthiasdotsh = {
|
||||||
|
email = "git@matthias.sh";
|
||||||
|
name = "Matthias";
|
||||||
|
github = "matthiasdotsh";
|
||||||
|
githubId = 142118899;
|
||||||
|
};
|
||||||
matthiasq = {
|
matthiasq = {
|
||||||
email = "matthias.queitsch@mailbox.org";
|
email = "matthias.queitsch@mailbox.org";
|
||||||
github = "matthias-Q";
|
github = "matthias-Q";
|
||||||
|
50
pkgs/development/python-modules/soundcard/default.nix
Normal file
50
pkgs/development/python-modules/soundcard/default.nix
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
buildPythonPackage,
|
||||||
|
cffi,
|
||||||
|
fetchPypi,
|
||||||
|
lib,
|
||||||
|
libpulseaudio,
|
||||||
|
numpy,
|
||||||
|
setuptools,
|
||||||
|
testers,
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
version = "0.4.3";
|
||||||
|
in
|
||||||
|
buildPythonPackage {
|
||||||
|
inherit version;
|
||||||
|
pname = "soundcard";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchPypi {
|
||||||
|
inherit version;
|
||||||
|
pname = "SoundCard";
|
||||||
|
hash = "sha256-QQg1UUuhCAmAPLmIfUJw85K1nq82WRW7lFFq8/ix0Dc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patchPhase = ''
|
||||||
|
substituteInPlace soundcard/pulseaudio.py \
|
||||||
|
--replace "'pulse'" "'${libpulseaudio}/lib/libpulse.so'"
|
||||||
|
'';
|
||||||
|
|
||||||
|
build-system = [ setuptools ];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
cffi
|
||||||
|
numpy
|
||||||
|
];
|
||||||
|
|
||||||
|
# doesn't work because there are not many soundcards in the
|
||||||
|
# sandbox. See VM-test
|
||||||
|
# pythonImportsCheck = [ "soundcard" ];
|
||||||
|
|
||||||
|
passthru.tests.vm-with-soundcard = testers.runNixOSTest ./test.nix;
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Pure-Python Real-Time Audio Library";
|
||||||
|
homepage = "https://github.com/bastibe/SoundCard";
|
||||||
|
changelog = "https://github.com/bastibe/SoundCard/blob/${version}/README.rst#changelog";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
maintainers = with lib.maintainers; [ matthiasdotsh ];
|
||||||
|
};
|
||||||
|
}
|
47
pkgs/development/python-modules/soundcard/test.nix
Normal file
47
pkgs/development/python-modules/soundcard/test.nix
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
name = "Python Soundcard Library Test";
|
||||||
|
|
||||||
|
nodes.machine =
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
environment.systemPackages = [ (pkgs.python3.withPackages (ps: [ ps.soundcard ])) ];
|
||||||
|
|
||||||
|
hardware.pulseaudio.enable = true;
|
||||||
|
hardware.pulseaudio.systemWide = true;
|
||||||
|
|
||||||
|
virtualisation.qemu.options = [
|
||||||
|
"-device virtio-sound-pci,audiodev=my_audiodev"
|
||||||
|
"-audiodev wav,id=my_audiodev"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
interactive.nodes.machine =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.openssh.enable = true;
|
||||||
|
services.openssh.settings.PermitRootLogin = "yes";
|
||||||
|
users.extraUsers.root.initialPassword = "";
|
||||||
|
users.extraUsers.root.hashedPassword = null;
|
||||||
|
users.extraUsers.root.hashedPasswordFile = null;
|
||||||
|
users.extraUsers.root.initialHashedPassword = null;
|
||||||
|
virtualisation.forwardPorts = [
|
||||||
|
{
|
||||||
|
from = "host";
|
||||||
|
host.port = 2222;
|
||||||
|
guest.port = 22;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript =
|
||||||
|
let
|
||||||
|
script = builtins.toFile "import.py" ''
|
||||||
|
import soundcard
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
''
|
||||||
|
start_all()
|
||||||
|
machine.wait_for_unit("multi-user.target")
|
||||||
|
machine.succeed("python ${script}")
|
||||||
|
'';
|
||||||
|
}
|
@ -14566,6 +14566,8 @@ self: super: with self; {
|
|||||||
|
|
||||||
sortedcontainers = callPackage ../development/python-modules/sortedcontainers { };
|
sortedcontainers = callPackage ../development/python-modules/sortedcontainers { };
|
||||||
|
|
||||||
|
soundcard = callPackage ../development/python-modules/soundcard { };
|
||||||
|
|
||||||
soundcloud-v2 = callPackage ../development/python-modules/soundcloud-v2 { };
|
soundcloud-v2 = callPackage ../development/python-modules/soundcloud-v2 { };
|
||||||
|
|
||||||
sounddevice = callPackage ../development/python-modules/sounddevice { };
|
sounddevice = callPackage ../development/python-modules/sounddevice { };
|
||||||
|
Loading…
Reference in New Issue
Block a user