Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,13 @@ with lib;
glxinfo
];

nixpkgs.overlays = [
(self: super: {
mbrola-voices = super.mbrola-voices.override {
# only ship with one voice per language
languages = [ "*1" ];
};
})
];

}
18 changes: 2 additions & 16 deletions pkgs/applications/audio/mbrola/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, runCommandLocal }:
{ stdenv, lib, fetchFromGitHub, runCommandLocal, mbrola-voices }:

let
pname = "mbrola";
Expand All @@ -12,20 +12,6 @@ let
homepage = "https://github.com/numediart/MBROLA";
};

# Very big (0.65 G) so kept as a fixed-output derivation to limit "duplicates".
voices = fetchFromGitHub {
owner = "numediart";
repo = "MBROLA-voices";
rev = "fe05a0ccef6a941207fd6aaad0b31294a1f93a51"; # using latest commit
sha256 = "1w0y2xjp9rndwdjagp2wxh656mdm3d6w9cs411g27rjyfy1205a0";

name = "${pname}-voices-${version}";
meta = meta // {
description = "Speech synthesizer based on the concatenation of diphones (voice files)";
homepage = "https://github.com/numediart/MBROLA-voices";
};
};

bin = stdenv.mkDerivation {
pname = "${pname}-bin";
inherit version;
Expand Down Expand Up @@ -60,7 +46,7 @@ in
}
''
mkdir -p "$out/share/mbrola"
ln -s '${voices}/data' "$out/share/mbrola/voices"
ln -s '${mbrola-voices}/data' "$out/share/mbrola/voices"
ln -s '${bin}/bin' "$out/"
''

52 changes: 52 additions & 0 deletions pkgs/applications/audio/mbrola/voices.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
lib,
stdenv,
fetchFromGitHub,
unstableGitUpdater,
mbrola,
languages ? [ ],
}:

let
pname = "mbrola-voices";
version = "3.3"; # FIXME: revert this line on staging*

src = fetchFromGitHub {
owner = "numediart";
repo = "MBROLA-voices";
rev = "fe05a0ccef6a941207fd6aaad0b31294a1f93a51";
hash = "sha256-QBUggnde5iNeCESzxE0btVVTDOxc3Kdk483mdGUXHvA=";
name = "${pname}-${version}";
};

meta = {
description = "Speech synthesizer based on the concatenation of diphones (voice files)";
homepage = "https://github.com/numediart/MBROLA-voices";
license = mbrola.meta.license;
};
in

if (languages == [ ]) then
src // { inherit meta; }
else
stdenv.mkDerivation {
inherit pname version src;

postPatch = ''
shopt -s extglob
pushd data
rm -rfv !(${lib.concatStringsSep "|" languages})
popd
'';

installPhase = ''
runHook preInstall

mkdir $out
cp -R data $out/

runHook postInstall
'';

inherit meta;
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32208,6 +32208,8 @@ with pkgs;

mbrola = callPackage ../applications/audio/mbrola { };

mbrola-voices = callPackage ../applications/audio/mbrola/voices.nix { };

mcpp = callPackage ../development/compilers/mcpp { };

mda_lv2 = callPackage ../applications/audio/mda-lv2 { };
Expand Down