Skip to content

Commit

Permalink
voicevox: 0.20.0 -> 0.22.3
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaSajt committed Jan 2, 2025
1 parent 6be536c commit 1c90438
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
21 changes: 10 additions & 11 deletions pkgs/by-name/vo/voicevox/hardcode-paths.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,29 @@ index 5b0dcb0..5848ccd 100644
"host": "http://127.0.0.1:50021"
}
diff --git a/electron-builder.config.js b/electron-builder.config.js
index 462e6f2..10a9bff 100644
index 196a0d7..7e313c2 100644
--- a/electron-builder.config.js
+++ b/electron-builder.config.js
@@ -35,19 +35,6 @@ const isMac = process.platform === "darwin";
@@ -37,18 +37,7 @@ 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, "build", "vendored", "7z"))
- .readdirSync(path.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 ./build/download7z.js` first.",
- "7z binary file not found. Run `node ./tools/download7z.js` first.",
- );
-}
-
/** @type {import("electron-builder").Configuration} */
const builderOptions = {
beforeBuild: async () => {
@@ -88,14 +75,6 @@ const builderOptions = {
@@ -90,14 +79,6 @@ const builderOptions = {
from: "build/README.txt",
to: extraFilePrefix + "README.txt",
},
Expand All @@ -44,17 +43,17 @@ index 462e6f2..10a9bff 100644
- to: path.join(extraFilePrefix, "vv-engine"),
- },
- {
- from: path.resolve(__dirname, "build", "vendored", "7z", sevenZipFile),
- from: path.resolve(__dirname, "vendored", "7z", sevenZipFile),
- to: extraFilePrefix + sevenZipFile,
- },
],
// electron-builder installer
productName: "VOICEVOX",
diff --git a/src/backend/electron/manager/vvppManager.ts b/src/backend/electron/manager/vvppManager.ts
index 6aa17b6..b8b52b7 100644
index edd3177..22d0114 100644
--- a/src/backend/electron/manager/vvppManager.ts
+++ b/src/backend/electron/manager/vvppManager.ts
@@ -196,16 +196,8 @@ export class VvppManager {
@@ -184,16 +184,8 @@ export class VvppManager {

const args = ["x", "-o" + outputDir, archiveFile, "-t" + format];

Expand Down
23 changes: 17 additions & 6 deletions pkgs/by-name/vo/voicevox/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
electron,
_7zz,
voicevox-engine,
dart-sass,
}:

buildNpmPackage rec {
pname = "voicevox";
version = "0.20.0";
version = "0.22.3";

src = fetchFromGitHub {
owner = "VOICEVOX";
repo = "voicevox";
rev = "refs/tags/${version}";
hash = "sha256-05WTecNc1xxe7SGDPZbLtRELNghFkMTqI4pkX4PsVWI=";
tag = version;
hash = "sha256-6z+A4bJIDfN/K8IjEdt2TqEa/EDt4uQpGh+zSWfP74I=";
};

patches = [
Expand All @@ -36,7 +37,10 @@ buildNpmPackage rec {
--replace-fail "postinstall" "_postinstall"
'';

npmDepsHash = "sha256-g3avCj3S96qYPAyGXn4yvrZ4gteJld+g4eV4aRtv/3g=";
npmDepsHash = "sha256-NuKFhDb/J6G3pFYHZedKnY2hDC5GCp70DpqrST4bJMA=";

# unlock very specific node version bounds specified by upstream
npmInstallFlags = [ "--engine-strict=false" ];

nativeBuildInputs =
[
Expand All @@ -54,6 +58,10 @@ buildNpmPackage rec {
buildPhase = ''
runHook preBuild
# force sass-embedded to use our own sass 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}"];'
# build command taken from the definition of the `electron:build` npm script
VITE_TARGET=electron npm exec vite build
Expand Down Expand Up @@ -105,12 +113,15 @@ buildNpmPackage rec {
];

meta = {
changelog = "https://github.com/VOICEVOX/voicevox/releases/tag/${version}";
changelog = "https://github.com/VOICEVOX/voicevox/releases/tag/${src.tag}";
description = "Editor for the VOICEVOX speech synthesis software";
homepage = "https://github.com/VOICEVOX/voicevox";
license = lib.licenses.lgpl3Only;
mainProgram = "voicevox";
maintainers = with lib.maintainers; [ tomasajt ];
maintainers = with lib.maintainers; [
tomasajt
eljamm
];
platforms = electron.meta.platforms;
};
}

0 comments on commit 1c90438

Please sign in to comment.