Skip to content

Commit bae20f2

Browse files
committed
voicevox: 0.22.4 -> 0.23.0
1 parent cbef2a7 commit bae20f2

File tree

3 files changed

+64
-48
lines changed

3 files changed

+64
-48
lines changed
Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/.env.production b/.env.production
2-
index 5b0dcb0..5848ccd 100644
2+
index cc5e2b9..29140f8 100644
33
--- a/.env.production
44
+++ b/.env.production
55
@@ -4,7 +4,7 @@ VITE_DEFAULT_ENGINE_INFOS=`[
@@ -12,10 +12,10 @@ index 5b0dcb0..5848ccd 100644
1212
"host": "http://127.0.0.1:50021"
1313
}
1414
diff --git a/electron-builder.config.js b/electron-builder.config.js
15-
index 196a0d7..7e313c2 100644
15+
index 10bd7dc..4597b23 100644
1616
--- a/electron-builder.config.js
1717
+++ b/electron-builder.config.js
18-
@@ -37,18 +37,7 @@ const isArm64 = process.arch === "arm64";
18+
@@ -38,18 +38,6 @@ const isArm64 = process.arch === "arm64";
1919
// 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
2020
const extraFilePrefix = isMac ? "MacOS/" : "";
2121

@@ -25,7 +25,7 @@ index 196a0d7..7e313c2 100644
2525
- // Windows: 7za.exe, Linux: 7zzs, macOS: 7zz
2626
- (fileName) => ["7za.exe", "7zzs", "7zz"].includes(fileName),
2727
- );
28-
28+
-
2929
-if (!sevenZipFile) {
3030
- throw new Error(
3131
- "7z binary file not found. Run `node ./tools/download7z.js` first.",
@@ -34,7 +34,7 @@ index 196a0d7..7e313c2 100644
3434

3535
/** @type {import("electron-builder").Configuration} */
3636
const builderOptions = {
37-
@@ -90,14 +79,6 @@ const builderOptions = {
37+
@@ -91,14 +79,6 @@ const builderOptions = {
3838
from: "build/README.txt",
3939
to: extraFilePrefix + "README.txt",
4040
},
@@ -49,26 +49,15 @@ index 196a0d7..7e313c2 100644
4949
],
5050
// electron-builder installer
5151
productName: "VOICEVOX",
52-
diff --git a/src/backend/electron/manager/vvppManager.ts b/src/backend/electron/manager/vvppManager.ts
53-
index edd3177..22d0114 100644
54-
--- a/src/backend/electron/manager/vvppManager.ts
55-
+++ b/src/backend/electron/manager/vvppManager.ts
56-
@@ -184,16 +184,8 @@ export class VvppManager {
57-
58-
const args = ["x", "-o" + outputDir, archiveFile, "-t" + format];
52+
diff --git a/src/backend/electron/vvppFile.ts b/src/backend/electron/vvppFile.ts
53+
index 7e152f1..1aaa8c4 100644
54+
--- a/src/backend/electron/vvppFile.ts
55+
+++ b/src/backend/electron/vvppFile.ts
56+
@@ -220,6 +220,7 @@ export class VvppFileExtractor {
57+
}
5958

60-
- let sevenZipPath = import.meta.env.VITE_7Z_BIN_NAME;
61-
- if (!sevenZipPath) {
62-
- throw new Error("7z path is not defined");
63-
- }
64-
- if (import.meta.env.PROD) {
65-
- sevenZipPath = path.join(
66-
- path.dirname(app.getPath("exe")),
67-
- sevenZipPath,
68-
- );
69-
- }
70-
+ const sevenZipPath = `@sevenzip_path@`;
71-
+
72-
log.log(
73-
"Spawning 7z:",
74-
sevenZipPath,
59+
private getSevenZipPath(): string {
60+
+ return "@sevenzip_path@";
61+
let sevenZipPath = import.meta.env.VITE_7Z_BIN_NAME;
62+
if (!sevenZipPath) {
63+
throw new Error("7z path is not defined");

pkgs/by-name/vo/voicevox/package.nix

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
lib,
33
stdenv,
4-
buildNpmPackage,
54
fetchFromGitHub,
65
replaceVars,
6+
pnpm_9,
7+
nodejs,
78
makeDesktopItem,
89
copyDesktopItems,
910
makeWrapper,
@@ -13,18 +14,19 @@
1314
dart-sass,
1415
}:
1516

16-
buildNpmPackage rec {
17+
stdenv.mkDerivation (finalAttrs: {
1718
pname = "voicevox";
18-
version = "0.22.4";
19+
version = "0.23.0";
1920

2021
src = fetchFromGitHub {
2122
owner = "VOICEVOX";
2223
repo = "voicevox";
23-
tag = version;
24-
hash = "sha256-IOs3wBcFYpO4AHiWFOQWd5hp6EmwyA7Rcc8wjHKvYNQ=";
24+
tag = finalAttrs.version;
25+
hash = "sha256-wCC4wl5LPJVJQtV+X795rIXnURseQYiCZ9B6YujTFFw=";
2526
};
2627

2728
patches = [
29+
./unlock-node-and-pnpm-versions.patch
2830
(replaceVars ./hardcode-paths.patch {
2931
sevenzip_path = lib.getExe _7zz;
3032
voicevox_engine_path = lib.getExe voicevox-engine;
@@ -33,18 +35,25 @@ buildNpmPackage rec {
3335

3436
postPatch = ''
3537
substituteInPlace package.json \
36-
--replace-fail "999.999.999" "${version}" \
37-
--replace-fail "postinstall" "_postinstall"
38+
--replace-fail "999.999.999" "$version" \
39+
--replace-fail ' && electron-builder --config electron-builder.config.js --publish never' ""
3840
'';
3941

40-
npmDepsHash = "sha256-NuKFhDb/J6G3pFYHZedKnY2hDC5GCp70DpqrST4bJMA=";
41-
42-
# unlock very specific node version bounds specified by upstream
43-
npmInstallFlags = [ "--engine-strict=false" ];
42+
pnpmDeps = pnpm_9.fetchDeps {
43+
inherit (finalAttrs)
44+
pname
45+
version
46+
src
47+
patches
48+
;
49+
hash = "sha256-IuyDHAomaGEvGbN4gLpyPfZGm/pF9XK+BkXSipaM7NQ=";
50+
};
4451

4552
nativeBuildInputs =
4653
[
4754
makeWrapper
55+
pnpm_9.configHook
56+
nodejs
4857
]
4958
++ lib.optionals stdenv.hostPlatform.isLinux [
5059
copyDesktopItems
@@ -62,17 +71,17 @@ buildNpmPackage rec {
6271
substituteInPlace node_modules/sass-embedded/dist/lib/src/compiler-path.js \
6372
--replace-fail 'compilerCommand = (() => {' 'compilerCommand = (() => { return ["${lib.getExe dart-sass}"];'
6473
65-
# build command taken from the definition of the `electron:build` npm script
66-
VITE_TARGET=electron npm exec vite build
67-
6874
cp -r ${electron.dist} electron-dist
6975
chmod -R u+w electron-dist
7076
71-
npm exec electron-builder -- \
72-
--dir \
73-
--config electron-builder.config.js \
74-
-c.electronDist=electron-dist \
75-
-c.electronVersion=${electron.version}
77+
# note: we patched out the call to electron-builder in postPatch
78+
pnpm run electron:build
79+
80+
pnpm exec electron-builder \
81+
--dir \
82+
--config electron-builder.config.js \
83+
-c.electronDist=electron-dist \
84+
-c.electronVersion=${electron.version}
7685
7786
runHook postBuild
7887
'';
@@ -113,7 +122,7 @@ buildNpmPackage rec {
113122
];
114123

115124
meta = {
116-
changelog = "https://github.com/VOICEVOX/voicevox/releases/tag/${src.tag}";
125+
changelog = "https://github.com/VOICEVOX/voicevox/releases/tag/${finalAttrs.src.tag}";
117126
description = "Editor for the VOICEVOX speech synthesis software";
118127
homepage = "https://github.com/VOICEVOX/voicevox";
119128
license = lib.licenses.lgpl3Only;
@@ -124,4 +133,4 @@ buildNpmPackage rec {
124133
];
125134
platforms = electron.meta.platforms;
126135
};
127-
}
136+
})
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/package.json b/package.json
2+
index d0a58b4..b57b91c 100644
3+
--- a/package.json
4+
+++ b/package.json
5+
@@ -4,13 +4,6 @@
6+
"author": "Hiroshiba Kazuyuki",
7+
"private": true,
8+
"main": "./dist/main.js",
9+
- "engines": {
10+
- "node": ">=22.14.0 <23"
11+
- },
12+
- "volta": {
13+
- "node": "22.14.0"
14+
- },
15+
- "packageManager": "[email protected]",
16+
"scripts": {
17+
"// --- lint ---": "",
18+
"lint": "eslint .",

0 commit comments

Comments
 (0)