speechd: introduce minimal variant, use it everywhere

This commit is contained in:
K900 2024-07-24 16:36:20 +03:00
parent 9e852fddaa
commit 8e7a098243
18 changed files with 50 additions and 36 deletions

View File

@ -15,7 +15,7 @@
, libxslt , libxslt
, libxml2 , libxml2
, speechSupport ? true , speechSupport ? true
, speechd , speechd-minimal
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
@ -56,7 +56,7 @@ stdenv.mkDerivation {
# at-spi2 needs dbus to be recognized by pkg-config # at-spi2 needs dbus to be recognized by pkg-config
at-spi2-core at-spi2-core
dbus dbus
] ++ lib.optional speechSupport speechd; ] ++ lib.optional speechSupport speechd-minimal;
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -7,7 +7,7 @@
, glibmm , glibmm
, libpulseaudio , libpulseaudio
, libao , libao
, speechd , speechd-minimal
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
glibmm glibmm
libpulseaudio libpulseaudio
libao libao
speechd speechd-minimal
]; ];
meta = { meta = {

View File

@ -21,7 +21,7 @@
, qmake , qmake
, qtbase , qtbase
, qtwayland , qtwayland
, speechd , speechd-minimal
, sqlite , sqlite
, wrapQtAppsHook , wrapQtAppsHook
, xdg-utils , xdg-utils
@ -132,7 +132,7 @@ stdenv.mkDerivation (finalAttrs: {
] ++ lib.optional (unrarSupport) unrardll) ] ++ lib.optional (unrarSupport) unrardll)
) )
xdg-utils xdg-utils
] ++ lib.optional (speechSupport) speechd; ] ++ lib.optional (speechSupport) speechd-minimal;
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall

View File

@ -35,7 +35,7 @@
, glib, gtk3, dbus-glib , glib, gtk3, dbus-glib
, libXScrnSaver, libXcursor, libXtst, libxshmfence, libGLU, libGL , libXScrnSaver, libXcursor, libXtst, libxshmfence, libGLU, libGL
, mesa , mesa
, pciutils, protobuf, speechd, libXdamage, at-spi2-core , pciutils, protobuf, speechd-minimal, libXdamage, at-spi2-core
, pipewire , pipewire
, libva , libva
, libdrm, wayland, libxkbcommon # Ozone , libdrm, wayland, libxkbcommon # Ozone
@ -196,7 +196,7 @@ let
glib gtk3 dbus-glib glib gtk3 dbus-glib
libXScrnSaver libXcursor libXtst libxshmfence libGLU libGL libXScrnSaver libXcursor libXtst libxshmfence libGLU libGL
mesa # required for libgbm mesa # required for libgbm
pciutils protobuf speechd libXdamage at-spi2-core pciutils protobuf speechd-minimal libXdamage at-spi2-core
pipewire pipewire
libva libva
libdrm wayland libxkbcommon libdrm wayland libxkbcommon
@ -224,7 +224,7 @@ let
glib gtk3 dbus-glib glib gtk3 dbus-glib
libXScrnSaver libXcursor libXtst libxshmfence libGLU libGL libXScrnSaver libXcursor libXtst libxshmfence libGLU libGL
mesa # required for libgbm mesa # required for libgbm
pciutils protobuf speechd libXdamage at-spi2-core pciutils protobuf speechd-minimal libXdamage at-spi2-core
pipewire pipewire
libva libva
libdrm wayland libxkbcommon libdrm wayland libxkbcommon

View File

@ -17,7 +17,7 @@
, pciutils , pciutils
, sndio , sndio
, libjack2 , libjack2
, speechd , speechd-minimal
, removeReferencesTo , removeReferencesTo
}: }:
@ -98,7 +98,7 @@ let
++ lib.optional sndioSupport sndio ++ lib.optional sndioSupport sndio
++ lib.optional jackSupport libjack2 ++ lib.optional jackSupport libjack2
++ lib.optional smartcardSupport opensc ++ lib.optional smartcardSupport opensc
++ lib.optional (cfg.speechSynthesisSupport or true) speechd ++ lib.optional (cfg.speechSynthesisSupport or true) speechd-minimal
++ pkcs11Modules ++ pkcs11Modules
++ gtk_modules; ++ gtk_modules;
gtk_modules = [ libcanberra-gtk3 ]; gtk_modules = [ libcanberra-gtk3 ];

View File

@ -6,7 +6,7 @@
, libXi, libXrandr, libXrender, libXtst, libxcb, libxshmfence, mesa, nspr, nss , libXi, libXrandr, libXrender, libXtst, libxcb, libxshmfence, mesa, nspr, nss
, pango, systemd, libappindicator-gtk3, libdbusmenu, writeScript, python3, runCommand , pango, systemd, libappindicator-gtk3, libdbusmenu, writeScript, python3, runCommand
, libunity , libunity
, speechd , speechd-minimal
, wayland , wayland
, branch , branch
, withOpenASAR ? false, openasar , withOpenASAR ? false, openasar
@ -91,7 +91,7 @@ stdenv.mkDerivation rec {
libappindicator-gtk3 libappindicator-gtk3
libdbusmenu libdbusmenu
wayland wayland
] ++ lib.optional withTTS speechd); ] ++ lib.optional withTTS speechd-minimal);
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall

