Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

voicevox: init at 0.20.0 #319403

Merged
merged 3 commits into from
Dec 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
voicevox-core: init at 0.15.4
  • Loading branch information
TomaSajt committed Dec 20, 2024
commit 534c3e67c1f875b48a172b26b24997c22c009017
74 changes: 74 additions & 0 deletions pkgs/by-name/vo/voicevox-core/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
lib,
stdenv,
fetchzip,
autoPatchelfHook,
}:

let
platformInfoTable = {
"x86_64-linux" = {
id = "linux-x64";
hash = "sha256-/PD5e0bWgnIsIrvyOypoJw30VkgbOFWV1NJpPS2G0WM=";
};
"aarch64-linux" = {
id = "linux-arm64";
hash = "sha256-zfiorXZyIISZPXPwmcdYeHceDmQXkUhsvTkNZScg648=";
};
"x86_64-darwin" = {
id = "osx-x64";
hash = "sha256-cdNdV1fVPkz6B7vtKZiPsLQGqnIiDtYa9KTcwSkjdJg=";
};
"aarch64-darwin" = {
id = "osx-arm64";
hash = "sha256-Z1dq2t/HBQulbPF23ZCihOrcZHMpTXEQ6yXKORZaFPk=";
};
};

platformInfo =
platformInfoTable.${stdenv.hostPlatform.system}
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation (finalAttrs: {
pname = "voicevox-core";
version = "0.15.4";

# Note: Only the prebuilt binaries are able to decrypt the encrypted voice models
src = fetchzip {
url = "https://github.com/VOICEVOX/voicevox_core/releases/download/${finalAttrs.version}/voicevox_core-${platformInfo.id}-cpu-${finalAttrs.version}.zip";
inherit (platformInfo) hash;
};

nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];

buildInputs = [ stdenv.cc.cc.lib ];

installPhase = ''
runHook preInstall

install -Dm755 libonnxruntime.* libvoicevox_core.* -t $out/lib
install -Dm644 model/* -t $out/lib/model
install -Dm644 *.h -t $out/include
install -Dm644 README.txt -t $out/share/doc/voicevox-core

runHook postInstall
'';

meta = {
changelog = "https://github.com/VOICEVOX/voicevox_core/releases/tag/${finalAttrs.version}";
description = "Core library for the VOICEVOX speech synthesis software";
homepage = "https://github.com/VOICEVOX/voicevox_core";
license = with lib.licenses; [
mit
({
name = "VOICEVOX Core Library Terms of Use";
url = "https://github.com/VOICEVOX/voicevox_resource/blob/main/core/README.md";
free = false;
redistributable = true;
})
];
maintainers = with lib.maintainers; [ tomasajt ];
platforms = lib.attrNames platformInfoTable;
TomaSajt marked this conversation as resolved.
Show resolved Hide resolved
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})