mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
espeakedit: version bump 1.46.02 -> 1.48.03 (and add to channel)
The one-liner gcc buildPhase doesn't work anymore, so I'm using upstream Makefile instead. The Makefile needs a tiny patch to work (not nixpkgs specific). Also fixup path to 'sox' and espeak-data/ (runtime deps) by providing full paths. TODO: Uhm, seems like espeakedit still wants espeak-data/ in $HOME, even thought I've told it to use $espeak/share/espeak-data. Have to contact upstream to get this fixed. Workaround: cp -r $(nix-build -A espeak)/share/espeak-data ~ chmod +w ~/espeak-data
This commit is contained in:
parent
62adfd8570
commit
4597903ce9
4 changed files with 107 additions and 13 deletions
|
@ -1,31 +1,57 @@
|
||||||
{stdenv, fetchurl, unzip, portaudio, wxGTK}:
|
{ stdenv, fetchurl, pkgconfig, unzip, portaudio, wxGTK, sox }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "espeakedit-1.48.03";
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "espeakedit-1.46.02";
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = mirror://sourceforge/espeak/espeakedit-1.46.02.zip;
|
url = "mirror://sourceforge/espeak/${name}.zip";
|
||||||
sha256 = "1cc5r89sn8zz7b8wj4grx9xb7aqyi0ybj0li9hpy7hd67r56kqkl";
|
sha256 = "0x8s7vpb7rw5x37yjzy1f98m4f2csdg89libb74fm36gn8ly0hli";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ unzip portaudio wxGTK ];
|
buildInputs = [ pkgconfig unzip portaudio wxGTK ];
|
||||||
|
|
||||||
patchPhase = if portaudio.api_version == 19 then ''
|
# TODO:
|
||||||
|
# Uhm, seems like espeakedit still wants espeak-data/ in $HOME, even thought
|
||||||
|
# it should use $espeak/share/espeak-data. Have to contact upstream to get
|
||||||
|
# this fixed.
|
||||||
|
#
|
||||||
|
# Workaround:
|
||||||
|
# cp -r $(nix-build -A espeak)/share/espeak-data ~
|
||||||
|
# chmod +w ~/espeak-data
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./espeakedit-fix-makefile.patch
|
||||||
|
./espeakedit-configurable-sox-path.patch
|
||||||
|
./espeakedit-configurable-path-espeak-data.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
# Disable -Wall flag because it's noisy
|
||||||
|
sed -i "s/-Wall//g" src/Makefile
|
||||||
|
|
||||||
|
# Fixup paths (file names from above espeak-configurable* patches)
|
||||||
|
for file in src/compiledata.cpp src/readclause.cpp src/speech.h; do
|
||||||
|
sed -e "s|@sox@|${sox}/bin/sox|" \
|
||||||
|
-e "s|@prefix@|$out|" \
|
||||||
|
-i "$file"
|
||||||
|
done
|
||||||
|
'' + stdenv.lib.optionalString (portaudio.api_version == 19) ''
|
||||||
cp src/portaudio19.h src/portaudio.h
|
cp src/portaudio19.h src/portaudio.h
|
||||||
'' else "";
|
'';
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
cd src
|
make -C src
|
||||||
gcc -o espeakedit *.cpp `wx-config --cxxflags --libs`
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
ensureDir $out/bin
|
mkdir -p "$out/bin"
|
||||||
cp espeakedit $out/bin
|
cp src/espeakedit "$out/bin"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
description = "Phoneme editor for espeak";
|
description = "Phoneme editor for espeak";
|
||||||
homepage = http://espeak.sourceforge.net/;
|
homepage = http://espeak.sourceforge.net/;
|
||||||
license = "GPLv3+";
|
license = "GPLv3+";
|
||||||
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
Don't hardcode /usr, use @prefix@.
|
||||||
|
|
||||||
|
Author: Bjørn Forsman
|
||||||
|
diff -uNr espeakedit-1.48.03.orig/src/speech.h espeakedit-1.48.03/src/speech.h
|
||||||
|
--- espeakedit-1.48.03.orig/src/speech.h 2014-03-04 17:48:12.000000000 +0100
|
||||||
|
+++ espeakedit-1.48.03/src/speech.h 2014-07-22 18:21:40.860790719 +0200
|
||||||
|
@@ -58,7 +58,7 @@
|
||||||
|
|
||||||
|
// will look for espeak_data directory here, and also in user's home directory
|
||||||
|
#ifndef PATH_ESPEAK_DATA
|
||||||
|
- #define PATH_ESPEAK_DATA "/usr/share/espeak-data"
|
||||||
|
+ #define PATH_ESPEAK_DATA "@prefix@/share/espeak-data"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef unsigned short USHORT;
|
|
@ -0,0 +1,27 @@
|
||||||
|
Make the path to 'sox' configurable by marking it '@sox@' (easy to match with sed).
|
||||||
|
|
||||||
|
Author: Bjørn Forsman
|
||||||
|
diff -uNr espeakedit-1.48.03.orig/src/compiledata.cpp espeakedit-1.48.03/src/compiledata.cpp
|
||||||
|
--- espeakedit-1.48.03.orig/src/compiledata.cpp 2014-03-04 17:48:11.000000000 +0100
|
||||||
|
+++ espeakedit-1.48.03/src/compiledata.cpp 2014-07-22 16:38:50.261388452 +0200
|
||||||
|
@@ -1884,7 +1884,7 @@
|
||||||
|
fname2 = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
- sprintf(command,"sox \"%s%s.wav\" -r %d -c1 -t wav %s\n",path_source,fname2,samplerate_native, fname_temp);
|
||||||
|
+ sprintf(command,"@sox@ \"%s%s.wav\" -r %d -c1 -t wav %s\n",path_source,fname2,samplerate_native, fname_temp);
|
||||||
|
if(system(command) != 0)
|
||||||
|
{
|
||||||
|
failed = 1;
|
||||||
|
diff -uNr espeakedit-1.48.03.orig/src/readclause.cpp espeakedit-1.48.03/src/readclause.cpp
|
||||||
|
--- espeakedit-1.48.03.orig/src/readclause.cpp 2014-03-04 17:48:11.000000000 +0100
|
||||||
|
+++ espeakedit-1.48.03/src/readclause.cpp 2014-07-22 16:38:37.190440504 +0200
|
||||||
|
@@ -892,7 +892,7 @@
|
||||||
|
if((fd_temp = mkstemp(fname_temp)) >= 0)
|
||||||
|
{
|
||||||
|
close(fd_temp);
|
||||||
|
- sprintf(command,"sox \"%s\" -r %d -c1 -t wav %s\n", fname, samplerate, fname_temp);
|
||||||
|
+ sprintf(command,"@sox@ \"%s\" -r %d -c1 -t wav %s\n", fname, samplerate, fname_temp);
|
||||||
|
if(system(command) == 0)
|
||||||
|
{
|
||||||
|
fname = fname_temp;
|
26
pkgs/applications/audio/espeak/espeakedit-fix-makefile.patch
Normal file
26
pkgs/applications/audio/espeak/espeakedit-fix-makefile.patch
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
Fix broken Makefile:
|
||||||
|
|
||||||
|
* fix syntax error (missing '\' to continue line):
|
||||||
|
Makefile:19: *** recipe commences before first target. Stop.
|
||||||
|
* Get portaudio library flags from pkg-config (to get -Lpath/to/portaudio/lib etc.)
|
||||||
|
|
||||||
|
Author: Bjørn Forsman
|
||||||
|
diff -uNr espeakedit-1.48.03.orig/src/Makefile espeakedit-1.48.03/src/Makefile
|
||||||
|
--- espeakedit-1.48.03.orig/src/Makefile 2013-03-13 15:52:02.000000000 +0100
|
||||||
|
+++ espeakedit-1.48.03/src/Makefile 2014-07-22 15:34:17.524114822 +0200
|
||||||
|
@@ -12,12 +12,11 @@
|
||||||
|
|
||||||
|
WX_LIBS = -pthread `wx-config --libs`
|
||||||
|
|
||||||
|
-LIBS=-lstdc++ -lportaudio
|
||||||
|
+LIBS=-lstdc++ `pkg-config --libs portaudio-2.0`
|
||||||
|
#LIBS=-lstdc++ /usr/lib/x86_64-linux-gnu/libportaudio.so.2
|
||||||
|
|
||||||
|
-CPPFLAGS = -Wall -g -fexceptions `wx-config --cflags`
|
||||||
|
- -I/usr/include/wx-2.8 \
|
||||||
|
- -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
|
||||||
|
+CPPFLAGS = -Wall -g -fexceptions `wx-config --cflags` \
|
||||||
|
+ -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES \
|
||||||
|
-D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -D_ESPEAKEDIT
|
||||||
|
|
||||||
|
CXXFLAGS = -O2 -Wall -fexceptions `wx-config --cflags` \
|
Loading…
Reference in a new issue