View File

@ -11,7 +11,7 @@
, jackSupport ? false, libjack2 , jackSupport ? false, libjack2
, pipewireSupport ? true, pipewire , pipewireSupport ? true, pipewire
, pulseSupport ? true, libpulseaudio , pulseSupport ? true, libpulseaudio
, speechdSupport ? false, speechd , speechdSupport ? false, speechd-minimal
}: }:
let let
@ -53,7 +53,7 @@ let
buildInputs = [ flac libogg libopus libsndfile libvorbis qt5.qtsvg rnnoise speex ] buildInputs = [ flac libogg libopus libsndfile libvorbis qt5.qtsvg rnnoise speex ]
++ lib.optional (!jackSupport) alsa-lib ++ lib.optional (!jackSupport) alsa-lib
++ lib.optional jackSupport libjack2 ++ lib.optional jackSupport libjack2
++ lib.optional speechdSupport speechd ++ lib.optional speechdSupport speechd-minimal
++ lib.optional pulseSupport libpulseaudio ++ lib.optional pulseSupport libpulseaudio
++ lib.optional pipewireSupport pipewire; ++ lib.optional pipewireSupport pipewire;
@ -72,7 +72,7 @@ let
++ lib.optional (!pipewireSupport) "-D pipewire=OFF" ++ lib.optional (!pipewireSupport) "-D pipewire=OFF"
++ lib.optional jackSupport "-D alsa=OFF -D jackaudio=ON"; ++ lib.optional jackSupport "-D alsa=OFF -D jackaudio=ON";
env.NIX_CFLAGS_COMPILE = lib.optionalString speechdSupport "-I${speechd}/include/speech-dispatcher"; env.NIX_CFLAGS_COMPILE = lib.optionalString speechdSupport "-I${speechd-minimal}/include/speech-dispatcher";
postFixup = '' postFixup = ''
wrapProgram $out/bin/mumble \ wrapProgram $out/bin/mumble \

View File

@ -7,14 +7,14 @@
, xorg , xorg
, perl , perl
, openssl , openssl
, speechd , speechd-minimal
, libxkbcommon , libxkbcommon
, libGL , libGL
, wayland , wayland
}: }:
let let
rpathLibs = [ rpathLibs = [
speechd speechd-minimal
openssl openssl
gtk3 gtk3
libxkbcommon libxkbcommon

View File

@ -24,7 +24,7 @@
## Ubuntu ## Ubuntu
, liberation_ttf, curl, util-linux, xdg-utils, wget , liberation_ttf, curl, util-linux, xdg-utils, wget
## Arch Linux. ## Arch Linux.
, flac, harfbuzz, icu, libpng, libopus, snappy, speechd , flac, harfbuzz, icu, libpng, libopus, snappy, speechd-minimal
## Gentoo ## Gentoo
, bzip2, libcap , bzip2, libcap
@ -54,7 +54,7 @@ let
systemd systemd
libexif pciutils libexif pciutils
liberation_ttf curl util-linux wget liberation_ttf curl util-linux wget
flac harfbuzz icu libpng opusWithCustomModes snappy speechd flac harfbuzz icu libpng opusWithCustomModes snappy speechd-minimal
bzip2 libcap at-spi2-atk at-spi2-core bzip2 libcap at-spi2-atk at-spi2-core
libkrb5 libdrm libglvnd mesa coreutils libkrb5 libdrm libglvnd mesa coreutils
libxkbcommon pipewire wayland libxkbcommon pipewire wayland

View File

@ -20,7 +20,7 @@
, lsof , lsof
, coreutils , coreutils
, gsettings-desktop-schemas , gsettings-desktop-schemas
, speechd , speechd-minimal
, brltty , brltty
, liblouis , liblouis
, gst_all_1 , gst_all_1
@ -65,7 +65,7 @@ python3.pkgs.buildPythonApplication rec {
brltty brltty
liblouis liblouis
psutil psutil
speechd speechd-minimal
gst-python gst-python
setproctitle setproctitle
]; ];

View File

@ -1,9 +1,9 @@
{ lib, qtModule, stdenv, speechd, pkg-config }: { lib, qtModule, stdenv, speechd-minimal, pkg-config }:
qtModule { qtModule {
pname = "qtspeech"; pname = "qtspeech";
propagatedBuildInputs = [ ]; propagatedBuildInputs = [ ];
buildInputs = lib.optionals stdenv.isLinux [ speechd ]; buildInputs = lib.optionals stdenv.isLinux [ speechd-minimal ];
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
} }

View File

@ -6,14 +6,14 @@
, pkg-config , pkg-config
, flite , flite
, alsa-lib , alsa-lib
, speechd , speechd-minimal
, Cocoa , Cocoa
}: }:
qtModule { qtModule {
pname = "qtspeech"; pname = "qtspeech";
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ flite alsa-lib speechd ]; buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ flite alsa-lib speechd-minimal ];
propagatedBuildInputs = [ qtbase qtmultimedia ] propagatedBuildInputs = [ qtbase qtmultimedia ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa ]; ++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa ];
} }

