voicevox-engine: 0.23.0 -> 0.24.0

This commit is contained in:
TomaSajt 2025-06-26 19:48:36 +02:00
parent fad46aabd6
commit c675af8ef1
No known key found for this signature in database
GPG Key ID: F011163C050122A1
4 changed files with 46 additions and 151 deletions

View File

@ -1,26 +1,26 @@
diff --git a/pyproject.toml b/pyproject.toml diff --git a/pyproject.toml b/pyproject.toml
index fa23446..6a7705c 100644 index 42a636b..209893f 100644
--- a/pyproject.toml --- a/pyproject.toml
+++ b/pyproject.toml +++ b/pyproject.toml
@@ -40,7 +40,20 @@ use_parentheses = true @@ -23,6 +23,21 @@ dependencies = [
datas = "datas" # PyInstaller's argument "uvicorn>=0.34.0",
]
[tool.poetry] +[project.scripts]
-package-mode = false +voicevox-engine = "run:main"
+name = "voicevox-engine" +
+version = "@version@" +[build-system]
+authors = [] +requires = ["hatchling"]
+description = "" +build-backend = "hatchling.build"
+packages = [ { include = "voicevox_engine" } ] +
+include = [ +[tool.hatch.build]
+ { path = "resources/**/*", format = ["sdist", "wheel"] }, +only-include = [
+ { path = "run.py", format = ["sdist", "wheel"] }, + "voicevox_engine",
+ { path = "engine_manifest.json", format = ["sdist", "wheel"] }, + "resources",
+ { path = "presets.yaml", format = ["sdist", "wheel"] } + "run.py",
+ "engine_manifest.json",
+] +]
+ +
+[tool.poetry.scripts] [tool.uv]
+voicevox-engine = "run:main" default-groups = []
[tool.poetry.dependencies]
python = "~3.11"

View File

