uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
120
pkgs/development/libraries/speechd/default.nix
Normal file
120
pkgs/development/libraries/speechd/default.nix
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, substituteAll
|
||||
, pkg-config
|
||||
, fetchurl
|
||||
, python3Packages
|
||||
, gettext
|
||||
, itstool
|
||||
, libtool
|
||||
, texinfo
|
||||
, util-linux
|
||||
, autoreconfHook
|
||||
, glib
|
||||
, dotconf
|
||||
, libsndfile
|
||||
, withLibao ? true, libao
|
||||
, withPulse ? false, libpulseaudio
|
||||
, withAlsa ? false, alsa-lib
|
||||
, withOss ? false
|
||||
, withFlite ? true, flite
|
||||
, withEspeak ? true, espeak, sonic, pcaudiolib
|
||||
, mbrola
|
||||
, withPico ? true, svox
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (python3Packages) python pyxdg wrapPython;
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "speech-dispatcher";
|
||||
version = "0.11.1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/brailcom/speechd/releases/download/${version}/${pname}-${version}.tar.gz";
|
||||
sha256 = "sha256-0doS7T2shPE3mbai7Dm6LTyiGoST9E3BhVvQupbC3cY=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./fix-paths.patch;
|
||||
utillinux = util-linux;
|
||||
})
|
||||
] ++ lib.optionals espeak.mbrolaSupport [
|
||||
# Replace FHS paths.
|
||||
(substituteAll {
|
||||
src = ./fix-mbrola-paths.patch;
|
||||
inherit espeak mbrola;
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
autoreconfHook
|
||||
gettext
|
||||
libtool
|
||||
itstool
|
||||
texinfo
|
||||
wrapPython
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
glib
|
||||
dotconf
|
||||
libsndfile
|
||||
libao
|
||||
libpulseaudio
|
||||
alsa-lib
|
||||
python
|
||||
] ++ lib.optionals withEspeak [
|
||||
espeak
|
||||
sonic
|
||||
pcaudiolib
|
||||
] ++ lib.optional withFlite [
|
||||
flite
|
||||
] ++ lib.optional withPico [
|
||||
svox
|
||||
];
|
||||
|
||||
pythonPath = [
|
||||
pyxdg
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
# Audio method falls back from left to right.
|
||||
"--with-default-audio-method=\"libao,pulse,alsa,oss\""
|
||||
"--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
|
||||
] ++ lib.optional withPulse [
|
||||
"--with-pulse"
|
||||
] ++ lib.optional withAlsa [
|
||||
"--with-alsa"
|
||||
] ++ lib.optional withLibao [
|
||||
"--with-libao"
|
||||
] ++ lib.optional withOss [
|
||||
"--with-oss"
|
||||
] ++ lib.optional withEspeak [
|
||||
"--with-espeak-ng"
|
||||
] ++ lib.optional withPico [
|
||||
"--with-pico"
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/modules/pico.c --replace "/usr/share/pico/lang" "${svox}/share/pico/lang"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
wrapPythonPrograms
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Common interface to speech synthesis";
|
||||
homepage = "https://devel.freebsoft.org/speechd";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [
|
||||
berce
|
||||
jtojnar
|
||||
];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
21
pkgs/development/libraries/speechd/fix-mbrola-paths.patch
Normal file
21
pkgs/development/libraries/speechd/fix-mbrola-paths.patch
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
diff --git a/src/modules/espeak.c b/src/modules/espeak.c
|
||||
index 94a01197..9bb34475 100644
|
||||
--- a/src/modules/espeak.c
|
||||
+++ b/src/modules/espeak.c
|
||||
@@ -898,13 +898,13 @@ static SPDVoice **espeak_list_synthesis_voices()
|
||||
path = g_strdup_printf("%s/mbrola/%s", espeak_data, voicename);
|
||||
if (access(path, O_RDONLY) != 0) {
|
||||
g_free(path);
|
||||
- path = g_strdup_printf("/usr/share/mbrola/%s", voicename);
|
||||
+ path = g_strdup_printf("@mbrola@/share/mbrola/%s", voicename);
|
||||
if (access(path, O_RDONLY) != 0) {
|
||||
g_free(path);
|
||||
- path = g_strdup_printf("/usr/share/mbrola/%s/%s", voicename, voicename);
|
||||
+ path = g_strdup_printf("@mbrola@/share/mbrola/%s/%s", voicename, voicename);
|
||||
if (access(path, O_RDONLY) != 0) {
|
||||
g_free(path);
|
||||
- path = g_strdup_printf("/usr/share/mbrola/voices/%s", voicename);
|
||||
+ path = g_strdup_printf("@mbrola@/share/mbrola/voices/%s", voicename);
|
||||
if (access(path, O_RDONLY) != 0) {
|
||||
g_free(path);
|
||||
espeak_mbrola[j] = NULL;
|
||||
11
pkgs/development/libraries/speechd/fix-paths.patch
Normal file
11
pkgs/development/libraries/speechd/fix-paths.patch
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
--- a/speech-dispatcherd.service.in
|
||||
+++ b/speech-dispatcherd.service.in
|
||||
@@ -19,7 +19,7 @@
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=@bindir@/speech-dispatcher -d
|
||||
-ExecReload=/bin/kill -HUP $MAINPID
|
||||
+ExecReload=@utillinux@/bin/kill -HUP $MAINPID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue