support braille terminal in screen.

This commit is contained in:
espie 2003-11-22 00:57:55 +00:00
parent e724bd1f82
commit 145ef47846
15 changed files with 3425 additions and 0 deletions

28
misc/brltty/Makefile Normal file
View File

@ -0,0 +1,28 @@
# $OpenBSD: Makefile,v 1.1.1.1 2003/11/22 00:57:55 espie Exp $
COMMENT= "access software for a blind person using a braille terminal"
NOT_FOR_ARCHS= ${NO_SHARED_ARCHS}
DISTNAME= brltty-3.3.1
CATEGORIES= misc
MASTER_SITES= http://mielke.cc/brltty/releases/
HOMEPAGE= http://mielke.cc/brltty/
MAINTAINER= Mario Lang <mlang@delysid.org>
# GPL
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
RUN_DEPENDS= :screen-*-shm:misc/screen,shm
USE_GMAKE= Yes
CONFIGURE_STYLE= gnu
CONFIGURE_ARGS= --with-install-root=${WRKINST}
NO_REGRESS= Yes
SEPARATE_BUILD= concurrent
.include <bsd.port.mk>

3
misc/brltty/distinfo Normal file
View File

@ -0,0 +1,3 @@
MD5 (brltty-3.3.1.tar.gz) = b322afdc69c5661d97931f12497ca371
RMD160 (brltty-3.3.1.tar.gz) = 00a3c3b890b334e5cf546e25d678690dad2fbf8f
SHA1 (brltty-3.3.1.tar.gz) = 1755e2b1721007561af80ddaa267e0112af3ce14

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-Documents_brltty_conf,v 1.1.1.1 2003/11/22 00:57:55 espie Exp $
--- Documents/brltty.conf.orig 2003-09-01 16:16:46.000000000 +0200
+++ Documents/brltty.conf 2003-11-17 19:58:24.000000000 +0100
@@ -59,7 +59,8 @@
#braille-device ttyS0 # Primary Linux serial port (old-style).
#braille-device tts/0 # Primary Linux serial port (devfs).
#braille-device ttya # Primary Solaris serial port.
-#braille-device ty0p0 # Primary HP-UX serial port.
+#braille-device tty0p0 # Primary HP-UX serial port.
+#braille-device cua00 # Primary OpenBSD serial port.
#braille-device ttyUSB0 # Primary Linux USB serial converter (old-style).
#braille-device usb/tts/0 # Primary Linux USB serial converter (devfs).
#braille-device brlvger # Primary Linux USB Voyager port (old-style).

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-Programs_Makefile_in,v 1.1.1.1 2003/11/22 00:57:55 espie Exp $
--- Programs/Makefile.in.orig 2003-11-17 20:44:13.000000000 +0100
+++ Programs/Makefile.in 2003-11-17 20:44:45.000000000 +0100
@@ -140,6 +140,9 @@ sys_solaris.o:
sys_hpux.o:
$(CC) $(CFLAGS) -I/opt/audio/include -c $(SRC_DIR)/sys_hpux.c
+sys_openbsd.o:
+ $(CC) $(CFLAGS) -c $(SRC_DIR)/sys_openbsd.c
+
route.o:
$(CC) $(CFLAGS) -c $(SRC_DIR)/route.c

View File

