diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-11-21 16:12:21 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-11-21 16:12:48 +0100 |
commit | 048a4cd441a59cbf89defb18bb45c9f0b4429b35 (patch) | |
tree | f8f5850ff05521ab82d65745894714a8796cbfb6 /pkgs/tools/audio | |
parent | 030c5028b07afcedce7c5956015c629486cc79d9 (diff) | |
parent | 4c2d05dd6435d449a3651a6dd314d9411b5f8146 (diff) | |
download | nixpkgs-rootfs.tar nixpkgs-rootfs.tar.gz nixpkgs-rootfs.tar.bz2 nixpkgs-rootfs.tar.lz nixpkgs-rootfs.tar.xz nixpkgs-rootfs.tar.zst nixpkgs-rootfs.zip |
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'pkgs/tools/audio')
21 files changed, 296 insertions, 229 deletions
diff --git a/pkgs/tools/audio/asap/default.nix b/pkgs/tools/audio/asap/default.nix index 67fb8253711..c4a9b03039c 100644 --- a/pkgs/tools/audio/asap/default.nix +++ b/pkgs/tools/audio/asap/default.nix @@ -6,11 +6,11 @@ stdenv.mkDerivation rec { pname = "asap"; - version = "5.3.0"; + version = "6.0.0"; src = fetchzip { url = "mirror://sourceforge/project/asap/asap/${version}/asap-${version}.tar.gz"; - sha256 = "sha256-ioEshlPE8eUcLxNkIl0lxnczMNAYRcJN8KGN6OansjY="; + sha256 = "sha256-j7vznFI/Yg1yuRvYDmRSyHDfDN7iFV+b6MK2jdnaz6Q="; }; outputs = [ "out" "dev" ]; diff --git a/pkgs/tools/audio/audiowaveform/default.nix b/pkgs/tools/audio/audiowaveform/default.nix index e2261182c47..11dc8541c5b 100644 --- a/pkgs/tools/audio/audiowaveform/default.nix +++ b/pkgs/tools/audio/audiowaveform/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "audiowaveform"; - version = "1.8.1"; + version = "1.9.1"; src = fetchFromGitHub { owner = "bbc"; repo = "audiowaveform"; rev = version; - sha256 = "sha256-MbOQY1Yvtwuy6IPV1BfwwRBhEQIzQ7mPzedE74xsQSk="; + sha256 = "sha256-qnidR+V2CwDnztUv73k72lVyH+B1yfb3c7BLus4P6Wk="; }; nativeBuildInputs = [ cmake gtest ]; diff --git a/pkgs/tools/audio/beets/common.nix b/pkgs/tools/audio/beets/common.nix index 440606bdd83..37faff29c72 100644 --- a/pkgs/tools/audio/beets/common.nix +++ b/pkgs/tools/audio/beets/common.nix @@ -26,6 +26,8 @@ , extraPatches ? [ ] , pluginOverrides ? { } , disableAllPlugins ? false +, disabledTests ? [] +, extraNativeBuildInputs ? [] # tests , runCommand @@ -52,12 +54,6 @@ python3Packages.buildPythonApplication { patches = extraPatches; - postPatch = '' - # https://github.com/beetbox/beets/pull/4868 - substituteInPlace beets/util/artresizer.py \ - --replace "Image.ANTIALIAS" "Image.Resampling.LANCZOS" - ''; - propagatedBuildInputs = with python3Packages; [ confuse gst-python @@ -76,7 +72,7 @@ python3Packages.buildPythonApplication { nativeBuildInputs = [ gobject-introspection sphinxHook - ]; + ] ++ extraNativeBuildInputs; buildInputs = [ ] ++ (with gst_all_1; [ @@ -93,24 +89,6 @@ python3Packages.buildPythonApplication { cp extra/_beet $out/share/zsh/site-functions/ ''; - doInstallCheck = true; - - installCheckPhase = '' - runHook preInstallCheck - - tmphome="$(mktemp -d)" - - EDITOR="${writeScript "beetconfig.sh" '' - #!${runtimeShell} - cat > "$1" <<CFG - plugins: ${lib.concatStringsSep " " (attrNames enabledPlugins)} - CFG - ''}" HOME="$tmphome" "$out/bin/beet" config -e - EDITOR=true HOME="$tmphome" "$out/bin/beet" config -e - - runHook postInstallCheck - ''; - makeWrapperArgs = [ "--set GI_TYPELIB_PATH \"$GI_TYPELIB_PATH\"" "--set GST_PLUGIN_SYSTEM_PATH_1_0 \"$GST_PLUGIN_SYSTEM_PATH_1_0\"" @@ -118,17 +96,17 @@ python3Packages.buildPythonApplication { ]; nativeCheckInputs = with python3Packages; [ - pytest + pytestCheckHook mock rarfile responses ] ++ pluginWrapperBins; disabledTestPaths = lib.flatten (attrValues (lib.mapAttrs (n: v: v.testPaths ++ [ "test/test_${n}.py" ]) disabledPlugins)); + inherit disabledTests; - checkPhase = '' - runHook preCheck - + # Perform extra "sanity checks", before running pytest tests. + preCheck = '' # Check for undefined plugins find beetsplug -mindepth 1 \ \! -path 'beetsplug/__init__.py' -a \ @@ -140,19 +118,13 @@ python3Packages.buildPythonApplication { export BEETS_TEST_SHELL="${bashInteractive}/bin/bash --norc" export HOME="$(mktemp -d)" - args=" -m pytest -r fEs" - eval "disabledTestPaths=($disabledTestPaths)" - for path in ''${disabledTestPaths[@]}; do - if [ -e "$path" ]; then - args+=" --ignore $path" - else - echo "Skipping non-existent test path '$path'" - fi - done - - python $args - - runHook postCheck + env EDITOR="${writeScript "beetconfig.sh" '' + #!${runtimeShell} + cat > "$1" <<CFG + plugins: ${lib.concatStringsSep " " (attrNames enabledPlugins)} + CFG + ''}" "$out/bin/beet" config -e + env EDITOR=true "$out/bin/beet" config -e ''; @@ -160,19 +132,17 @@ python3Packages.buildPythonApplication { passthru.tests.gstreamer = runCommand "beets-gstreamer-test" { meta.timeout = 60; - } - '' - set -euo pipefail - export HOME=$(mktemp -d) - mkdir $out + } '' + set -euo pipefail + export HOME=$(mktemp -d) + mkdir $out - cat << EOF > $out/config.yaml + cat << EOF > $out/config.yaml replaygain: backend: gstreamer EOF - echo $out/config.yaml - ${beets}/bin/beet -c $out/config.yaml > /dev/null + ${beets}/bin/beet -c $out/config.yaml > /dev/null ''; meta = with lib; { diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index 7f5c3bbceae..c78ccced9a8 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -2,6 +2,7 @@ , callPackage , fetchFromGitHub , fetchpatch +, python3Packages }: /* ** To customize the enabled beets plugins, use the pluginOverrides input to the @@ -20,6 +21,7 @@ lib.makeExtensible (self: { beets = self.beets-stable; beets-stable = callPackage ./common.nix rec { + inherit python3Packages; version = "1.6.0"; src = fetchFromGitHub { owner = "beetbox"; @@ -41,27 +43,46 @@ lib.makeExtensible (self: { # https://github.com/beetbox/beets/pull/4839 # The upstream patch does not apply on 1.6.0, as the related code has been refactored since ./patches/fix-embedart-imagick-7.1.1-12.patch + # Pillow 10 compatibility fix, a backport of + # https://github.com/beetbox/beets/pull/4868, which doesn't apply now + ./patches/fix-pillow10-compat.patch + ]; + disabledTests = [ + # This issue is present on this version alone, and can be removed on the + # next stable version version bump. Since this is fixed in branch master, + # we don't have a bug ticket open for this. As of writing, it also seems + # hard to find a patch that can be backported to v1.6.0 that would fix + # the failure, as the master branch has gone through too many changes + # now. + "test_get_single_item_by_path" ]; }; beets-minimal = self.beets.override { disableAllPlugins = true; }; beets-unstable = callPackage ./common.nix { - version = "unstable-2023-07-05"; + inherit python3Packages; + version = "unstable-2023-10-26"; src = fetchFromGitHub { owner = "beetbox"; repo = "beets"; - rev = "9481402b3c20739ca0b879d19adbfca22ccd6a44"; - hash = "sha256-AKmozMNVchysoQcUWd90Ic6bQBKQgylVn0E3i85dGb8="; + rev = "6655760732100f5387fad2d2890c015ee5039981"; + hash = "sha256-Nz9BHtacYpJMLmB3f9WFg6GvMa+BuUhiNbJ9cyannek="; }; extraPatches = [ # Bash completion fix for Nix ./patches/unstable-bash-completion-always-print.patch ]; pluginOverrides = { - # unstable has a new plugin, so we register it here. + # unstable has new plugins, so we register them here. limit = { builtin = true; }; + substitute = { builtin = true; }; + advancedrewrite = { builtin = true; }; + autobpm = { builtin = true; }; }; + extraNativeBuildInputs = [ + python3Packages.pydata-sphinx-theme + ]; }; alternatives = callPackage ./plugins/alternatives.nix { beets = self.beets-minimal; }; diff --git a/pkgs/tools/audio/beets/patches/fix-pillow10-compat.patch b/pkgs/tools/audio/beets/patches/fix-pillow10-compat.patch new file mode 100644 index 00000000000..f85eec20156 --- /dev/null +++ b/pkgs/tools/audio/beets/patches/fix-pillow10-compat.patch @@ -0,0 +1,13 @@ +diff --git i/beets/util/artresizer.py w/beets/util/artresizer.py +index 8683e228..6f99c79e 100644 +--- i/beets/util/artresizer.py ++++ w/beets/util/artresizer.py +@@ -72,7 +72,7 @@ def pil_resize(maxwidth, path_in, path_out=None, quality=0, max_filesize=0): + try: + im = Image.open(util.syspath(path_in)) + size = maxwidth, maxwidth +- im.thumbnail(size, Image.ANTIALIAS) ++ im.thumbnail(size, Image.Resampling.LANCZOS) + + if quality == 0: + # Use PIL's default quality. diff --git a/pkgs/tools/audio/beets/patches/unstable-bash-completion-always-print.patch b/pkgs/tools/audio/beets/patches/unstable-bash-completion-always-print.patch index 395f40f92c9..96b17511757 100644 --- a/pkgs/tools/audio/beets/patches/unstable-bash-completion-always-print.patch +++ b/pkgs/tools/audio/beets/patches/unstable-bash-completion-always-print.patch @@ -1,34 +1,36 @@ -diff --git a/beets/ui/commands.py b/beets/ui/commands.py -index 1377ad0c..e178eeae 100755 ---- a/beets/ui/commands.py -+++ b/beets/ui/commands.py -@@ -1831,20 +1831,6 @@ default_commands.append(config_cmd) +diff --git i/beets/ui/commands.py w/beets/ui/commands.py +index ad4f7821..5077191d 100755 +--- i/beets/ui/commands.py ++++ w/beets/ui/commands.py +@@ -2381,22 +2381,6 @@ default_commands.append(config_cmd) def print_completion(*args): for line in completion_script(default_commands + plugins.commands()): - print_(line, end='') + print_(line, end="") - if not any(os.path.isfile(syspath(p)) for p in BASH_COMPLETION_PATHS): -- log.warning('Warning: Unable to find the bash-completion package. ' -- 'Command line completion might not work.') +- log.warning( +- "Warning: Unable to find the bash-completion package. " +- "Command line completion might not work." +- ) - - -BASH_COMPLETION_PATHS = [ -- b'/etc/bash_completion', -- b'/usr/share/bash-completion/bash_completion', -- b'/usr/local/share/bash-completion/bash_completion', +- b"/etc/bash_completion", +- b"/usr/share/bash-completion/bash_completion", +- b"/usr/local/share/bash-completion/bash_completion", - # SmartOS -- b'/opt/local/share/bash-completion/bash_completion', +- b"/opt/local/share/bash-completion/bash_completion", - # Homebrew (before bash-completion2) -- b'/usr/local/etc/bash_completion', +- b"/usr/local/etc/bash_completion", -] def completion_script(commands): -diff --git a/test/test_ui.py b/test/test_ui.py -index f66917dc..f3d934c6 100644 ---- a/test/test_ui.py -+++ b/test/test_ui.py -@@ -1310,12 +1310,7 @@ class CompletionTest(_common.TestCase, TestHelper): - stdout=subprocess.PIPE, env=env) +diff --git i/test/test_ui.py w/test/test_ui.py +index cae86148..faf266a8 100644 +--- i/test/test_ui.py ++++ w/test/test_ui.py +@@ -1434,12 +1434,7 @@ class CompletionTest(_common.TestCase, TestHelper): + ) # Load bash_completion library. - for path in commands.BASH_COMPLETION_PATHS: @@ -36,8 +38,8 @@ index f66917dc..f3d934c6 100644 - bash_completion = path - break - else: -- self.skipTest('bash-completion script not found') -+ self.skipTest('bash-completion script not found') +- self.skipTest("bash-completion script not found") ++ self.skipTest("bash-completion script not found") try: - with open(util.syspath(bash_completion), 'rb') as f: + with open(util.syspath(bash_completion), "rb") as f: tester.stdin.writelines(f) diff --git a/pkgs/tools/audio/goxlr-utility/default.nix b/pkgs/tools/audio/goxlr-utility/default.nix index 58814cb4423..6a2de8379e1 100644 --- a/pkgs/tools/audio/goxlr-utility/default.nix +++ b/pkgs/tools/audio/goxlr-utility/default.nix @@ -10,16 +10,16 @@ rustPlatform.buildRustPackage rec { pname = "goxlr-utility"; - version = "0.12.6"; + version = "1.0.0"; src = fetchFromGitHub { owner = "GoXLR-on-Linux"; repo = "goxlr-utility"; rev = "v${version}"; - hash = "sha256-vvaKCsqncRhag8IrS0AIfNqNHGU2WIvFaYISEVfUB2Y="; + hash = "sha256-QKL2iKfn05P20MwT+RAeVzUUyv6FWtxMWuBI+4MgXlQ="; }; - cargoHash = "sha256-Z57H5YeVYqlOaLRLaizVw8xTLstdjyXutnN7OgaUYOE="; + cargoHash = "sha256-LVObMspxhZkK81BjolTZZwoeMunzVwdEWWJAt/aOjZA="; buildInputs = [ libpulseaudio diff --git a/pkgs/tools/audio/headsetcontrol/default.nix b/pkgs/tools/audio/headsetcontrol/default.nix index 99434f9ca73..68a799a55c7 100644 --- a/pkgs/tools/audio/headsetcontrol/default.nix +++ b/pkgs/tools/audio/headsetcontrol/default.nix @@ -38,6 +38,7 @@ stdenv.mkDerivation rec { ''; homepage = "https://github.com/Sapd/HeadsetControl"; license = licenses.gpl3Plus; + mainProgram = "headsetcontrol"; maintainers = with maintainers; [ leixb ]; platforms = platforms.all; }; diff --git a/pkgs/tools/audio/kaldi/default.nix b/pkgs/tools/audio/kaldi/default.nix index 7ea5cf622b5..c9dc204ad40 100644 --- a/pkgs/tools/audio/kaldi/default.nix +++ b/pkgs/tools/audio/kaldi/default.nix @@ -19,13 +19,13 @@ assert blas.implementation == "openblas" && lapack.implementation == "openblas"; stdenv.mkDerivation (finalAttrs: { pname = "kaldi"; - version = "unstable-2023-05-02"; + version = "unstable-2023-10-13"; src = fetchFromGitHub { owner = "kaldi-asr"; repo = "kaldi"; - rev = "71f38e62cad01c3078555bfe78d0f3a527422d75"; - sha256 = "sha256-2xm0F80cjovy/G9Ytq/iwa1eexZk0mromv6PPuNIT8U="; + rev = "1b07b595b0bfd261c87f4efecd022481ed4a196f"; + sha256 = "sha256-S4UD/J28McnJjFu5FH3ElwzXapceUUezfBCgI91eIi0="; }; cmakeFlags = [ diff --git a/pkgs/tools/audio/liquidsoap/full.nix b/pkgs/tools/audio/liquidsoap/full.nix index 81157c13782..22925dce99f 100644 --- a/pkgs/tools/audio/liquidsoap/full.nix +++ b/pkgs/tools/audio/liquidsoap/full.nix @@ -1,35 +1,68 @@ -{ lib, stdenv, makeWrapper, fetchurl, which, pkg-config +{ lib, stdenv, makeWrapper, fetchFromGitHub, which, pkg-config , libjpeg , ocamlPackages -, awscli2, curl, ffmpeg, youtube-dl -, runtimePackages ? [ awscli2 curl ffmpeg youtube-dl ] +, awscli2, bubblewrap, curl, ffmpeg, yt-dlp +, runtimePackages ? [ awscli2 bubblewrap curl ffmpeg yt-dlp ] }: let pname = "liquidsoap"; - version = "2.1.4"; + version = "2.2.2"; in stdenv.mkDerivation { inherit pname version; - src = fetchurl { - url = "https://github.com/savonet/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2"; - sha256 = "sha256-GQuG7f9U+/HqPcuj6hnBoH5mWEhxSwWgBnkCuLqHTAc="; + src = fetchFromGitHub { + owner = "savonet"; + repo = "liquidsoap"; + rev = "refs/tags/v${version}"; + hash = "sha256-t7rkWHSAd3DaTCXaGfL9NcIQYT+f4Od9D6huuZlwhWk="; }; - postFixup = '' + postPatch = '' + substituteInPlace src/lang/dune \ + --replace "(run git rev-parse --short HEAD)" "(run echo -n nixpkgs)" + ''; + + dontConfigure = true; + + buildPhase = '' + runHook preBuild + + dune build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + dune install --prefix "$out" + + runHook postInstall + ''; + + fixupPhase = '' + runHook preFixup + wrapProgram $out/bin/liquidsoap \ --set LIQ_LADSPA_PATH /run/current-system/sw/lib/ladspa \ --prefix PATH : ${lib.makeBinPath runtimePackages} - ''; + runHook postFixup + ''; strictDeps = true; - nativeBuildInputs = - [ makeWrapper pkg-config which - ocamlPackages.ocaml ocamlPackages.findlib ocamlPackages.menhir - ]; + nativeBuildInputs = [ + makeWrapper + pkg-config + which + ocamlPackages.ocaml + ocamlPackages.dune_3 + ocamlPackages.findlib + ocamlPackages.menhir + ]; buildInputs = [ libjpeg @@ -38,29 +71,36 @@ stdenv.mkDerivation { ocamlPackages.dtools ocamlPackages.duppy ocamlPackages.mm - ocamlPackages.ocaml_pcre - ocamlPackages.menhir ocamlPackages.menhirLib - ocamlPackages.camomile ocamlPackages.ocurl + ocamlPackages.cry + ocamlPackages.camomile ocamlPackages.uri - ocamlPackages.sedlex + ocamlPackages.fileutils + ocamlPackages.menhir # liquidsoap-lang + ocamlPackages.menhirLib + ocamlPackages.metadata + ocamlPackages.dune-build-info + ocamlPackages.re + ocamlPackages.sedlex # liquidsoap-lang + ocamlPackages.ppx_string # Recommended dependencies ocamlPackages.ffmpeg # Optional dependencies - ocamlPackages.camlimages - ocamlPackages.gd4o ocamlPackages.alsa ocamlPackages.ao ocamlPackages.bjack - ocamlPackages.cry + ocamlPackages.camlimages ocamlPackages.dssi ocamlPackages.faad ocamlPackages.fdkaac ocamlPackages.flac ocamlPackages.frei0r + ocamlPackages.gd4o + ocamlPackages.graphics ocamlPackages.gstreamer + ocamlPackages.imagelib ocamlPackages.inotify ocamlPackages.ladspa ocamlPackages.lame @@ -72,25 +112,22 @@ stdenv.mkDerivation { ocamlPackages.ogg ocamlPackages.opus ocamlPackages.portaudio + ocamlPackages.posix-time2 ocamlPackages.pulseaudio - ocamlPackages.shine ocamlPackages.samplerate + ocamlPackages.shine ocamlPackages.soundtouch ocamlPackages.speex ocamlPackages.srt ocamlPackages.ssl ocamlPackages.taglib ocamlPackages.theora - ocamlPackages.vorbis - ocamlPackages.xmlplaylist - ocamlPackages.posix-time2 ocamlPackages.tsdl ocamlPackages.tsdl-image ocamlPackages.tsdl-ttf - - # Undocumented dependencies - ocamlPackages.graphics - ocamlPackages.cohttp-lwt-unix + ocamlPackages.vorbis + ocamlPackages.xmlplaylist + ocamlPackages.yaml ]; meta = with lib; { diff --git a/pkgs/tools/audio/openai-whisper-cpp/default.nix b/pkgs/tools/audio/openai-whisper-cpp/default.nix index f6d83690824..f19425201cd 100644 --- a/pkgs/tools/audio/openai-whisper-cpp/default.nix +++ b/pkgs/tools/audio/openai-whisper-cpp/default.nix @@ -12,13 +12,13 @@ stdenv.mkDerivation rec { pname = "whisper-cpp"; - version = "1.4.0"; + version = "1.4.2"; src = fetchFromGitHub { owner = "ggerganov"; repo = "whisper.cpp"; rev = "refs/tags/v${version}" ; - hash = "sha256-176MpooVQrq1dXC62h8Yyyhw6IjCA50tp1J4DQPSePQ="; + hash = "sha256-Qea9zGLJ41D+l8h1Sg/KJI6Ou02jtbRIxYPGoabM8nY="; }; # The upstream download script tries to download the models to the diff --git a/pkgs/tools/audio/piper/default.nix b/pkgs/tools/audio/piper/default.nix index d753d7bb3e1..ec55b78c4f8 100644 --- a/pkgs/tools/audio/piper/default.nix +++ b/pkgs/tools/audio/piper/default.nix @@ -7,6 +7,7 @@ , pkg-config # runtime +, fmt , onnxruntime , pcaudiolib , piper-phonemize @@ -18,22 +19,26 @@ stdenv.mkDerivation (finalAttrs: { pname = "piper"; - version = "1.2.0"; + version = "2023.11.14-2"; src = fetchFromGitHub { owner = "rhasspy"; repo = "piper"; - rev = "refs/tags/v${finalAttrs.version}"; - hash = "sha256-6WNWqJt0PO86vnf+3iHaRRg2KwBOEj4aicmB+P2phlk="; + rev = "refs/tags/${finalAttrs.version}"; + hash = "sha256-3ynWyNcdf1ffU3VoDqrEMrm5Jo5Zc5YJcVqwLreRCsI="; }; - sourceRoot = "${finalAttrs.src.name}/src/cpp"; - nativeBuildInputs = [ cmake pkg-config ]; + cmakeFlags = [ + "-DFMT_DIR=${fmt}" + "-DSPDLOG_DIR=${spdlog.src}" + "-DPIPER_PHONEMIZE_DIR=${piper-phonemize}" + ]; + buildInputs = [ onnxruntime pcaudiolib diff --git a/pkgs/tools/audio/spotdl/default.nix b/pkgs/tools/audio/spotdl/default.nix index 53fdbd677f7..6b7a75bfb61 100644 --- a/pkgs/tools/audio/spotdl/default.nix +++ b/pkgs/tools/audio/spotdl/default.nix @@ -6,18 +6,7 @@ }: let - python = python3.override { - packageOverrides = self: super: { - ytmusicapi = super.ytmusicapi.overridePythonAttrs (old: rec { - version = "0.25.1"; - src = fetchPypi { - inherit (old) pname; - inherit version; - hash = "sha256-uc/fgDetSYaCRzff0SzfbRhs3TaKrfE2h6roWkkj8yQ="; - }; - }); - }; - }; + python = python3; in python.pkgs.buildPythonApplication rec { pname = "spotdl"; version = "4.2.1"; diff --git a/pkgs/tools/audio/tts/default.nix b/pkgs/tools/audio/tts/default.nix index 86090958235..48c936ca632 100644 --- a/pkgs/tools/audio/tts/default.nix +++ b/pkgs/tools/audio/tts/default.nix @@ -10,19 +10,20 @@ let packageOverrides = self: super: { torch = super.torch-bin; torchvision = super.torchvision-bin; + tensorflow = super.tensorflow-bin; }; }; in python.pkgs.buildPythonApplication rec { pname = "tts"; - version = "0.16.0"; - format = "pyproject"; + version = "0.20.2"; + pyproject = true; src = fetchFromGitHub { owner = "coqui-ai"; repo = "TTS"; rev = "refs/tags/v${version}"; - hash = "sha256-2JZyINyzy4X1DTp4ZsMLY/rCsH4JdQ8bF/3hoqtvNTU="; + hash = "sha256-1nlSf15IEX1qKfDtR6+jQqskjxIuzaIWatkj9Z1fh8Y="; }; postPatch = let @@ -56,7 +57,9 @@ python.pkgs.buildPythonApplication rec { nativeBuildInputs = with python.pkgs; [ cython + numpy packaging + setuptools ]; propagatedBuildInputs = with python.pkgs; [ @@ -102,7 +105,7 @@ python.pkgs.buildPythonApplication rec { # cython modules are not installed for some reasons ( cd TTS/tts/utils/monotonic_align - ${python.pythonForBuild.interpreter} setup.py install --prefix=$out + ${python.pythonOnBuildForHost.interpreter} setup.py install --prefix=$out ) ''; diff --git a/pkgs/tools/audio/video2midi/default.nix b/pkgs/tools/audio/video2midi/default.nix index f8c50fda29c..2c2ea77de6e 100644 --- a/pkgs/tools/audio/video2midi/default.nix +++ b/pkgs/tools/audio/video2midi/default.nix @@ -1,7 +1,7 @@ -{ lib, fetchFromGitHub, pythonPackages, opencv3 }: +{ lib, fetchFromGitHub, pythonPackages, opencv4 }: let - opencv3_ = pythonPackages.toPythonModule (opencv3.override { + opencv4_ = pythonPackages.toPythonModule (opencv4.override { inherit pythonPackages; enablePython = true; enableFfmpeg = true; @@ -19,7 +19,7 @@ in pythonPackages.buildPythonApplication rec { sha256 = "0qzrxqhsxn0h71nfrsi9g78hx3pqm3b8sr6fjq01k4k6dd2nwfam"; }; - propagatedBuildInputs = with pythonPackages; [ opencv3_ midiutil pygame pyopengl ]; + propagatedBuildInputs = with pythonPackages; [ opencv4_ midiutil pygame pyopengl ]; installPhase = '' install -Dm755 v2m.py $out/bin/v2m.py diff --git a/pkgs/tools/audio/whisper-ctranslate2/default.nix b/pkgs/tools/audio/whisper-ctranslate2/default.nix index 6ca3226bf67..dd928ab3e41 100644 --- a/pkgs/tools/audio/whisper-ctranslate2/default.nix +++ b/pkgs/tools/audio/whisper-ctranslate2/default.nix @@ -1,11 +1,11 @@ { lib +, python3 , fetchFromGitHub , nix-update-script -, python3 }: let pname = "whisper-ctranslate2"; - version = "0.2.7"; + version = "0.3.2"; in python3.pkgs.buildPythonApplication { inherit pname version; @@ -15,9 +15,9 @@ python3.pkgs.buildPythonApplication { src = fetchFromGitHub { owner = "Softcatala"; - repo = pname; + repo = "whisper-ctranslate2"; rev = version; - hash = "sha256-dUmQNKgH+SIlLhUEiaEGXUHZQDr3fidsAU2vATJiXBU="; + hash = "sha256-9Y9y7DihDnbREaeARCGC7ctwwBAoZPpIWDAOdeDnB6E="; }; propagatedBuildInputs = with python3.pkgs; [ @@ -30,6 +30,15 @@ python3.pkgs.buildPythonApplication { passthru.updateScript = nix-update-script { }; + nativeCheckInputs = with python3.pkgs; [ + nose2 + ]; + + checkPhase = '' + # Note: we are not running the `e2e-tests` because they require downloading models from the internet. + ${python3.interpreter} -m nose2 -s tests + ''; + meta = with lib; { description = "Whisper command line client compatible with original OpenAI client based on CTranslate2"; homepage = "https://github.com/Softcatala/whisper-ctranslate2"; diff --git a/pkgs/tools/audio/wyoming/faster-whisper-entrypoint.patch b/pkgs/tools/audio/wyoming/faster-whisper-entrypoint.patch deleted file mode 100644 index 27a6bd08249..00000000000 --- a/pkgs/tools/audio/wyoming/faster-whisper-entrypoint.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/setup.py b/setup.py -index 04eedbc..ee0b495 100644 ---- a/setup.py -+++ b/setup.py -@@ -35,4 +35,9 @@ setup( - "Programming Language :: Python :: 3.10", - ], - keywords="rhasspy wyoming whisper", -+ entry_points={ -+ 'console_scripts': [ -+ 'wyoming-faster-whisper = wyoming_faster_whisper:__main__.run' -+ ] -+ } - ) -diff --git a/wyoming_faster_whisper/__main__.py b/wyoming_faster_whisper/__main__.py -index 8a5039f..bd1e7b6 100755 ---- a/wyoming_faster_whisper/__main__.py -+++ b/wyoming_faster_whisper/__main__.py -@@ -131,8 +131,12 @@ async def main() -> None: - - # ----------------------------------------------------------------------------- - -+def run(): -+ asyncio.run(main()) -+ -+ - if __name__ == "__main__": - try: -- asyncio.run(main()) -+ run() - except KeyboardInterrupt: - pass diff --git a/pkgs/tools/audio/wyoming/faster-whisper.nix b/pkgs/tools/audio/wyoming/faster-whisper.nix index 50ec99f6dee..e7eecd18350 100644 --- a/pkgs/tools/audio/wyoming/faster-whisper.nix +++ b/pkgs/tools/audio/wyoming/faster-whisper.nix @@ -1,21 +1,37 @@ { lib , python3 -, fetchPypi +, fetchFromGitHub +, fetchpatch }: python3.pkgs.buildPythonApplication rec { pname = "wyoming-faster-whisper"; - version = "1.0.1"; - format = "setuptools"; + version = "1.0.2"; + pyproject = true; - src = fetchPypi { - pname = "wyoming_faster_whisper"; - inherit version; - hash = "sha256-wo62m8gIP9hXihkd8j2haVvz3TlJv3m5WWthTPFwesk="; + src = fetchFromGitHub { + owner = "rhasspy"; + repo = "wyoming-faster-whisper"; + rev = "refs/tags/v${version}"; + hash = "sha256-mKnWab3i6lEnCBbO3ucNmWIxaaWwQagzfDhaD1U3qow="; }; patches = [ - ./faster-whisper-entrypoint.patch + # add wyoming-faster-whisper executable + (fetchpatch { + url = "https://github.com/rhasspy/wyoming-faster-whisper/commit/a5715197abab34253d2864ed8cf406210834b4ec.patch"; + hash = "sha256-a9gmXMngwXo9ZJDbxl/pPzm6WSy5XeGbz/Xncj7bOog="; + }) + + # fix model retrieval on python3.11+ + (fetchpatch { + url = "https://github.com/rhasspy/wyoming-faster-whisper/commit/d5229df2c3af536013bc931c1ed7cc239b618208.patch"; + hash = "sha256-CMpOJ1qSPcdtX2h2ecGmQ/haus/gaSH8r/PCFsMChRY="; + }) + ]; + + nativeBuildInputs = with python3.pkgs; [ + setuptools ]; propagatedBuildInputs = with python3.pkgs; [ @@ -33,7 +49,7 @@ python3.pkgs.buildPythonApplication rec { meta = with lib; { description = "Wyoming Server for Faster Whisper"; - homepage = "https://pypi.org/project/wyoming-faster-whisper/"; + homepage = "https://github.com/rhasspy/wyoming-faster-whisper"; license = licenses.mit; maintainers = with maintainers; [ hexa ]; }; diff --git a/pkgs/tools/audio/wyoming/openwakeword.nix b/pkgs/tools/audio/wyoming/openwakeword.nix new file mode 100644 index 00000000000..83da563f3b3 --- /dev/null +++ b/pkgs/tools/audio/wyoming/openwakeword.nix @@ -0,0 +1,53 @@ +{ lib +, python3Packages +, fetchFromGitHub +, fetchpatch +}: + +python3Packages.buildPythonApplication rec { + pname = "wyoming-openwakeword"; + version = "1.8.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "rhasspy"; + repo = "wyoming-openwakeword"; + rev = "refs/tags/v${version}"; + hash = "sha256-N/EjdNQLsYLpJ4kOxY/z+/dMMmF1PPAIEEzSHfnZWaM="; + }; + + patches = [ + (fetchpatch { + # import tflite entrypoint from tensorflow + url = "https://github.com/rhasspy/wyoming-openwakeword/commit/8f4ba2750d8c545e77549a7230cdee1301dac09a.patch"; + hash = "sha256-WPvywpGv0sYYVGc7he4bt7APIsa3ziKaWqpFlx3v+V8="; + }) + (fetchpatch { + # add commandline entrypoint + url = "https://github.com/rhasspy/wyoming-openwakeword/commit/f40e5635543b2315217538dd89a9fe40fe817cfe.patch"; + hash = "sha256-HNlGqt7bMzwyvhx5Hw7mkTHeQmBpgDCU3pUbZzss1bY="; + }) + ]; + + nativeBuildInputs = with python3Packages; [ + setuptools + ]; + + propagatedBuildInputs = with python3Packages; [ + tensorflow + wyoming + ]; + + pythonImportsCheck = [ + "wyoming_openwakeword" + ]; + + meta = with lib; { + changelog = "https://github.com/rhasspy/wyoming-openwakeword/blob/v${version}/CHANGELOG.md"; + description = "An open source voice assistant toolkit for many human languages"; + homepage = "https://github.com/rhasspy/wyoming-openwakeword"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + mainProgram = "wyoming-openwakeword"; + }; +} diff --git a/pkgs/tools/audio/wyoming/piper-entrypoint.patch b/pkgs/tools/audio/wyoming/piper-entrypoint.patch deleted file mode 100644 index 4f7d09fd40c..00000000000 --- a/pkgs/tools/audio/wyoming/piper-entrypoint.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/setup.py b/setup.py -index 05e42c1..8347acb 100644 ---- a/setup.py -+++ b/setup.py -@@ -41,4 +41,9 @@ setup( - "Programming Language :: Python :: 3.10", - ], - keywords="rhasspy wyoming piper", -+ entry_points={ -+ 'console_scripts': [ -+ 'wyoming-piper = wyoming_piper:__main__.run' -+ ] -+ } - ) -diff --git a/wyoming_piper/__main__.py b/wyoming_piper/__main__.py -index ab1580b..4c0a143 100755 ---- a/wyoming_piper/__main__.py -+++ b/wyoming_piper/__main__.py -@@ -143,8 +143,12 @@ def get_description(voice_info: Dict[str, Any]): - - # ----------------------------------------------------------------------------- - -+def run(): -+ asyncio.run(main()) -+ -+ - if __name__ == "__main__": - try: -- asyncio.run(main()) -+ run() - except KeyboardInterrupt: - pass diff --git a/pkgs/tools/audio/wyoming/piper.nix b/pkgs/tools/audio/wyoming/piper.nix index c5ce6f99005..f53f684f6fa 100644 --- a/pkgs/tools/audio/wyoming/piper.nix +++ b/pkgs/tools/audio/wyoming/piper.nix @@ -1,24 +1,35 @@ { lib -, python3 -, fetchPypi +, python3Packages +, fetchFromGitHub +, fetchpatch }: -python3.pkgs.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "wyoming-piper"; - version = "1.2.0"; - format = "setuptools"; + version = "1.4.0"; + pyproject = true; - src = fetchPypi { - pname = "wyoming_piper"; - inherit version; - hash = "sha256-cdCWpejHNCjyYtIxGms9yaEerRmFnGllUN7+3uQy4mQ="; + src = fetchFromGitHub { + owner = "rhasspy"; + repo = "wyoming-piper"; + # https://github.com/rhasspy/wyoming-piper/issues/3 + rev = "560927437c72eca4d334ca503d15863f0b42980d"; + hash = "sha256-Q4S96zs856zXVAGo4mB466an60naHiS2S/qxYxPE4sI="; }; patches = [ - ./piper-entrypoint.patch + (fetchpatch { + # add console script + url = "https://github.com/rhasspy/wyoming-piper/commit/4c27fbd067fd543adede4626fc5868a3f2458734.patch"; + hash = "sha256-YPjDjeY9RLsgCtbBZoNgPyQTv3rbCJGcqTNSSwiqqEE="; + }) ]; - propagatedBuildInputs = with python3.pkgs; [ + nativeBuildInputs = with python3Packages; [ + setuptools + ]; + + propagatedBuildInputs = with python3Packages; [ wyoming ]; @@ -29,8 +40,9 @@ python3.pkgs.buildPythonApplication rec { doCheck = false; meta = with lib; { + changelog = "https://github.com/rhasspy/wyoming-openwakeword/v${version}/master/CHANGELOG.md"; description = "Wyoming Server for Piper"; - homepage = "https://pypi.org/project/wyoming-piper/"; + homepage = "https://github.com/rhasspy/wyoming-openwakeword"; license = licenses.mit; maintainers = with maintainers; [ hexa ]; }; |