View File

@ -21,6 +21,7 @@
, withEspeak ? true, espeak, sonic, pcaudiolib , withEspeak ? true, espeak, sonic, pcaudiolib
, mbrola , mbrola
, withPico ? true, svox , withPico ? true, svox
, libsOnly ? false
}: }:
let let
@ -101,14 +102,16 @@ in stdenv.mkDerivation rec {
substituteInPlace src/modules/pico.c --replace "/usr/share/pico/lang" "${svox}/share/pico/lang" substituteInPlace src/modules/pico.c --replace "/usr/share/pico/lang" "${svox}/share/pico/lang"
''; '';
postInstall = '' postInstall = if libsOnly then ''
rm -rf $out/{bin,etc,lib/speech-dispatcher,lib/systemd,libexec,share}
'' else ''
wrapPythonPrograms wrapPythonPrograms
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;
meta = with lib; { meta = with lib; {
description = "Common interface to speech synthesis"; description = "Common interface to speech synthesis" + lib.optionalString libsOnly " - client libraries only";
homepage = "https://devel.freebsoft.org/speechd"; homepage = "https://devel.freebsoft.org/speechd";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
maintainers = with maintainers; [ maintainers = with maintainers; [

View File

@ -16,7 +16,7 @@
, pipewire , pipewire
, libsecret , libsecret
, libpulseaudio , libpulseaudio
, speechd , speechd-minimal
, info , info
}: }:
@ -199,7 +199,7 @@ in (chromium.override { upstream-info = info.chromium; }).mkDerivation (base: {
stdenv.cc.cc.lib stdenv.cc.cc.lib
libsecret libsecret
libpulseaudio libpulseaudio
speechd speechd-minimal
]; ];
in in
base.postFixup + '' base.postFixup + ''

View File

@ -19,7 +19,7 @@
, alsa-lib , alsa-lib
, libpulseaudio , libpulseaudio
, dbus , dbus
, speechd , speechd-minimal
, fontconfig , fontconfig
, udev , udev
, withDebug ? false , withDebug ? false
@ -81,7 +81,7 @@ stdenv.mkDerivation rec {
++ lib.optional withPulseaudio libpulseaudio ++ lib.optional withPulseaudio libpulseaudio
++ lib.optional withDbus dbus ++ lib.optional withDbus dbus
++ lib.optional withDbus dbus.lib ++ lib.optional withDbus dbus.lib
++ lib.optional withSpeechd speechd ++ lib.optional withSpeechd speechd-minimal
++ lib.optional withFontconfig fontconfig ++ lib.optional withFontconfig fontconfig
++ lib.optional withFontconfig fontconfig.lib ++ lib.optional withFontconfig fontconfig.lib
++ lib.optional withUdev udev; ++ lib.optional withUdev udev;

View File

@ -6,7 +6,7 @@
, alsa-lib , alsa-lib
, openssl , openssl
, withTTS ? false , withTTS ? false
, speechd , speechd-minimal
, darwin , darwin
}: }:
let let
@ -31,7 +31,7 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ]; nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];
buildInputs = [ openssl ] buildInputs = [ openssl ]
++ lib.optionals (withTTS && stdenv.isLinux) [ speechd ] ++ lib.optionals (withTTS && stdenv.isLinux) [ speechd-minimal ]
++ lib.optionals stdenv.isLinux [ alsa-lib ] ++ lib.optionals stdenv.isLinux [ alsa-lib ]
++ lib.optionals (withTTS && stdenv.isDarwin) [ AVFoundation AppKit ] ++ lib.optionals (withTTS && stdenv.isDarwin) [ AVFoundation AppKit ]
++ lib.optionals stdenv.isDarwin [ CoreAudio AudioUnit ]; ++ lib.optionals stdenv.isDarwin [ CoreAudio AudioUnit ];

View File

@ -5,7 +5,7 @@
, pkg-config , pkg-config
, libpulseaudio , libpulseaudio
, dbus , dbus
, speechd , speechd-minimal
}: }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
@ -32,7 +32,7 @@ rustPlatform.buildRustPackage rec {
buildInputs = [ buildInputs = [
libpulseaudio libpulseaudio
dbus dbus
speechd speechd-minimal
]; ];
nativeBuildInputs = [ nativeBuildInputs = [

View File

@ -24074,6 +24074,17 @@ with pkgs;
speechd = callPackage ../development/libraries/speechd { }; speechd = callPackage ../development/libraries/speechd { };
speechd-minimal = speechd.override {
withLibao = false;
withPulse = false;
withAlsa = false;
withOss = false;
withFlite = false;
withEspeak = false;
withPico = false;
libsOnly = true;
};
speech-tools = callPackage ../development/libraries/speech-tools { speech-tools = callPackage ../development/libraries/speech-tools {
inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa; inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa;
}; };