@ -0,0 +1,39 @@
$OpenBSD: patch-Programs_api_client_c,v 1.1.1.1 2003/11/22 00:57:55 espie Exp $
--- Programs/api_client.c.orig 2003-09-01 16:16:41.000000000 +0200
+++ Programs/api_client.c 2003-11-17 20:04:03.000000000 +0100
@@ -25,10 +25,10 @@
#include <unistd.h>
#include <stdio.h>
#include <stddef.h>
+#include <string.h>
#include <inttypes.h>
#include <fcntl.h>
#include <errno.h>
-#include <alloca.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/stat.h>
@@ -39,12 +39,21 @@
#include <pthread.h>
#include <syslog.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif /* HAVE_ALLOCA_H */
+
#include "brlapi.h"
#include "api_common.h"
/* macros */
-#define MIN(a, b) (((a) < (b))? (a): (b))
-#define MAX(a, b) (((a) > (b))? (a): (b))
+#ifndef MIN
+#define MIN(a, b) (((a) < (b))? (a): (b))
+#endif
+
+#ifndef MAX
+#define MAX(a, b) (((a) > (b))? (a): (b))
+#endif
/* for remembering getaddrinfo error code */
static int gai_error;

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-Programs_brlapi_h_in,v 1.1.1.1 2003/11/22 00:57:55 espie Exp $
--- Programs/brlapi.h.in.orig 2003-09-01 16:16:43.000000000 +0200
+++ Programs/brlapi.h.in 2003-11-17 19:58:24.000000000 +0100
@@ -31,6 +31,10 @@ extern "C" {
/* this is for UINT32_MAX */
#include <inttypes.h>
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif /* UINT32_MAX */
+
/* The type size_t is defined there! */
#include <unistd.h>

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-Programs_reldeps_mk,v 1.1.1.1 2003/11/22 00:57:55 espie Exp $
--- Programs/reldeps.mk.orig 2003-09-01 16:25:50.000000000 +0200
+++ Programs/reldeps.mk 2003-11-17 19:58:24.000000000 +0100
@@ -262,6 +262,12 @@ sys_linux.o: $(BLD_TOP)config.h
sys_linux.o: $(SRC_DIR)/misc.h
sys_linux.o: $(SRC_DIR)/system.h
+# Dependencies for sys_openbsd.o:
+sys_openbsd.o: $(SRC_DIR)/sys_openbsd.c
+sys_openbsd.o: $(BLD_TOP)config.h
+sys_openbsd.o: $(SRC_DIR)/misc.h
+sys_openbsd.o: $(SRC_DIR)/system.h
+
# Dependencies for sys_solaris.o:
sys_solaris.o: $(SRC_DIR)/sys_solaris.c
sys_solaris.o: $(BLD_TOP)config.h

View File

@ -0,0 +1,249 @@
$OpenBSD: patch-Programs_sys_openbsd_c,v 1.1.1.1 2003/11/22 00:57:55 espie Exp $
--- Programs/sys_openbsd.c.orig 2003-11-17 19:58:24.000000000 +0100
+++ Programs/sys_openbsd.c 2003-11-17 19:58:24.000000000 +0100
@@ -0,0 +1,245 @@
+/*
+ * BRLTTY - A background process providing access to the Linux console (when in
+ * text mode) for a blind person using a refreshable braille display.
+ *
+ * Copyright (C) 1995-2003 by The BRLTTY Team. All rights reserved.
+ *
+ * BRLTTY comes with ABSOLUTELY NO WARRANTY.
+ *
+ * This is free software, placed under the terms of the
+ * GNU General Public License, as published by the Free Software
+ * Foundation. Please see the file COPYING for details.
+ *
+ * Web Page: http://mielke.cc/brltty/
+ *
+ * This software is maintained by Dave Mielke <dave@mielke.cc>.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/audioio.h>
+#include <sys/time.h>
+#include <dev/wscons/wsconsio.h>
+
+#ifdef HAVE_FUNC_DLOPEN
+# include <dlfcn.h>
+#endif /* HAVE_FUNC_DLOPEN */
+
+#include "misc.h"
+#include "system.h"
+
+char *
+getBootParameters (void) {
+ return NULL;
+}
+
+void *
+loadSharedObject (const char *path) {
+#ifdef HAVE_FUNC_DLOPEN
+ void *object = dlopen(path, DL_LAZY);
+ if (object) return object;
+ LogPrint(LOG_ERR, "%s", dlerror());
+#endif /* HAVE_FUNC_DLOPEN */
+ return NULL;
+}
+
+void
+unloadSharedObject (void *object) {
+#ifdef HAVE_FUNC_DLOPEN
+ dlclose(object);
+#endif /* HAVE_FUNC_DLOPEN */
+}
+
+int
+findSharedSymbol (void *object, const char *symbol, const void **address) {
+#ifdef HAVE_FUNC_DLOPEN
+ const char *error;
+ *address = dlsym(object, symbol);
+ if (!(error = dlerror())) return 1;
+ LogPrint(LOG_ERR, "%s", error);
+#endif /* HAVE_FUNC_DLOPEN */
+ return 0;
+}
+
+int
+canBeep (void) {
+ return 1;
+}
+
+int
+timedBeep (unsigned short frequency, unsigned short milliseconds) {
+ int console = getConsole();
+ if (console != -1) {
+ struct wskbd_bell_data bell;
+ bell.which = WSKBD_BELL_DOALL;
+ bell.pitch = frequency;
+ bell.period = milliseconds;
+ bell.volume = 100;
+ if (!bell.period) {
+ return 1;
+ } else if (ioctl(console, WSKBDIO_COMPLEXBELL, &bell) != -1) {
+ return 1;
+ } else {
+ LogPrint(LOG_WARNING, "ioctl WSKBDIO_COMPLEXBELL failed: %s", strerror(errno));
+ }
+ }
+ return 0;
+}
+
+int
+startBeep (unsigned short frequency) {
+ return 0;
+}
+
+int
+stopBeep (void) {
+ int console = getConsole();
+ if (console != -1) {
+ struct wskbd_bell_data bell;
+ bell.which = WSKBD_BELL_DOVOLUME | WSKBD_BELL_DOPERIOD;
+ bell.volume = 0;
+ bell.period = 0;
+ if (ioctl(console, WSKBDIO_COMPLEXBELL, &bell) != -1) {
+ return 1;
+ } else {
+ LogPrint(LOG_WARNING, "ioctl WSKBDIO_COMPLEXBELL failed: %s", strerror(errno));
+ }
+ }
+ return 0;
+}
+
+#ifdef ENABLE_PCM_TUNES
+int
+getPcmDevice (int errorLevel) {
+ int descriptor;
+ const char *path = getenv("AUDIODEV");
+ if (!path) path = "/dev/audio";
+ if ((descriptor = open(path, O_WRONLY|O_NONBLOCK)) != -1) {
+ audio_info_t info;
+ AUDIO_INITINFO(&info);
+ info.mode = AUMODE_PLAY;
+ info.play.encoding = AUDIO_ENCODING_SLINEAR;
+ info.play.sample_rate = 16000;
+ info.play.channels = 1;
+ info.play.precision = 16;
+ info.play.gain = AUDIO_MAX_GAIN;
+ if (ioctl(descriptor, AUDIO_SETINFO, &info) == -1)
+ LogPrint(LOG_WARNING, "ioctl AUDIO_SETINFO failed: %s", strerror(errno));
+ } else {
+ LogPrint(errorLevel, "Cannot open PCM device: %s: %s", path, strerror(errno));
+ }
+ return descriptor;
+}
+
+int
+getPcmBlockSize (int descriptor) {
+ if (descriptor != -1) {
+ audio_info_t info;
+ if (ioctl(descriptor, AUDIO_GETINFO, &info) != -1) return info.play.buffer_size;
+ }
+ return 0X100;
+}
+
+int
+getPcmSampleRate (int descriptor) {
+ if (descriptor != -1) {
+ audio_info_t info;
+ if (ioctl(descriptor, AUDIO_GETINFO, &info) != -1) return info.play.sample_rate;
+ }
+ return 8000;
+}
+
+int
+getPcmChannelCount (int descriptor) {
+ if (descriptor != -1) {
+ audio_info_t info;
+ if (ioctl(descriptor, AUDIO_GETINFO, &info) != -1) return info.play.channels;
+ }
+ return 1;
+}
+
+PcmAmplitudeFormat
+getPcmAmplitudeFormat (int descriptor) {
+ if (descriptor != -1) {
+ audio_info_t info;
+ if (ioctl(descriptor, AUDIO_GETINFO, &info) != -1) {
+ switch (info.play.encoding) {
+ default:
+ break;
+ case AUDIO_ENCODING_SLINEAR_BE:
+ if (info.play.precision == 8) return PCM_FMT_S8;
+ if (info.play.precision == 16) return PCM_FMT_S16B;
+ break;
+ case AUDIO_ENCODING_SLINEAR_LE:
+ if (info.play.precision == 8) return PCM_FMT_S8;
+ if (info.play.precision == 16) return PCM_FMT_S16L;
+ break;
+ case AUDIO_ENCODING_ULAW:
+ return PCM_FMT_ULAW;
+ case AUDIO_ENCODING_LINEAR8:
+ return PCM_FMT_U8;
+ }
+ }
+ }
+ return PCM_FMT_UNKNOWN;
+}
+#endif /* ENABLE_PCM_TUNES */
+
+#ifdef ENABLE_MIDI_TUNES
+int
+getMidiDevice (int errorLevel, MidiBufferFlusher flushBuffer) {
+ LogPrint(errorLevel, "MIDI device not supported.");
+ return -1;
+}
+
+void
+setMidiInstrument (unsigned char channel, unsigned char instrument) {
+}
+
+void
+beginMidiBlock (int descriptor) {
+}
+
+void
+endMidiBlock (int descriptor) {
+}
+
+void
+startMidiNote (unsigned char channel, unsigned char note, unsigned char volume) {
+}
+
+void
+stopMidiNote (unsigned char channel) {
+}
+
+void
+insertMidiWait (int duration) {
+}
+#endif /* ENABLE_MIDI_TUNES */
+
+int
+enablePorts (int errorLevel, unsigned short int base, unsigned short int count) {
+ LogPrint(errorLevel, "I/O ports not supported.");
+ return 0;
+}
+
+int
+disablePorts (unsigned short int base, unsigned short int count) {
+ return 0;
+}
+
+unsigned char
+readPort1 (unsigned short int port) {
+ return 0;
+}
+
+void
+writePort1 (unsigned short int port, unsigned char value) {
+}

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-README,v 1.1.1.1 2003/11/22 00:57:55 espie Exp $
--- README.orig 2003-09-01 16:16:45.000000000 +0200
+++ README 2003-11-17 19:58:24.000000000 +0100
@@ -114,6 +114,7 @@ BRLTTY has been tested on:
* all major Linux distributions (including Red Hat, Debian, Slackware, SuSE)
* Solaris/Sparc (release 7 and beyond)
* Solaris/Intel (release 9 and beyond)
+* OpenBSD/Intel (release 3.4 and beyond)
The following Braille displays are supported (serial communication only for
most of them):

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-absdeps_mk,v 1.1.1.1 2003/11/22 00:57:55 espie Exp $
--- absdeps.mk.orig 2003-09-01 16:25:50.000000000 +0200
+++ absdeps.mk 2003-11-17 19:58:24.000000000 +0100
@@ -691,6 +691,13 @@ $(BLD_TOP)Programs/sys_linux.o: $(SRC_TO
$(BLD_TOP)Programs/sys_linux.o: $(SRC_TOP)Programs/system.h
cd $(@D) && $(MAKE) $(@F)
+# Dependencies for Programs/sys_openbsd.o:
+$(BLD_TOP)Programs/sys_openbsd.o: $(SRC_TOP)Programs/sys_openbsd.c
+$(BLD_TOP)Programs/sys_openbsd.o: $(BLD_TOP)config.h
+$(BLD_TOP)Programs/sys_openbsd.o: $(SRC_TOP)Programs/misc.h
+$(BLD_TOP)Programs/sys_openbsd.o: $(SRC_TOP)Programs/system.h
+ cd $(@D) && $(MAKE) $(@F)
+
# Dependencies for Programs/sys_solaris.o:
$(BLD_TOP)Programs/sys_solaris.o: $(SRC_TOP)Programs/sys_solaris.c
$(BLD_TOP)Programs/sys_solaris.o: $(BLD_TOP)config.h

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-config_h_in,v 1.1.1.1 2003/11/22 00:57:55 espie Exp $
--- config.h.in.orig 2003-09-01 16:16:46.000000000 +0200
+++ config.h.in 2003-11-17 19:58:24.000000000 +0100
@@ -37,6 +37,9 @@ extern "C" {
/* Define this if the function vsyslog exists. */
#undef HAVE_VSYSLOG
+/* Define this if the header file alloca.h exists. */
+#undef HAVE_ALLOCA_H
+
/* Define this if the header file sys/io.h exists. */
#undef HAVE_SYS_IO_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,71 @@
$OpenBSD: patch-configure_in,v 1.1.1.1 2003/11/22 00:57:56 espie Exp $
--- configure.in.orig 2003-09-01 16:16:33.000000000 +0200
+++ configure.in 2003-11-17 19:58:25.000000000 +0100
@@ -192,7 +192,7 @@ then
else
case "${host_os}"
in
- linux*)
+ linux*|openbsd*)
brltty_cv_prog_mklib="\$(LD) -shared -soname SONAME -o"
;;
solaris*)
@@ -222,7 +222,7 @@ AC_SUBST([CONFLIBDIR], ["${brltty_cv_pro
AC_CHECK_HEADERS([getopt.h syslog.h])
AC_CHECK_FUNCS([vsyslog])
-AC_CHECK_HEADERS([sys/io.h linux/vt.h])
+AC_CHECK_HEADERS([alloca.h sys/io.h linux/vt.h])
AC_C_CONST
AC_C_INLINE
@@ -341,6 +341,9 @@ in
AC_DEFINE([HAVE_HPUX_AUDIO])
fi
;;
+ openbsd*)
+ system_object="openbsd"
+ ;;
*)
AC_MSG_ERROR([no system object available for ${host_os}])
;;
@@ -446,7 +449,7 @@ BRLTTY_DEFINE_EXPANDED([BRLAPI_AUTHFILE]
AC_CACHE_CHECK([for linkage editor flags], [brltty_cv_prog_ld_flags], [dnl
case "${host_os}"
in
- linux*)
+ linux*|openbsd*)
brltty_cv_prog_ld_flags="-export-dynamic -rpath ${execute_root}${library_directory}"
;;
solaris*)
@@ -464,7 +467,7 @@ brltty_link_flags="${brltty_cv_prog_ld_f
AC_CACHE_CHECK([for static linkage flag], [brltty_cv_prog_ld_static], [dnl
case "${host_os}"
in
- linux*)
+ linux*|openbsd*)
brltty_cv_prog_ld_static="-static"
;;
solaris*)
@@ -496,10 +499,7 @@ BRLTTY_SEARCH_LIBS([sin], [m])
BRLTTY_SEARCH_LIBS([pow], [m])
case "${host_os}"
in
- linux*)
- BRLTTY_SEARCH_LIBS([dlopen], [dl])
- ;;
- solaris*)
+ linux*|solaris*|openbsd*)
BRLTTY_SEARCH_LIBS([dlopen], [dl])
;;
hpux*)
@@ -548,6 +548,9 @@ in
hpux*)
brltty_cv_default_braille_device="/dev/tty0p0"
;;
+ openbsd*)
+ brltty_cv_default_braille_device="/dev/cua00"
+ ;;
*)
brltty_cv_default_braille_device=""
AC_MSG_WARN([no default braille device])

