Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

espeak-ng: Pick mbrola voices from XDG_DATA_DIRS #325124

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Jul 6, 2024

Description of changes

Fixes: #207204, #261281
Needed for: #226869

  • espeak-ng patch
  • move voices to a separate package
  • create nixos module
  • speechd patch (leaving that for someone else)
  • reorder commits

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested with env XDG_DATA_DIRS=(nix-build -A mbrola-voices --no-out-link)/share (nix-build -A espeak-ng)/bin/espeak "Hello world!" -v mb-en1
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@jtojnar jtojnar force-pushed the espeak-mbrola-size branch from 2bd3a22 to 7859e5a Compare July 6, 2024 21:47
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: GNOME GNOME desktop environment and its underlying platform 8.has: module (update) This PR changes an existing module in `nixos/` labels Jul 6, 2024
@jtojnar jtojnar force-pushed the espeak-mbrola-size branch from 4a3b15c to 5dcbae4 Compare July 6, 2024 22:24
@ofborg ofborg bot requested a review from aske July 6, 2024 22:24
@jtojnar jtojnar force-pushed the espeak-mbrola-size branch from 5dcbae4 to 206f1a0 Compare July 7, 2024 19:43
@jtojnar

This comment was marked as resolved.

@jtojnar jtojnar force-pushed the espeak-mbrola-size branch from aa8f836 to acaf129 Compare July 7, 2024 20:44
@jtojnar jtojnar marked this pull request as ready for review July 7, 2024 20:44
jtojnar added 4 commits July 7, 2024 23:02
This is required for packages to depend on `mbrola` while keeping the dependency on `mbrola-voices` implicit, since it is huge. It will be eventually picked from the environment.

The old `mbrola` package is exposed as `mbrola.combined`.

Our `speechd` patch is only using the voices.
Upstream espeak-ng expects one of the following paths:

 - $data_dir/mbrola/$lang
 - $data_dir/mbrola/$lang/$lang
 - $data_dir/mbrola/voices/$lang

The previously used `$data_dir/mbrola/voices/$lang/$lang` is not supported.
Let’s change the installation path to the second one, so that espeak-ng can still find mbrola voices once we drop our patch.
speechd also expects one of the the paths above.
@jtojnar jtojnar force-pushed the espeak-mbrola-size branch from acaf129 to e406b9b Compare July 7, 2024 21:03
in
{
options.programs.mbrola = {
enable = lib.mkEnableOption "linking mbrola speech synthesizer voices installed through [](#opt-environment.systemPackages)";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not very happy with this option.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
enable = lib.mkEnableOption "linking mbrola speech synthesizer voices installed through [](#opt-environment.systemPackages)";
enable = lib.mkEnableOption "" // { description = "Wether to link mbrola speech synthesizer voices installed through [](#opt-environment.systemPackages)."; };

in
{
options.programs.mbrola = {
enable = lib.mkEnableOption "linking mbrola speech synthesizer voices installed through [](#opt-environment.systemPackages)";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
enable = lib.mkEnableOption "linking mbrola speech synthesizer voices installed through [](#opt-environment.systemPackages)";
enable = lib.mkEnableOption "" // { description = "Wether to link mbrola speech synthesizer voices installed through [](#opt-environment.systemPackages)."; };

options.programs.mbrola = {
enable = lib.mkEnableOption "linking mbrola speech synthesizer voices installed through [](#opt-environment.systemPackages)";

installDefaultVoices = lib.mkOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected a package option instead of this one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plan is to eventually split the mbrola-voices package: #226869

'';

passthru = {
combined = runCommandLocal "mbrola-combined-${finalAttrs.version}" { inherit (finalAttrs) meta; } ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make a nicer git history if we didn't include this intermediate step in the commits.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do not include this step then some of the commits will be broken.

@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Jul 7, 2024
@ofborg ofborg bot requested a review from berce July 7, 2024 23:24
@jtojnar jtojnar force-pushed the espeak-mbrola-size branch from e406b9b to 471b9ed Compare July 8, 2024 06:55
jtojnar added 3 commits July 8, 2024 09:24
These provide slightly nicer pronunciation.
Since we plan to stop hardcoding the path to the voices in `espeak-ng`,
we need to pull them through the NixOS module.
This will require that user installs e.g. `mbrola-voices` in such a way its `share/` directory ends up in `XDG_DATA_DIRS` environment variable. The NixOS module change in the parent commit will handle that automatically for GNOME.
@jtojnar jtojnar force-pushed the espeak-mbrola-size branch from 471b9ed to 5f1ff0f Compare July 8, 2024 07:25
@jtojnar jtojnar requested a review from K900 July 30, 2024 06:47
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 11-100 10.rebuild-linux: 501-1000 10.rebuild-linux: 501+
Projects
None yet
Development

Successfully merging this pull request may close these issues.

okular pulls in mbrola worth > 600 mb
4 participants