From bd383edb36ca232b93f7db1035970d0a2855ca07 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 12 Jan 2023 05:29:59 +0100 Subject: [PATCH] larynx: init at 0.0.2 --- pkgs/tools/audio/larynx/default.nix | 60 +++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 62 insertions(+) create mode 100644 pkgs/tools/audio/larynx/default.nix diff --git a/pkgs/tools/audio/larynx/default.nix b/pkgs/tools/audio/larynx/default.nix new file mode 100644 index 000000000000..e0fb72e151a4 --- /dev/null +++ b/pkgs/tools/audio/larynx/default.nix @@ -0,0 +1,60 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkgconfig +, espeak-ng +, onnxruntime +, pcaudiolib +, larynx-train +}: + +let + pname = "larynx"; + version = "0.0.2"; +in +stdenv.mkDerivation { + inherit pname version; + + src = fetchFromGitHub { + owner = "rhasspy"; + repo = "larynx2"; + rev = "refs/tags/v${version}"; + hash = "sha256-6SZ1T2A1DyVmBH2pJBHJdsnniRuLrI/dthRTRRyVSQQ="; + }; + + sourceRoot = "source/src/cpp"; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace "/usr/local/include/onnxruntime" "${onnxruntime}" + ''; + + nativeBuildInputs = [ + cmake + pkgconfig + ]; + + buildInputs = [ + espeak-ng + onnxruntime + pcaudiolib + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + install -m 0755 larynx $out/bin + + runHook postInstall + ''; + + meta = with lib; { + changelog = "https://github.com/rhasspy/larynx2/releases/tag/v${version}"; + description = "A fast, local neural text to speech system"; + homepage = "https://github.com/rhasspy/larynx2"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 38d9f438a963..723624963b3b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9100,6 +9100,8 @@ with pkgs; jump = callPackage ../tools/system/jump {}; + larynx = callPackage ../tools/audio/larynx { }; + latex2html = callPackage ../tools/misc/latex2html { }; lazycli = callPackage ../tools/misc/lazycli { };