voicevox: 0.23.0 -> 0.24.1

This commit is contained in:
TomaSajt
2025-07-03 15:54:11 +02:00
parent c675af8ef1
commit 0fed32dd3b
3 changed files with 53 additions and 51 deletions
+15 -16
View File
@@ -11,39 +11,38 @@ index cc5e2b9..29140f8 100644
"executionArgs": [],
"host": "http://127.0.0.1:50021"
}
diff --git a/electron-builder.config.js b/electron-builder.config.js
index 10bd7dc..4597b23 100644
--- a/electron-builder.config.js
+++ b/electron-builder.config.js
@@ -38,18 +38,6 @@ const isArm64 = process.arch === "arm64";
diff --git a/electron-builder.config.cjs b/electron-builder.config.cjs
index d2a21b4..7b338c0 100644
--- a/electron-builder.config.cjs
+++ b/electron-builder.config.cjs
@@ -40,17 +40,6 @@ const isArm64 = process.arch === "arm64";
// cf: https://k-hyoda.hatenablog.com/entry/2021/10/23/000349#%E8%BF%BD%E5%8A%A0%E5%B1%95%E9%96%8B%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%85%88%E3%81%AE%E8%A8%AD%E5%AE%9A
const extraFilePrefix = isMac ? "MacOS/" : "";
-const sevenZipFile = fs
- .readdirSync(path.resolve(__dirname, "vendored", "7z"))
- .find(
- // Windows: 7za.exe, Linux: 7zzs, macOS: 7zz
- (fileName) => ["7za.exe", "7zzs", "7zz"].includes(fileName),
- );
-const sevenZipFile = readdirSync(resolve(__dirname, "vendored", "7z")).find(
- // Windows: 7za.exe, Linux: 7zzs, macOS: 7zz
- (fileName) => ["7za.exe", "7zzs", "7zz"].includes(fileName),
-);
-
-if (!sevenZipFile) {
- throw new Error(
- "7z binary file not found. Run `node ./tools/download7z.js` first.",
- "7z binary file not found. Run `node ./tools/download7z.ts` first.",
- );
-}
-
/** @type {import("electron-builder").Configuration} */
const builderOptions = {
@@ -91,14 +79,6 @@ const builderOptions = {
beforeBuild: async () => {
@@ -91,14 +80,6 @@ const builderOptions = {
from: "build/README.txt",
to: extraFilePrefix + "README.txt",
},
- {
- from: VOICEVOX_ENGINE_DIR,
- to: path.join(extraFilePrefix, "vv-engine"),
- to: join(extraFilePrefix, "vv-engine"),
- },
- {
- from: path.resolve(__dirname, "vendored", "7z", sevenZipFile),
- from: resolve(__dirname, "vendored", "7z", sevenZipFile),
- to: extraFilePrefix + sevenZipFile,
- },
],
+38 -17
View File
@@ -2,31 +2,37 @@
lib,
stdenv,
fetchFromGitHub,
replaceVars,
pnpm_9,
nodejs,
makeDesktopItem,
replaceVars,
copyDesktopItems,
makeWrapper,
electron,
_7zz,
voicevox-engine,
dart-sass,
jq,
makeWrapper,
moreutils,
nodejs,
pnpm_9,
_7zz,
electron,
voicevox-engine,
}:
let
pnpm = pnpm_9;
in
stdenv.mkDerivation (finalAttrs: {
pname = "voicevox";
version = "0.23.0";
version = "0.24.1";
src = fetchFromGitHub {
owner = "VOICEVOX";
repo = "voicevox";
tag = finalAttrs.version;
hash = "sha256-wCC4wl5LPJVJQtV+X795rIXnURseQYiCZ9B6YujTFFw=";
hash = "sha256-2MXJOLt14zpoahYjd3l3q5UxT2yK/g/jksHO4Q7W6HA=";
};
patches = [
./unlock-node-and-pnpm-versions.patch
(replaceVars ./hardcode-paths.patch {
sevenzip_path = lib.getExe _7zz;
voicevox_engine_path = lib.getExe voicevox-engine;
@@ -34,26 +40,41 @@ stdenv.mkDerivation (finalAttrs: {
];
postPatch = ''
# unlock the overly specific pnpm package version pin
jq 'del(.packageManager)' package.json | sponge package.json
substituteInPlace package.json \
--replace-fail "999.999.999" "$version" \
--replace-fail ' && electron-builder --config electron-builder.config.js --publish never' ""
--replace-fail ' && electron-builder --config electron-builder.config.cjs --publish never' ""
'';
pnpmDeps = pnpm_9.fetchDeps {
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs)
pname
version
src
patches
postPatch
;
hash = "sha256-IuyDHAomaGEvGbN4gLpyPfZGm/pF9XK+BkXSipaM7NQ=";
# let's just be safe and add these explicitly to nativeBuildInputs
# even though the fetcher already uses them in its implementation
nativeBuildInputs = [
jq
moreutils
];
hash = "sha256-RKgqFmHQnjHS7yeUIbH9awpNozDOCCHplc/bmfxmMyg=";
};
nativeBuildInputs =
[
dart-sass
jq
makeWrapper
pnpm_9.configHook
moreutils
nodejs
pnpm.configHook
]
++ lib.optionals stdenv.hostPlatform.isLinux [
copyDesktopItems
@@ -67,9 +88,9 @@ stdenv.mkDerivation (finalAttrs: {
buildPhase = ''
runHook preBuild
# force sass-embedded to use our own sass instead of the bundled one
# force sass-embedded to use our own sass from PATH instead of the bundled one
substituteInPlace node_modules/sass-embedded/dist/lib/src/compiler-path.js \
--replace-fail 'compilerCommand = (() => {' 'compilerCommand = (() => { return ["${lib.getExe dart-sass}"];'
--replace-fail 'compilerCommand = (() => {' 'compilerCommand = (() => { return ["dart-sass"];'
cp -r ${electron.dist} electron-dist
chmod -R u+w electron-dist
@@ -79,7 +100,7 @@ stdenv.mkDerivation (finalAttrs: {
pnpm exec electron-builder \
--dir \
--config electron-builder.config.js \
--config electron-builder.config.cjs \
-c.electronDist=electron-dist \
-c.electronVersion=${electron.version}
@@ -1,18 +0,0 @@
diff --git a/package.json b/package.json
index d0a58b4..b57b91c 100644
--- a/package.json
+++ b/package.json
@@ -4,13 +4,6 @@
"author": "Hiroshiba Kazuyuki",
"private": true,
"main": "./dist/main.js",
- "engines": {
- "node": ">=22.14.0 <23"
- },
- "volta": {
- "node": "22.14.0"
- },
- "packageManager": "pnpm@10.3.0",
"scripts": {
"// --- lint ---": "",
"lint": "eslint .",