File brltty-5.0-speechd.diff of Package brltty.38658

diff -urp brltty-5.3.1.orig/aclocal.m4 brltty-5.3.1/aclocal.m4
--- brltty-5.3.1.orig/aclocal.m4	2015-12-19 14:24:29.000000000 -0600
+++ brltty-5.3.1/aclocal.m4	2025-05-06 19:06:57.710028786 -0500
@@ -521,34 +521,52 @@ BRLTTY_ARG_WITH(
    [where the $1 package is installed],
    [$2_root], ["yes"]
 )
+
+$2_found=false
+m4_define([$2_find], ifelse(m4_eval($# > 4), 1, [true], [false]))
+ifelse($2_find, [true], [BRLTTY_HAVE_PACKAGE([$2], [$1], [$2_found=true]) ])
+
 if test "${$2_root}" = "no"
 then
    $2_root=""
 elif test "${$2_root}" = "yes"
 then
-   $2_root=""
-   roots="/usr /usr/local /usr/local/$1 /usr/local/$2 /opt/$1 /opt/$2 /mingw /mingw/$1 /mingw/$2"
-   for root in ${roots}
-   do
-      if test -f "${root}/$3"
+   "${$2_found}" || {
+      $2_root=""
+      roots="/usr /usr/local /usr/local/$1 /usr/local/$2 /opt/$1 /opt/$2 /mingw /mingw/$1 /mingw/$2"
+
+      for root in ${roots}
+      do
+         test -f "${root}/$3" && {
+            $2_root="${root}"
+            break
+         }
+      done
+
+      if test -z "${$2_root}"
       then
-         $2_root="${root}"
-         break
+         AC_MSG_WARN([$1 package not found: ${roots}])
       fi
-   done
-   if test -z "${$2_root}"
-   then
-      AC_MSG_WARN([$1 package not found: ${roots}])
-   fi
+   }
 fi
+
 AC_SUBST([$2_root])
 BRLTTY_SUMMARY_ITEM([$2-root], [$2_root])
-if test -n "${$2_root}"
-then
+
+test -n "${$2_root}" && {
    AC_DEFINE_UNQUOTED(BRLTTY_UPPERCASE_TRANSLATE([$2_root]), ["${$2_root}"],
                       [Define this to be a string containing the path to the root of the $1 package.])
+
+   ifelse($2_find, [true], [dnl
+      test "${$2_root}" = "yes" || {
+         $2_includes="${$2_root}/$5"
+         $2_libs="${$2_root}/$6 $7"
+      }
+   ])
+
    $4
-fi])
+}
+])
 
 AC_DEFUN([BRLTTY_HAVE_PACKAGE], [dnl
 $1_package=""
diff -urp brltty-5.3.1.orig/config.h.in brltty-5.3.1/config.h.in
--- brltty-5.3.1.orig/config.h.in	2015-12-19 14:24:29.000000000 -0600
+++ brltty-5.3.1/config.h.in	2025-05-06 19:06:57.710318865 -0500
@@ -475,9 +475,6 @@ extern "C" {
 /* Define this to be a string containing the path to the root of the Mikropuhe package. */
 #undef MIKROPUHE_ROOT
 
-/* Define this to be a string containing the path to the root of the SpeechDispatcher package. */
-#undef SPEECHD_ROOT
-
 /* Define this to be a string containing the path to the root of the Swift package. */
 #undef SWIFT_ROOT
 
diff -urp brltty-5.3.1.orig/config.mk.in brltty-5.3.1/config.mk.in
--- brltty-5.3.1.orig/config.mk.in	2015-12-19 14:24:29.000000000 -0600
+++ brltty-5.3.1/config.mk.in	2025-05-06 19:06:57.710554000 -0500
@@ -368,7 +368,8 @@ FLITE_LANGUAGE = @flite_language@
 FLITE_LEXICON = @flite_lexicon@
 FLITE_VOICE = @flite_voice@
 MIKROPUHE_ROOT = @mikropuhe_root@
-SPEECHD_ROOT = @speechd_root@
+SPEECHD_INCLUDES = @speechd_includes@
+SPEECHD_LIBS = @speechd_libs@
 SWIFT_ROOT = @swift_root@
 THETA_ROOT = @theta_root@
 VIAVOICE_ROOT = @viavoice_root@
diff -urp brltty-5.3.1.orig/configure.ac brltty-5.3.1/configure.ac
--- brltty-5.3.1.orig/configure.ac	2015-12-21 11:00:18.000000000 -0600
+++ brltty-5.3.1/configure.ac	2025-05-06 19:09:44.717642491 -0500
@@ -1697,7 +1697,9 @@ BRLTTY_ARG_DISABLE(
    BRLTTY_SPEECH_DRIVER([fv], [Festival])
    BRLTTY_SPEECH_DRIVER([gs], [GenericSay])
    BRLTTY_IF_PACKAGE([Mikropuhe], [mikropuhe], [mpwrfile.h], [BRLTTY_IF_PTHREADS([BRLTTY_SPEECH_DRIVER([mp], [Mikropuhe], [-L$(MPLINUX_ROOT) -lmplinux])])])
-   BRLTTY_IF_PACKAGE([speech-dispatcher], [speechd], [include/libspeechd.h], [BRLTTY_SPEECH_DRIVER([sd], [SpeechDispatcher], [-L$(SPEECHD_ROOT)/lib -lspeechd])])
+   BRLTTY_IF_PACKAGE([speech-dispatcher], [speechd], [include/libspeechd.h], [dnl
+      BRLTTY_SPEECH_DRIVER([sd], [SpeechDispatcher])
+   ], [include], [lib], [speechd])
    BRLTTY_IF_PACKAGE([Swift], [swift], [include/swift.h], [BRLTTY_SPEECH_DRIVER([sw], [Swift], [-L$(SWIFT_ROOT)/lib -lswift -lm])])
    BRLTTY_IF_PACKAGE([Theta], [theta], [include/theta.h], [BRLTTY_SPEECH_DRIVER([th], [Theta], [-L$(THETA_ROOT)/lib -ltheta])])
    BRLTTY_IF_PACKAGE([ViaVoice], [viavoice], [include/eci.h], [BRLTTY_SPEECH_DRIVER([vv], [ViaVoice], [-L$(VIAVOICE_ROOT)/lib -libmeci50])])
diff -urp brltty-5.3.1.orig/Drivers/Speech/SpeechDispatcher/Makefile.in brltty-5.3.1/Drivers/Speech/SpeechDispatcher/Makefile.in
--- brltty-5.3.1.orig/Drivers/Speech/SpeechDispatcher/Makefile.in	2015-12-19 14:24:28.000000000 -0600
+++ brltty-5.3.1/Drivers/Speech/SpeechDispatcher/Makefile.in	2025-05-06 19:08:57.684953755 -0500
@@ -21,9 +21,9 @@ DRIVER_NAME = SpeechDispatcher
 DRIVER_COMMENT = text to speech server
 DRIVER_VERSION = 
 DRIVER_DEVELOPERS = 
-SPK_OBJS = @speech_libraries_sd@
+SPK_OBJS = $(SPEECHD_LIBS)
 include $(SRC_TOP)speech.mk
 
 speech.$O:
-	$(CC) $(SPK_CFLAGS) -I$(SPEECHD_ROOT)/include -c $(SRC_DIR)/speech.c
+	$(CC) $(SPK_CFLAGS) $(SPEECHD_INCLUDES) -c $(SRC_DIR)/speech.c
 
diff -urp brltty-5.3.1.orig/Drivers/Speech/SpeechDispatcher/speech.c brltty-5.3.1/Drivers/Speech/SpeechDispatcher/speech.c
--- brltty-5.3.1.orig/Drivers/Speech/SpeechDispatcher/speech.c	2015-12-19 14:24:28.000000000 -0600
+++ brltty-5.3.1/Drivers/Speech/SpeechDispatcher/speech.c	2025-05-06 19:15:07.771554667 -0500
@@ -34,7 +34,7 @@ typedef enum {
 
 #include "spk_driver.h"
 
-#include <libspeechd.h>
+#include <speech-dispatcher/libspeechd.h>
 
 static SPDConnection *connectionHandle = NULL;
 static const char *moduleName;
openSUSE Build Service is sponsored by