mensa-tts/default.nix

108 lines
2 KiB
Nix
Raw Normal View History

{ lib, python313Packages, pkgs }:
with python313Packages;
2024-12-18 17:32:24 +01:00
let
2025-05-24 17:13:22 +02:00
# Maintained fork of the original TTS package
coqui-tts =
2024-12-18 17:32:24 +01:00
let
2025-05-24 17:13:22 +02:00
pname = "coqui_tts";
version = "0.27.2";
2024-12-18 17:32:24 +01:00
in
buildPythonPackage {
inherit pname version;
src = pkgs.fetchPypi {
inherit pname version;
sha256 = "sha256-GBxcUf4sVxG0H54KHMvSaZZXI1vpJ3oEruwoWhihtpM=";
2024-12-18 17:32:24 +01:00
};
doCheck = false;
2025-05-24 17:13:22 +02:00
pyproject = true;
build-system = [
hatchling
];
2024-12-18 17:32:24 +01:00
postPatch =
let
relaxedConstraints = [
"bnunicodenormalizer"
"coqpit-config"
"cython"
"gruut"
"inflect"
"librosa"
"mecab-python3"
"numba"
"numpy"
"unidic-lite"
"trainer"
"spacy\\[ja\\]"
"transformers"
"torch"
"torchaudio"
];
in
''
sed -r -i \
${lib.concatStringsSep "\n" (
map (package: ''-e 's/${package}\s*[<>=]+[^"]+/${package}/g' \'') relaxedConstraints
)}
pyproject.toml
'';
2024-12-18 18:41:25 +01:00
nativeBuildInputs = [ pkgs.espeak-ng ];
2024-12-18 17:32:24 +01:00
dependencies = [
cython
numpy
torch
torchaudio
coqpit
trainer
pysbd
pandas
matplotlib
anyascii
inflect
bangla
bnnumerizer
bnunicodenormalizer
gruut
jamo
jieba
pypinyin
2024-12-18 18:41:25 +01:00
pkgs.espeak
2025-05-24 17:13:22 +02:00
einops
encodec
librosa
monotonic-alignment-search
scipy
tqdm
transformers
2024-12-18 17:32:24 +01:00
];
};
in
buildPythonApplication {
pname = "mensa-tts";
version = "1.0";
pyproject = true;
src = ./.;
build-system = [
setuptools
setuptools-scm
];
dependencies = [
requests
2025-05-24 17:13:22 +02:00
coqui-tts
2024-12-18 17:32:24 +01:00
librosa
];
meta = with lib; {
description = "Satnogs Demo Display";
homepage = "https://forgejo.zenerdio.de/sebastian/satnogs-demo-display";
platforms = platforms.unix;
};
}