5
misc/brltty/pkg/DESCR Normal file
View File

@ -0,0 +1,5 @@
BRLTTy is an access program for a blind person using a refreshable braille
display.
This port allows using BRLTTy in conjunction with a version of screen,
communicating using shared memory.

69
misc/brltty/pkg/PLIST Normal file
View File

@ -0,0 +1,69 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2003/11/22 00:57:55 espie Exp $
bin/brltty
bin/brltty-install
lib/brltty/brltty-brl.lst
lib/brltty/brltty-spk.lst
lib/brltty/libbrlttybal.so
lib/brltty/libbrlttybbl.so
lib/brltty/libbrlttybbn.so
lib/brltty/libbrlttybcb.so
lib/brltty/libbrlttybec.so
lib/brltty/libbrlttybeu.so
lib/brltty/libbrlttybht.so
lib/brltty/libbrlttyblt.so
lib/brltty/libbrlttybmb.so
lib/brltty/libbrlttybmd.so
lib/brltty/libbrlttybmn.so
lib/brltty/libbrlttybpm.so
lib/brltty/libbrlttybts.so
lib/brltty/libbrlttybva.so
lib/brltty/libbrlttybvd.so
lib/brltty/libbrlttybvh.so
lib/brltty/libbrlttybvs.so
lib/brltty/libbrlttysal.so
lib/brltty/libbrlttysbl.so
lib/brltty/libbrlttyscb.so
lib/brltty/libbrlttyses.so
lib/brltty/libbrlttysfv.so
lib/brltty/libbrlttysgs.so
lib/brltty/libbrlttystv.so
man/man1/brltty.1
man/man3/brlapi_closeConnection.3
man/man3/brlapi_connection.3
man/man3/brlapi_errlist.3
man/man3/brlapi_errno.3
man/man3/brlapi_errno_location.3
man/man3/brlapi_error.3
man/man3/brlapi_fd_mutex.3
man/man3/brlapi_getControllingTty.3
man/man3/brlapi_getDisplaySize.3
man/man3/brlapi_getDriverId.3
man/man3/brlapi_getDriverName.3
man/man3/brlapi_getRaw.3
man/man3/brlapi_getTty.3
man/man3/brlapi_ignoreKeys.3
man/man3/brlapi_info.3
man/man3/brlapi_initializeConnection.3
man/man3/brlapi_keybinding_t.3
man/man3/brlapi_keys.3
man/man3/brlapi_leaveRaw.3
man/man3/brlapi_leaveTty.3
man/man3/brlapi_loadAuthKey.3
man/man3/brlapi_nerr.3
man/man3/brlapi_perror.3
man/man3/brlapi_protocol.3
man/man3/brlapi_raw.3
man/man3/brlapi_readBinding.3
man/man3/brlapi_readCommand.3
man/man3/brlapi_readKey.3
man/man3/brlapi_readPacket.3
man/man3/brlapi_recvRaw.3
man/man3/brlapi_sendRaw.3
man/man3/brlapi_settings_t.3
man/man3/brlapi_tty.3
man/man3/brlapi_unignoreKeys.3
man/man3/brlapi_write.3
man/man3/brlapi_writeBrl.3
man/man3/brlapi_writeBrlDots.3
man/man3/brlapi_writePacket.3
@dirrm lib/brltty