mbrola: convert data to a fixed-output derivation
It's quite annoying that we had to redownload this 0.65G on every rebuild. Also disk space gets saved, unless you used some deduplication (e.g. nix.settings.auto-optimise-store). And cache.nixos.org space, too.
This commit is contained in:
parent
02f1909394
commit
56cefcddc6
1 changed files with 19 additions and 25 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, stdenvNoCC, lib, symlinkJoin, fetchFromGitHub }:
|
{ stdenv, lib, fetchFromGitHub, runCommandLocal }:
|
||||||
|
|
||||||
let
|
let
|
||||||
pname = "mbrola";
|
pname = "mbrola";
|
||||||
|
@ -12,26 +12,14 @@ let
|
||||||
homepage = "https://github.com/numediart/MBROLA";
|
homepage = "https://github.com/numediart/MBROLA";
|
||||||
};
|
};
|
||||||
|
|
||||||
voices = stdenvNoCC.mkDerivation {
|
# Very big (0.65 G) so kept as a fixed-output derivation to limit "duplicates".
|
||||||
pname = "${pname}-voices";
|
voices = fetchFromGitHub {
|
||||||
inherit version;
|
owner = "numediart";
|
||||||
|
repo = "MBROLA-voices";
|
||||||
src = fetchFromGitHub {
|
rev = "fe05a0ccef6a941207fd6aaad0b31294a1f93a51"; # using latest commit
|
||||||
owner = "numediart";
|
sha256 = "1w0y2xjp9rndwdjagp2wxh656mdm3d6w9cs411g27rjyfy1205a0";
|
||||||
repo = "MBROLA-voices";
|
|
||||||
rev = "fe05a0ccef6a941207fd6aaad0b31294a1f93a51"; # using latest commit
|
|
||||||
sha256 = "1w0y2xjp9rndwdjagp2wxh656mdm3d6w9cs411g27rjyfy1205a0";
|
|
||||||
};
|
|
||||||
|
|
||||||
dontBuild = true;
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
install -d $out/share/mbrola/voices
|
|
||||||
cp -R $src/data/* $out/share/mbrola/voices/
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
dontFixup = true;
|
|
||||||
|
|
||||||
|
name = "${pname}-voices-${version}";
|
||||||
meta = meta // {
|
meta = meta // {
|
||||||
description = "Speech synthesizer based on the concatenation of diphones (voice files)";
|
description = "Speech synthesizer based on the concatenation of diphones (voice files)";
|
||||||
homepage = "https://github.com/numediart/MBROLA-voices";
|
homepage = "https://github.com/numediart/MBROLA-voices";
|
||||||
|
@ -65,8 +53,14 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
symlinkJoin {
|
runCommandLocal
|
||||||
inherit pname version meta;
|
"${pname}-${version}"
|
||||||
name = "${pname}-${version}";
|
{
|
||||||
paths = [ bin voices ];
|
inherit pname version meta;
|
||||||
}
|
}
|
||||||
|
''
|
||||||
|
mkdir -p "$out/share/mbrola"
|
||||||
|
ln -s '${voices}/data' "$out/share/mbrola/voices"
|
||||||
|
ln -s '${bin}/bin' "$out/"
|
||||||
|
''
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue