diff options
author | Markus S. Wamser <github-dev@mail2013.wamser.eu> | 2023-03-06 23:13:04 +0100 |
---|---|---|
committer | Markus S. Wamser <github-dev@mail2013.wamser.eu> | 2023-04-14 18:38:55 +0200 |
commit | c4e4e5294bce81b1b358c53930ca714ae128aa51 (patch) | |
tree | 34d35904d8885ff543444a42b3f95ff4d4652384 /pkgs/applications/audio/mbrola | |
parent | 777a9707e72e6dbbbdf9033c44f237154c64e9f7 (diff) | |
download | nixlib-c4e4e5294bce81b1b358c53930ca714ae128aa51.tar nixlib-c4e4e5294bce81b1b358c53930ca714ae128aa51.tar.gz nixlib-c4e4e5294bce81b1b358c53930ca714ae128aa51.tar.bz2 nixlib-c4e4e5294bce81b1b358c53930ca714ae128aa51.tar.lz nixlib-c4e4e5294bce81b1b358c53930ca714ae128aa51.tar.xz nixlib-c4e4e5294bce81b1b358c53930ca714ae128aa51.tar.zst nixlib-c4e4e5294bce81b1b358c53930ca714ae128aa51.zip |
mbrola: split derivation for bin and data files
Diffstat (limited to 'pkgs/applications/audio/mbrola')
-rw-r--r-- | pkgs/applications/audio/mbrola/default.nix | 90 |
1 files changed, 60 insertions, 30 deletions
diff --git a/pkgs/applications/audio/mbrola/default.nix b/pkgs/applications/audio/mbrola/default.nix index befa0ac206c3..a21495027c86 100644 --- a/pkgs/applications/audio/mbrola/default.nix +++ b/pkgs/applications/audio/mbrola/default.nix @@ -1,42 +1,72 @@ -{ stdenv, lib, fetchFromGitHub }: +{ stdenv, stdenvNoCC, lib, symlinkJoin, fetchFromGitHub }: let - voices = fetchFromGitHub { - owner = "numediart"; - repo = "MBROLA-voices"; - rev = "fe05a0ccef6a941207fd6aaad0b31294a1f93a51"; # using latest commit - sha256 = "1w0y2xjp9rndwdjagp2wxh656mdm3d6w9cs411g27rjyfy1205a0"; - }; -in -stdenv.mkDerivation rec { pname = "mbrola"; version = "3.3"; - src = fetchFromGitHub { - owner = "numediart"; - repo = "MBROLA"; - rev = version; - sha256 = "1w86gv6zs2cbr0731n49z8v6xxw0g8b0hzyv2iqb9mqcfh38l8zy"; + 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"; }; - # required for cross compilation - makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; + voices = stdenvNoCC.mkDerivation { + pname = "${pname}-voices"; + inherit version; - installPhase = '' - runHook preInstall - install -D Bin/mbrola $out/bin/mbrola + src = fetchFromGitHub { + owner = "numediart"; + repo = "MBROLA-voices"; + rev = "fe05a0ccef6a941207fd6aaad0b31294a1f93a51"; # using latest commit + sha256 = "1w0y2xjp9rndwdjagp2wxh656mdm3d6w9cs411g27rjyfy1205a0"; + }; - # TODO: package separately because it's very big - install -d $out/share/mbrola/voices - cp -R ${voices}/data/* $out/share/mbrola/voices/ - runHook postInstall - ''; + dontBuild = true; + installPhase = '' + runHook preInstall + install -d $out/share/mbrola/voices + cp -R $src/data/* $out/share/mbrola/voices/ + runHook postInstall + ''; + dontFixup = true; - 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 (voice files)"; + homepage = "https://github.com/numediart/MBROLA-voices"; + }; }; + + bin = stdenv.mkDerivation { + pname = "${pname}-bin"; + inherit version; + + src = fetchFromGitHub { + owner = "numediart"; + repo = "MBROLA"; + rev = version; + sha256 = "1w86gv6zs2cbr0731n49z8v6xxw0g8b0hzyv2iqb9mqcfh38l8zy"; + }; + + # required for cross compilation + makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; + + installPhase = '' + runHook preInstall + install -D Bin/mbrola $out/bin/mbrola + rm -rf $out/share/mbrola/voices/* + runHook postInstall + ''; + + 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 ]; } |