opentabletdriver: 0.6.5.0 -> 0.6.5.1 (#379384)
[NixPkgs.git] / pkgs / by-name / vo / voicevox-core / package.nix
blob556eb756424d28bd8466b591b99e9cfa49cb167d
2   lib,
3   stdenv,
4   fetchurl,
5   unzip,
6   autoPatchelfHook,
7 }:
9 stdenv.mkDerivation (finalAttrs: {
10   pname = "voicevox-core";
11   version = "0.15.7";
13   src = finalAttrs.passthru.sources.${stdenv.hostPlatform.system};
15   nativeBuildInputs = [ unzip ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
17   buildInputs = [ stdenv.cc.cc.lib ];
19   installPhase = ''
20     runHook preInstall
22     install -Dm755 libonnxruntime.* libvoicevox_core.* -t $out/lib
23     install -Dm644 model/* -t $out/lib/model
24     install -Dm644 *.h -t $out/include
25     install -Dm644 README.txt -t $out/share/doc/voicevox-core
27     runHook postInstall
28   '';
30   # When updating, run the following command to fetch all FODs:
31   # nix-build -A voicevox-core.sources --keep-going
32   passthru.sources =
33     let
34       # Note: Only the prebuilt binaries are able to decrypt the encrypted voice models
35       fetchCoreArtifact =
36         { id, hash }:
37         fetchurl {
38           url = "https://github.com/VOICEVOX/voicevox_core/releases/download/${finalAttrs.version}/voicevox_core-${id}-cpu-${finalAttrs.version}.zip";
39           inherit hash;
40         };
41     in
42     {
43       "x86_64-linux" = fetchCoreArtifact {
44         id = "linux-x64";
45         hash = "sha256-7FgrJ1HlB8l5MHd2KM4lYRx2bYdxrD2+su1G33/ugUA=";
46       };
47       "aarch64-linux" = fetchCoreArtifact {
48         id = "linux-arm64";
49         hash = "sha256-fD7YMTo9jeB4vJibnVwX8VrukCUeAwS6VXGOr3VXG+c=";
50       };
51       "x86_64-darwin" = fetchCoreArtifact {
52         id = "osx-x64";
53         hash = "sha256-5h9qEKbdcvip50TLs3vf6lXkSv24VEjOrx6CTUo7Q4Q=";
54       };
55       "aarch64-darwin" = fetchCoreArtifact {
56         id = "osx-arm64";
57         hash = "sha256-0bFLhvP7LqDzuk3pyM9QZfc8eLMW0IgqVkaXsuS3qlY=";
58       };
59     };
61   meta = {
62     changelog = "https://github.com/VOICEVOX/voicevox_core/releases/tag/${finalAttrs.version}";
63     description = "Core library for the VOICEVOX speech synthesis software";
64     homepage = "https://github.com/VOICEVOX/voicevox_core";
65     license = with lib.licenses; [
66       mit
67       ({
68         name = "VOICEVOX Core Library Terms of Use";
69         url = "https://github.com/VOICEVOX/voicevox_resource/blob/main/core/README.md";
70         free = false;
71         redistributable = true;
72       })
73     ];
74     maintainers = with lib.maintainers; [
75       tomasajt
76       eljamm
77     ];
78     platforms = lib.attrNames finalAttrs.passthru.sources;
79     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
80   };