mbrola: split derivation for bin and data files

This commit is contained in:
Markus S. Wamser 2023-03-06 23:13:04 +01:00
parent 777a9707e7
commit c4e4e5294b

View File

@ -1,16 +1,46 @@
{ stdenv, lib, fetchFromGitHub }:
{ stdenv, stdenvNoCC, lib, symlinkJoin, fetchFromGitHub }:
let
voices = fetchFromGitHub {
pname = "mbrola";
version = "3.3";
meta = with lib; {
license = licenses.agpl3Plus;
maintainers = with maintainers; [ davidak ];
platforms = platforms.linux;
description = "Speech synthesizer based on the concatenation of diphones";
homepage = "https://github.com/numediart/MBROLA";
};
voices = stdenvNoCC.mkDerivation {
pname = "${pname}-voices";
inherit version;
src = fetchFromGitHub {
owner = "numediart";
repo = "MBROLA-voices";
rev = "fe05a0ccef6a941207fd6aaad0b31294a1f93a51"; # using latest commit
sha256 = "1w0y2xjp9rndwdjagp2wxh656mdm3d6w9cs411g27rjyfy1205a0";
};
in
stdenv.mkDerivation rec {
pname = "mbrola";
version = "3.3";
dontBuild = true;
installPhase = ''
runHook preInstall
install -d $out/share/mbrola/voices
cp -R $src/data/* $out/share/mbrola/voices/
runHook postInstall
'';
dontFixup = true;
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;
src = fetchFromGitHub {
owner = "numediart";
@ -25,18 +55,18 @@ stdenv.mkDerivation rec {
installPhase = ''
runHook preInstall
install -D Bin/mbrola $out/bin/mbrola
# TODO: package separately because it's very big
install -d $out/share/mbrola/voices
cp -R ${voices}/data/* $out/share/mbrola/voices/
rm -rf $out/share/mbrola/voices/*
runHook postInstall
'';
meta = with lib; {
description = "Speech synthesizer based on the concatenation of diphones";
homepage = "https://github.com/numediart/MBROLA";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ davidak ];
platforms = platforms.linux;
meta = meta // {
description = "Speech synthesizer based on the concatenation of diphones (binary only)";
};
};
in
symlinkJoin {
inherit pname version meta;
name = "${pname}-${version}";
paths = [ bin voices ];
}