Skip to content

Commit

Permalink
yasr: init at 0.6.9
Browse files Browse the repository at this point in the history
fixes #23188
  • Loading branch information
jhhuh authored and Mic92 committed Mar 12, 2017
1 parent 2d47e1b commit 697838c
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pkgs/applications/audio/yasr/10_fix_openpty_forkpty_declarations
@@ -0,0 +1,25 @@
Disable openpty() and forkpty() prototypes when needed.
--- a/yasr/yasr.h
+++ b/yasr/yasr.h
@@ -308,8 +308,10 @@ extern void opt_set(int num, void *val);
extern void opt_queue_empty(int ll);
extern void opt_write(FILE * fp);

+#ifndef HAVE_OPENPTY
/* openpty.c prototypes */
extern int openpty(int *, int *, char *, struct termios *, struct winsize *);
+#endif

/* cfmakeraw.c prototypes */
extern void cfmakeraw(struct termios *);
@@ -317,8 +319,10 @@ extern void cfmakeraw(struct termios *);
/* login_tty.c prototypes */
extern int login_tty(int);

+#ifndef HAVE_FORKPTY
/* forkpty.c prototypes */
extern int forkpty(int *, char *, struct termios *, struct winsize *);
+#endif

/* tbc - Would it be more efficient to ensure that "blank" grids always held
ascii 0x20 rather than ascii 0x00? */
11 changes: 11 additions & 0 deletions pkgs/applications/audio/yasr/20_maxpathlen
@@ -0,0 +1,11 @@
--- a/yasr/config.c.orig 2011-11-28 03:56:58.764995828 +0100
+++ a/yasr/config.c 2011-11-28 03:57:00.048967703 +0100
@@ -60,7 +60,7 @@
int args, arg[16], *argp;
int i, key, ln = 0, mode = 0;
char *home, *ptr, *s;
- char confname[MAXPATHLEN];
+ char confname[strlen(PACKAGE_DATA_DIR) + 10 + 1];

if ((home = getenv("HOME")) != NULL)
{
18 changes: 18 additions & 0 deletions pkgs/applications/audio/yasr/30_conf
@@ -0,0 +1,18 @@
diff --git a/yasr.conf b/yasr.conf
index 1e07fc6..72f5922 100644
--- a/yasr.conf
+++ b/yasr.conf
@@ -59,11 +59,11 @@ synthesizer=emacspeak server
#synthesizer=speech dispatcher
#synthesizer port=S0
#synthesizer port=l0
-synthesizer port=|/usr/local/bin/eflite
+synthesizer port=|eflite
# Below line appropriate for Speech Dispatcher in its default configuration
#synthesizer port=127.0.0.1:6560
key echo=off
-shell=/bin/bash
+shell=/bin/sh
special=off
up and down arrows=speak line
DisableKey=6925
14 changes: 14 additions & 0 deletions pkgs/applications/audio/yasr/40_dectalk_extended_chars
@@ -0,0 +1,14 @@
Index: yasr-0.6.9/yasr/tts.c
===================================================================
--- yasr-0.6.9.orig/yasr/tts.c 2008-02-03 00:10:07.000000000 +1100
+++ yasr-0.6.9/yasr/tts.c 2012-02-05 10:59:06.059007839 +1100
@@ -281,6 +281,9 @@
char *p = synth[tts.synth].unspeakable;

if (ch < 32) return 1;
+ /* characters with high bit set cause DECTALK to crash */
+ if (tts.synth == TTS_DECTALK && ch & 0x80)
+ return 1;
while (*p)
{
if (*p++ == ch) return 1;
28 changes: 28 additions & 0 deletions pkgs/applications/audio/yasr/default.nix
@@ -0,0 +1,28 @@
{stdenv,fetchurl}:

stdenv.mkDerivation rec {
name = "yasr-${version}";

version = "0.6.9";

src = fetchurl {
url = "https://sourceforge.net/projects/yasr/files/yasr/${version}/${name}.tar.gz";
sha256 = "1prv9r9y6jb5ga5578ldiw507fa414m60xhlvjl29278p3x7rwa1";
};

patches = [
./10_fix_openpty_forkpty_declarations
./20_maxpathlen
./30_conf
./40_dectalk_extended_chars
]; # taken from the debian yasr package

meta = {
homepage = "http://yasr.sourceforge.net";
description = "A general-purpose console screen reader";
longDescription = "Yasr is a general-purpose console screen reader for GNU/Linux and other Unix-like operating systems.";
platforms = stdenv.lib.platforms.unix;
license = stdenv.lib.licenses.gpl2;
maintainers = with stdenv.lib.maintainers; [ jhhuh ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -4626,6 +4626,8 @@ with pkgs;
yaft = callPackage ../applications/misc/yaft { };

yarn = callPackage ../development/tools/yarn { };

yasr = callPackage ../applications/audio/yasr { };

yank = callPackage ../tools/misc/yank { };

Expand Down

0 comments on commit 697838c

Please sign in to comment.