@ -1,92 +0,0 @@
diff --git a/lib/open_jtalk/src/mecab/src/char_property.h b/lib/open_jtalk/src/mecab/src/char_property.h
index 35f4b05..9c904ba 100644
--- a/lib/open_jtalk/src/mecab/src/char_property.h
+++ b/lib/open_jtalk/src/mecab/src/char_property.h
@@ -37,7 +37,7 @@ class CharProperty {
inline const char *seekToOtherType(const char *begin, const char *end,
CharInfo c, CharInfo *fail,
size_t *mblen, size_t *clen) const {
- register const char *p = begin;
+ const char *p = begin;
*clen = 0;
while (p != end && c.isKindOf(*fail = getCharInfo(p, end, mblen))) {
p += *mblen;
diff --git a/lib/open_jtalk/src/mecab/src/darts.h b/lib/open_jtalk/src/mecab/src/darts.h
index 91b2eae..d6736cf 100644
--- a/lib/open_jtalk/src/mecab/src/darts.h
+++ b/lib/open_jtalk/src/mecab/src/darts.h
@@ -404,10 +404,10 @@ class DoubleArrayImpl {
T result;
set_result(result, -1, 0);
- register array_type_ b = array_[node_pos].base;
- register array_u_type_ p;
+ array_type_ b = array_[node_pos].base;
+ array_u_type_ p;
- for (register size_t i = 0; i < len; ++i) {
+ for (size_t i = 0; i < len; ++i) {
p = b +(node_u_type_)(key[i]) + 1;
if (static_cast<array_u_type_>(b) == array_[p].check)
b = array_[p].base;
@@ -431,12 +431,12 @@ class DoubleArrayImpl {
size_t node_pos = 0) const {
if (!len) len = length_func_()(key);
- register array_type_ b = array_[node_pos].base;
- register size_t num = 0;
- register array_type_ n;
- register array_u_type_ p;
+ array_type_ b = array_[node_pos].base;
+ size_t num = 0;
+ array_type_ n;
+ array_u_type_ p;
- for (register size_t i = 0; i < len; ++i) {
+ for (size_t i = 0; i < len; ++i) {
p = b; // + 0;
n = array_[p].base;
if ((array_u_type_) b == array_[p].check && n < 0) {
@@ -469,8 +469,8 @@ class DoubleArrayImpl {
size_t len = 0) const {
if (!len) len = length_func_()(key);
- register array_type_ b = array_[node_pos].base;
- register array_u_type_ p;
+ array_type_ b = array_[node_pos].base;
+ array_u_type_ p;
for (; key_pos < len; ++key_pos) {
p = b +(node_u_type_)(key[key_pos]) + 1;
diff --git a/lib/open_jtalk/src/mecab/src/dictionary.cpp b/lib/open_jtalk/src/mecab/src/dictionary.cpp
index 5717d4d..3ab6e1f 100644
--- a/lib/open_jtalk/src/mecab/src/dictionary.cpp
+++ b/lib/open_jtalk/src/mecab/src/dictionary.cpp
@@ -66,7 +66,7 @@ int progress_bar_darts(size_t current, size_t total) {
}
template <typename T1, typename T2>
-struct pair_1st_cmp: public std::binary_function<bool, T1, T2> {
+struct pair_1st_cmp {
bool operator()(const std::pair<T1, T2> &x1,
const std::pair<T1, T2> &x2) {
return x1.first < x2.first;
diff --git a/lib/open_jtalk/src/mecab/src/viterbi.cpp b/lib/open_jtalk/src/mecab/src/viterbi.cpp
index 6277fe9..5ccefb7 100644
--- a/lib/open_jtalk/src/mecab/src/viterbi.cpp
+++ b/lib/open_jtalk/src/mecab/src/viterbi.cpp
@@ -318,11 +318,11 @@ template <bool IsAllPath> bool connect(size_t pos, Node *rnode,
const Connector *connector,
Allocator<Node, Path> *allocator) {
for (;rnode; rnode = rnode->bnext) {
- register long best_cost = 2147483647;
+ long best_cost = 2147483647;
Node* best_node = 0;
for (Node *lnode = end_node_list[pos]; lnode; lnode = lnode->enext) {
- register int lcost = connector->cost(lnode, rnode); // local cost
- register long cost = lnode->cost + lcost;
+ int lcost = connector->cost(lnode, rnode); // local cost
+ long cost = lnode->cost + lcost;
if (cost < best_cost) {
best_node = lnode;

View File

@ -2,32 +2,28 @@
lib, lib,
fetchFromGitHub, fetchFromGitHub,
python3Packages, python3Packages,
replaceVars,
voicevox-core, voicevox-core,
}: }:
python3Packages.buildPythonApplication rec { python3Packages.buildPythonApplication rec {
pname = "voicevox-engine"; pname = "voicevox-engine";
version = "0.23.0"; version = "0.24.0";
pyproject = true; pyproject = true;
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "VOICEVOX"; owner = "VOICEVOX";
repo = "voicevox_engine"; repo = "voicevox_engine";
tag = version; tag = version;
hash = "sha256-kuWpLnDKRYcfV9FxYLeR6FmQFO2K12KxJx/Y/4MwhbM="; hash = "sha256-LFbKnNv+NNfA6dvgVGr8fGr+3o5/sAyZ8XFZan2EJUY=";
}; };
patches = [ patches = [
# the upstream package only uses poetry for dependency management, not for package definition # this patch makes the package installable via hatchling
# this patch makes the package installable via poetry-core ./make-installable.patch
(replaceVars ./make-installable.patch {
inherit version;
})
]; ];
build-system = with python3Packages; [ build-system = with python3Packages; [
poetry-core hatchling
]; ];
dependencies = dependencies =
@ -35,19 +31,21 @@ python3Packages.buildPythonApplication rec {
passthru.pyopenjtalk passthru.pyopenjtalk
] ]
++ (with python3Packages; [ ++ (with python3Packages; [
numpy
fastapi fastapi
jinja2 jinja2
python-multipart kanalizer
uvicorn numpy
soundfile
pyyaml
pyworld
semver
platformdirs platformdirs
soxr
pydantic pydantic
python-multipart
pyworld
pyyaml
semver
setuptools
soundfile
soxr
starlette starlette
uvicorn
]); ]);
pythonRemoveDeps = [ pythonRemoveDeps = [
@ -55,8 +53,6 @@ python3Packages.buildPythonApplication rec {
"fastapi-slim" "fastapi-slim"
]; ];
pythonRelaxDeps = true;
preConfigure = '' preConfigure = ''
# copy demo metadata to temporary directory # copy demo metadata to temporary directory
mv resources/character_info test_character_info mv resources/character_info test_character_info
@ -103,7 +99,7 @@ python3Packages.buildPythonApplication rec {
owner = "VOICEVOX"; owner = "VOICEVOX";
repo = "voicevox_resource"; repo = "voicevox_resource";
tag = version; tag = version;
hash = "sha256-6pxx+ebNzXd3qbrFa4gfMDM2e5XANo3ZPzSAegKoJBE="; hash = "sha256-/L7gqskzg7NFBO6Jg2MEMYuQeZK58hTWrRypTE42nGg=";
}; };
pyopenjtalk = python3Packages.callPackage ./pyopenjtalk.nix { }; pyopenjtalk = python3Packages.callPackage ./pyopenjtalk.nix { };

View File

@ -4,12 +4,13 @@
buildPythonPackage, buildPythonPackage,
fetchFromGitHub, fetchFromGitHub,
fetchzip, fetchzip,
setuptools, setuptools,
cython_0, setuptools-scm,
cython,
cmake, cmake,
numpy, numpy,
oldest-supported-numpy, oldest-supported-numpy,
six,
tqdm, tqdm,
}: }:
@ -22,32 +23,24 @@ let
in in
buildPythonPackage { buildPythonPackage {
pname = "pyopenjtalk"; pname = "pyopenjtalk";
version = "0-unstable-2023-09-08"; version = "0-unstable-2025-04-23";
pyproject = true; pyproject = true;
# needed because setuptools-scm doesn't like the 0-unstable format
env.SETUPTOOLS_SCM_PRETEND_VERSION = "0.0.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "VOICEVOX"; owner = "VOICEVOX";
repo = "pyopenjtalk"; repo = "pyopenjtalk";
rev = "b35fc89fe42948a28e33aed886ea145a51113f88"; rev = "74703b034dd90a1f199f49bb70bf3b66b1728a86";
hash = "sha256-DbZkCMdirI6wSRUQSJrkojyjGmViqGeQPO0kSKiw2gE="; hash = "sha256-UUUYoVEqENKux5N7ucbjcnrZ2+ewwxwP8S0WksaJEAQ=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
patches = [
# this patch fixes the darwin build
# open_jtalk uses mecab, which uses the register keyword and std::binary_function, which are not allowed in c++17
# this patch removes them
./mecab-remove-deprecated.patch
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'setuptools<v60.0' 'setuptools'
'';
build-system = [ build-system = [
setuptools setuptools
cython_0 setuptools-scm
cython
cmake cmake
numpy numpy
oldest-supported-numpy oldest-supported-numpy
@ -56,9 +49,7 @@ buildPythonPackage {
dontUseCmakeConfigure = true; dontUseCmakeConfigure = true;
dependencies = [ dependencies = [
setuptools # imports pkg_resources at runtime
numpy numpy
six
tqdm tqdm
]; ];