diff options
author | rubicon <5662-rubicon@users.gitlab.alpinelinux.org> | 2022-05-05 15:19:21 +0800 |
---|---|---|
committer | alice <alice@ayaya.dev> | 2022-05-06 14:35:37 +0000 |
commit | bee59051f0cc1c8ea71b0c22bf39fc81b9ae723f (patch) | |
tree | b38e963fff2b5246a426747a6eeb565d0290cd51 /testing/emacspeak | |
parent | 2bf7b052fbd14af8f3b30da120e3181c684f1b60 (diff) | |
download | aports-bee59051f0cc1c8ea71b0c22bf39fc81b9ae723f.zip |
testing/emacspeak: new aport
Diffstat (limited to 'testing/emacspeak')
-rw-r--r-- | testing/emacspeak/APKBUILD | 131 | ||||
-rw-r--r-- | testing/emacspeak/directories.patch | 79 | ||||
-rwxr-xr-x | testing/emacspeak/emacspeak | 28 | ||||
-rw-r--r-- | testing/emacspeak/fix-tclespeak-path.patch | 13 | ||||
-rw-r--r-- | testing/emacspeak/rebuild-pickup-c.patch | 12 | ||||
-rw-r--r-- | testing/emacspeak/remote-espeak-server.patch | 39 |
6 files changed, 302 insertions, 0 deletions
diff --git a/testing/emacspeak/APKBUILD b/testing/emacspeak/APKBUILD new file mode 100644 index 00000000000..fa36d94fbb2 --- /dev/null +++ b/testing/emacspeak/APKBUILD @@ -0,0 +1,131 @@ +# Contributor: rubicon <rubicon@mailo.com> +# Maintainer: rubicon <rubicon@mailo.com> +pkgname=emacspeak +pkgver=56.0 +pkgrel=0 +pkgdesc="Emacs audio desktop for eyes-free computing" +url="http://emacspeak.sourceforge.net/" +arch="all" +license="GPL-2.0-or-later" +depends="cmd:emacs $pkgname-sounds" +depends_doc="texinfo-doc emacs-doc" +makedepends="emacs-nox" +options="!check" +subpackages=" + $pkgname-sounds:ems_sounds:noarch + $pkgname-doc + $pkgname-misc:ems_misc:noarch + " +source="https://github.com/tvraman/emacspeak/releases/download/$pkgver/emacspeak-$pkgver.tar.bz2 + rebuild-pickup-c.patch + fix-tclespeak-path.patch + remote-espeak-server.patch + directories.patch + emacspeak + " + +# espeak-ng is not available on s390x, so use the eflite speech server instead +if [ "$CARCH" = "s390x" ]; then + depends="$depends $pkgname-server-eflite" +else + depends="$depends $pkgname-server-espeak" + makedepends="$makedepends espeak-ng-dev tcl-dev" + subpackages="$subpackages $pkgname-server-espeak:ems_espeak" +fi + +_emsdir=usr/share/emacs/site-lisp/"$pkgname" + +build() { + make config + make + make -C etc/pickup-c + if [ "$CARCH" != "s390x" ]; then + make espeak + fi +} + +package() { + local emspkgdir="$pkgdir"/"$_emsdir" + local docdir="$pkgdir"/usr/share/doc/"$pkgname" + local infodir="$pkgdir"/usr/share/info/"$pkgname" + + mkdir -vp "$(dirname $emspkgdir)" + cp -a "$builddir" "$emspkgdir" + cd "$emspkgdir" + + # clean unneeded files + find . -type f \( \ + -name Makefile -o \ + -name .nosearch -o \ + -name '.*spell*' \) \ + -delete + rm -vr servers/linux-outloud + rm -v .*ignore README run \ + runq etc/pickup-c/pickup.o + + # fix ownerships and permissions + chown -Rf root:root . + chmod 755 . + + # move documentation + mkdir -vp "$docdir" + mv -v README.md etc/COPYRIGHT etc/NEWS* \ + etc/applications.* etc/tips.* \ + blog-archive attic-readme \ + lisp/elpa-readme \ + "$docdir" + mkdir -vp "$(dirname $infodir)" + rm -v info/tips.html + mv -v info "$infodir" + + install -vDm 755 \ + "$srcdir"/emacspeak \ + -t "$pkgdir"/usr/bin +} + +ems_espeak() { + pkgdesc="$pkgdesc (espeak-ng speech server)" + depends="tclx" + install_if="emacspeak espeak-ng" + local servdir="$_emsdir"/servers + + install -vDm 755 \ + "$pkgdir"/"$servdir"/native-espeak/tclespeak.so \ + -t "$subpkgdir"/usr/lib/"$pkgname" + + # move supported speech servers + amove "$servdir"/tts-lib.tcl \ + "$servdir"/espeak \ + "$servdir"/ssh-espeak \ + "$servdir"/speech-server \ + "$servdir"/cloud-espeak \ + "$servdir"/cloud-notify + # remove all others + rm -vrf "$servdir" +} + +ems_sounds() { + pkgdesc="$pkgdesc (auditory icons / sound cues)" + depends="$pkgname" + amove "$_emsdir"/sounds +} + +ems_misc() { + pkgdesc="$pkgdesc (miscellaneous files & helper scripts)" + depends="$pkgname" + amove "$_emsdir"/bash-utils \ + "$_emsdir"/js \ + "$_emsdir"/nyxttalk \ + "$_emsdir"/xsl \ + "$_emsdir"/stumpwm \ + "$_emsdir"/media +} + +sha512sums=" +9b18fada991b914ddd3ed30950e685c1c164434536c3dd119b9ed52db80e7e31b7399c72a584938bfb63daa7e1aa76a1f377d664cc1118ffa7f0a4cbdddf0818 emacspeak-56.0.tar.bz2 +c619611ee7ef4c59e6f797a010f126d870a7dff1dc6d4109c16519637b6d6ee733879e9fb6080103abe3bb33a8156846ee09a00749d26bfaa5400dd9dc4cc527 rebuild-pickup-c.patch +abc9182d7d53b0df859c6d345ebc8a192e16aefbc318a85bcef903ee62586afdd0f11a75a90da62356c7fdbadcbc10ee268f5575d64f037971cf082db1d6b314 fix-tclespeak-path.patch +e1557a40e15c364c03d760ea9711c7015b3f127f5e3c17fc7ca6eca4a08c3ef4e0f14cad1f3cc67b05af581f1477de7a773fc9741fab1218346082eefe0594ce remote-espeak-server.patch +e9fe798589a685bdebae168b2d50d738562e152d50795b6d7533152e553a410ca64854ca8298d25fba29dc803793456a5d15457aa2299c246ed5e8529ed924c0 directories.patch +a04a5f015a72c0ef453d3dd6b459fea4a339ad3a64276c66e7bd945b059e68f965a0fdf1d3f078b94bdf1345c5ca6a8bcb46419bb1b8ee56894ac63e0c25efb3 emacspeak +" diff --git a/testing/emacspeak/directories.patch b/testing/emacspeak/directories.patch new file mode 100644 index 00000000000..b6063e1cf58 --- /dev/null +++ b/testing/emacspeak/directories.patch @@ -0,0 +1,79 @@ +--- a/lisp/emacspeak-preamble.el ++++ b/lisp/emacspeak-preamble.el +@@ -53,7 +53,7 @@ + + ;;;###autoload + (defvar emacspeak-directory +- (expand-file-name "../" (file-name-directory load-file-name)) ++ (file-name-as-directory "/usr/share/emacs/site-lisp/emacspeak/") + "emacspeak directory") + + ;;;###autoload +@@ -83,15 +83,20 @@ + + ;;;###autoload + (defvar emacspeak-info-directory +- (expand-file-name "info/" emacspeak-directory) ++ (file-name-as-directory "/usr/share/info/emacspeak/") + "Info") + + ;;;###autoload ++(defvar emacspeak-doc-directory ++ (file-name-as-directory "/usr/share/doc/emacspeak/") ++ "Documentation") ++ ++;;;###autoload + (defvar emacspeak-user-directory (expand-file-name "~/.emacspeak/") + "Resources.") + + (defvar emacspeak-readme-file +- (expand-file-name "README" emacspeak-directory) ++ (expand-file-name "README.md" emacspeak-doc-directory) + "README.") + + ;;;###autoload +--- a/lisp/emacspeak-wizards.el ++++ b/lisp/emacspeak-wizards.el +@@ -120,12 +120,12 @@ + (defun emacspeak-view-emacspeak-news () + "Display emacspeak News for a given version." + (interactive) +- (cl-declare (special emacspeak-etc-directory)) ++ (cl-declare (special emacspeak-doc-directory)) + (find-file-read-only + (expand-file-name + (completing-read "News: " +- (directory-files emacspeak-etc-directory nil "NEWS*")) +- emacspeak-etc-directory)) ++ (directory-files emacspeak-doc-directory nil "NEWS*")) ++ emacspeak-doc-directory)) + (emacspeak-auditory-icon 'news) + (org-mode) + (org-next-visible-heading 1) +@@ -134,11 +134,11 @@ + (defun emacspeak-view-emacspeak-tips () + "Browse Emacspeak productivity tips." + (interactive) +- (cl-declare (special emacspeak-etc-directory)) ++ (cl-declare (special emacspeak-doc-directory)) + (emacspeak-xslt-without-xsl + (browse-url + (format "file:///%stips.html" +- emacspeak-etc-directory))) ++ emacspeak-doc-directory))) + (emacspeak-auditory-icon 'help) + (emacspeak-speak-mode-line)) + +--- a/lisp/emacspeak.el ++++ b/lisp/emacspeak.el +@@ -293,8 +293,8 @@ + (cl-declare (special emacspeak-packages-to-prepare)) + (setq-default line-move-visual nil) + (setq use-dialog-box nil) +- (when (boundp 'Info-directory-list) +- (push emacspeak-info-directory Info-directory-list)) ++ (when (boundp 'Info-default-directory-list) ++ (push emacspeak-info-directory Info-default-directory-list)) + (mapc + #'(lambda (pair) + (emacspeak-do-package-setup (cl-first pair) (cl-second pair))) diff --git a/testing/emacspeak/emacspeak b/testing/emacspeak/emacspeak new file mode 100755 index 00000000000..5eadeb86581 --- /dev/null +++ b/testing/emacspeak/emacspeak @@ -0,0 +1,28 @@ +#!/bin/sh + +EMS_DIR=/usr/share/emacs/site-lisp/emacspeak + +if [ -x "$DTK_PROGRAM" ]; then + echo "Using $DTK_PROGRAM as Emacspeak speech server" +elif [ -n "$DTK_PROGRAM" ] && [ -x "$EMS_DIR/servers/$DTK_PROGRAM" ]; then + echo "Using $EMS_DIR/servers/$DTK_PROGRAM as Emacspeak speech server" +elif [ -r /usr/lib/emacspeak/tclespeak.so ] && [ -x "$EMS_DIR"/servers/espeak ]; then + DTK_PROGRAM="espeak" +elif [ -x "$EMS_DIR"/servers/eflite ]; then + DTK_PROGRAM="eflite" +else + echo "Emacspeak speech server is not installed." + echo "Please install it with this command:" + echo " apk add emacspeak-server-espeak" + echo " OR" + echo " apk add emacspeak-server-eflite" + exit 1 +fi + +export DTK_PROGRAM + +if [ -r "$HOME"/.emacs.d/init.el ]; then + exec emacs -q -l "$EMS_DIR"/lisp/emacspeak-setup.elc -l "$HOME"/.emacs.d/init.el "$@" +else + exec emacs -q -l "$EMS_DIR"/lisp/emacspeak-setup.elc "$@" +fi diff --git a/testing/emacspeak/fix-tclespeak-path.patch b/testing/emacspeak/fix-tclespeak-path.patch new file mode 100644 index 00000000000..3cf6617da5c --- /dev/null +++ b/testing/emacspeak/fix-tclespeak-path.patch @@ -0,0 +1,13 @@ +--- a/servers/espeak ++++ b/servers/espeak +@@ -509,9 +509,7 @@ + if {[info exists server_p]} { + set tts(input) sock0 + } +-set servers [file normalize [file dirname $argv0]] +-set tclTTS $servers/native-espeak +-load $tclTTS/tclespeak[info sharedlibextension] ++load /usr/lib/emacspeak/tclespeak.so + if {[file exists /proc/asound]} { + set tts(play) "/usr/bin/aplay -q" + } elseif {[info exists ::env(PULSE_SERVER)] && [file exists /usr/bin/paplay]} { diff --git a/testing/emacspeak/rebuild-pickup-c.patch b/testing/emacspeak/rebuild-pickup-c.patch new file mode 100644 index 00000000000..3c626c9b29c --- /dev/null +++ b/testing/emacspeak/rebuild-pickup-c.patch @@ -0,0 +1,12 @@ +--- a/etc/pickup-c/Makefile ++++ b/etc/pickup-c/Makefile +@@ -1,3 +1,8 @@ +-pickup: pickup.c ++CFLAGS +="-std=c11" ++pickup : pickup.o ++ gcc $(LDFLAGS) -o pickup pickup.o ++pickup.o : pickup.c ++ gcc $(CFLAGS) -c pickup.c ++ + tidy: pickup.c + clang-tidy -header-filter=.*-checks='*' -fix-errors pickup.c -- -std=c11 diff --git a/testing/emacspeak/remote-espeak-server.patch b/testing/emacspeak/remote-espeak-server.patch new file mode 100644 index 00000000000..a9b9da95a03 --- /dev/null +++ b/testing/emacspeak/remote-espeak-server.patch @@ -0,0 +1,39 @@ +--- a/bash-utils/remote ++++ b/bash-utils/remote +@@ -39,10 +39,10 @@ + + #setup tts, but dont ssh. + #use when we need to restart server +-# hard-wire speech-server and outloud; $remote not used ++# hard-wire speech-server and espeak; $remote not used + function rtts () { + SERVER=speech-server +- ENGINE=outloud ++ ENGINE=espeak + $SDIR/$SERVER 2222 $SDIR/$ENGINE & + #notification stream listens on 3333 + (export ALSA_DEFAULT="tts_mono_left"; $SDIR/$SERVER 3333 $SDIR/$ENGINE &) +--- a/etc/remote-tts-setup ++++ b/etc/remote-tts-setup +@@ -13,8 +13,8 @@ + + SDIR=$EMACSPEAK/servers + # Primary server listens on 2222 +-$SDIR/speech-server 2222 $SDIR/outloud & ++$SDIR/speech-server 2222 $SDIR/espeak & + #notification stream listens on 3333 +-(export ALSA_DEFAULT="tts_mono_left"; $SDIR/speech-server 3333 $SDIR/outloud &) ++(export ALSA_DEFAULT="tts_mono_left"; $SDIR/speech-server 3333 $SDIR/espeak &) + beep -f 800 -l 50 + ssh-agent ssh -R 2222:localhost:2222 -R 3333:localhost:3333 $REMOTE +--- a/servers/ssh-espeak ++++ b/servers/ssh-espeak +@@ -32,7 +32,7 @@ + set user [lindex $user_host 0] + set host [lindex $user_host 1] + if {$user == ""} {set user env($USER)} +-set tcl /usr/bin/tcl ++set tcl /usr/bin/tclsh + regsub {/ssh-} $argv0 {/} tts + puts stderr "Running <ssh $host -l $user -p $port $tcl $tts>" + exec ssh -o StrictHostKeyChecking=no $host \ |