Skip to contentSkip to conversation

brltty: new package

PATCH New Mario Lang 2 participants 6 messages Nov 16, 2017

lore
Share & tools
lore

Mario Lang

author
#0 lore raw

PATCH 1/2 brltty: new package

A daemon providing access to the Linux console for a blind person using a refreshable braille display.

---
 package/Config.in             |  1 +
 package/brltty/Config.in      | 14 ++++++++++++++
 package/brltty/S10brltty      | 40 ++++++++++++++++++++++++++++++++++++++++
 package/brltty/brltty.hash    |  3 +++
 package/brltty/brltty.mk      | 39 +++++++++++++++++++++++++++++++++++++++
 package/brltty/brltty.service | 23 +++++++++++++++++++++++
 6 files changed, 120 insertions(+)
 create mode 100644 package/brltty/Config.in
 create mode 100644 package/brltty/S10brltty
 create mode 100644 package/brltty/brltty.hash
 create mode 100644 package/brltty/brltty.mk
 create mode 100644 package/brltty/brltty.service
package/Config.in +1 -0
index fe5ccc434e..83f639d4be 100644
@@ -380,6 +380,7 @@ endmenu
 	source "package/avrdude/Config.in"
 	source "package/bcache-tools/Config.in"
 	source "package/biosdevname/Config.in"
+	source "package/brltty/Config.in"
 	source "package/cbootimage/Config.in"
 	source "package/cc-tool/Config.in"
 	source "package/cdrkit/Config.in"
package/brltty/Config.in new file +14 -0
new file mode 100644
index 0000000000..03a0c635f0
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_BRLTTY
+	bool "brltty"
+	depends on BR2_USE_WCHAR
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  A daemon providing access to the Linux console
+	  for a blind person using a refreshable braille display.
+
+	  http://brltty.com/
+
+comment "brltty needs a toolchain w/ threads, wchar"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_USE_WCHAR
+
package/brltty/S10brltty new file +40 -0
new file mode 100644
index 0000000000..8772a82350
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# brltty        Starts brltty.
+#
+
+start() {
+	printf "Starting brltty: "
+	start-stop-daemon -S -q -p /var/run/brltty.pid \
+		--exec /usr/bin/brltty -- -P /var/run/brltty.pid -q "$@"
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+stop() {
+	printf "Stopping brltty: "
+	start-stop-daemon -K -q -p /var/run/brltty.pid
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+restart() {
+	stop
+	start "$@"
+}
+
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart|reload)
+	restart
+	;;
+  force-reload)
+	restart
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart|force-reload}"
+	exit 1
+esac
+
+exit $?
package/brltty/brltty.hash new file +3 -0
new file mode 100644
index 0000000000..3bc2f9cf54
@@ -0,0 +1,3 @@
+sha256 4ebf1df5922df0efccac4795f5bd1c514fc850348c34d9ec0868e2798b565a36 brltty-5.5.tar.xz
+sha256 91df39d1816bfb17a4dda2d3d2c83b1f6f2d38d53e53e41e8f97ad5ac46a0cad LICENSE-GPL
+sha256 d80c9d084ebfb50ea1ed91bfbc2410d6ce542097a32c43b00781b83adcb8c77f LICENSE-LGPL
package/brltty/brltty.mk new file +39 -0
new file mode 100644
index 0000000000..8b0ccd310b
@@ -0,0 +1,39 @@
+################################################################################
+#
+# brltty
+#
+################################################################################
+
+BRLTTY_VERSION = 5.5
+BRLTTY_SOURCE = brltty-$(BRLTTY_VERSION).tar.xz
+BRLTTY_SITE = http://brltty.com/archive
+BRLTTY_INSTALL_STAGING = NO
+BRLTTY_INSTALL_TARGET = YES
+BRLTTY_INSTALL_STAGING_OPTS = INSTALL_ROOT=$(STAGING_DIR) install
+BRLTTY_INSTALL_TARGET_OPTS = INSTALL_ROOT=$(TARGET_DIR) install
+BRLTTY_LICENSE_FILES=LICENSE-GPL LICENSE-LGPL
+ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS),y)
+BRLTTY_DEPENDENCIES += bluez5_utils
+endif
+
+define BRLTTY_INSTALL_CONF
+	$(INSTALL) -D -m 644 $(@D)/Documents/brltty.conf $(TARGET_DIR)/etc/brltty.conf
+endef
+
+BRLTTY_POST_INSTALL_TARGET_HOOKS += BRLTTY_INSTALL_CONF
+
+define BRLTTY_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/brltty/S10brltty \
+		   $(TARGET_DIR)/etc/init.d/S10brltty
+endef
+
+define BRLTTY_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 package/brltty/brltty.service \
+		   $(TARGET_DIR)/usr/lib/systemd/system/brltty.service
+
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
+	ln -fs  ../../../../usr/lib/systemd/system/brltty.service \
+		$(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/brltty.service
+endef
+
+$(eval $(autotools-package))
package/brltty/brltty.service new file +23 -0
new file mode 100644
index 0000000000..070ec94b7c
@@ -0,0 +1,23 @@
+[Unit]
+Description=Braille Device Support
+Documentation=man:brltty(1)
+Documentation=http://brltty.com/
+
+DefaultDependencies=no
+Before=sysinit.target
+After=systemd-udev-settle.service
+Wants=systemd-udev-settle.service
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/brltty --no-daemon
+TimeoutStartSec=5
+TimeoutStopSec=10
+Restart=always
+RestartSec=30
+Nice=-10
+OOMScoreAdjust=-900
+
+[Install]
+WantedBy=sysinit.target
+
Signature · 1 line
2.15.0
author
#1 lore raw

PATCH 2/2 DEVELOPERS: Add myself

---
 DEVELOPERS | 3 +++
 1 file changed, 3 insertions(+)
DEVELOPERS +3 -0
index c39348a0b2..190e2b2f60 100644
@@ -1008,6 +1008,9 @@ F:	package/polkit/
 F:	package/sg3_utils/
 F:	package/udisks/
 
+N:	Mario Lang <[email protected]>
+F:	package/brltty/
+
 N:	Mario Rugiero <[email protected]>
 F:	package/ratpoison/
 
Signature · 1 line
2.15.0
#2 lore raw

PATCH 2/2 DEVELOPERS: Add myself

Hi Mario,

Quoted 10 lines · Mario Lang
---
 DEVELOPERS | 3 +++
 1 file changed, 3 insertions(+)
DEVELOPERS +0 -0
index c39348a0b2..190e2b2f60 100644

DEVELOPERS F: package/polkit/ · line 1012

Quoted 5 lines
DEVELOPERS +2 -0
@@ -1008,6 +1008,9 @@ F:	package/polkit/
 F:	package/sg3_utils/
 F:	package/udisks/
 
+N:	Mario Lang <[email protected]>
+F:	package/brltty/

This should be included in the previous patch.

Thanks,
baruch

Quoted 3 lines
DEVELOPERS +1 -0
+
 N:	Mario Rugiero <[email protected]>
 F:	package/ratpoison/
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
author
#3 lore raw

PATCH 2/2 DEVELOPERS: Add myself

Quoted 14 lines · Baruch Siach
Quoted 13 lines · Mario Lang
---
 DEVELOPERS | 3 +++
 1 file changed, 3 insertions(+)
DEVELOPERS +0 -0
index c39348a0b2..190e2b2f60 100644
@@ -1008,6 +1008,9 @@ F:	package/polkit/
 F:	package/sg3_utils/
 F:	package/udisks/
 
Quoted 4 lines

DEVELOPERS F: package/polkit/ · line 1012

Quoted 2 lines
DEVELOPERS +2 -0
+N:	Mario Lang <[email protected]>
+F:	package/brltty/

This should be included in the previous patch.

I would have done so, but the current documentation suggests otherwise:

"If you are interested in getting notified of build failures and of further changes in the packages you added or modified, please add yourself to the DEVELOPERS file. This should be done in a separate patch of the series."

Maybe the documentation needs updating?

Thanks for your feedback, will send an updated version of that patch later.

Signature · 6 lines
CYa,
  ????? | Blog: <https://blind.guru/>  GitHub: <https://github.com/mlang/>
  .''`. |
 : :' : | SoundCloud: <soundcloud.com/mario-lang>
 `. `'  | YouTube: <youtube.com/user/mlang23>
   `-
#4 lore raw

PATCH 2/2 DEVELOPERS: Add myself

Hi Mario,

Quoted 21 lines · Mario Lang
Quoted 14 lines · Baruch Siach
Quoted 13 lines · Mario Lang
---
 DEVELOPERS | 3 +++
 1 file changed, 3 insertions(+)
DEVELOPERS +0 -0
index c39348a0b2..190e2b2f60 100644
@@ -1008,6 +1008,9 @@ F:	package/polkit/
 F:	package/sg3_utils/
 F:	package/udisks/
 
Quoted 4 lines

DEVELOPERS F: package/polkit/ · line 1012

Quoted 2 lines
DEVELOPERS +2 -0
+N:	Mario Lang <[email protected]>
+F:	package/brltty/

This should be included in the previous patch.

Quoted 8 lines

I would have done so, but the current documentation suggests otherwise:

"If you are interested in getting notified of build failures and of further changes in the packages you added or modified, please add yourself to the DEVELOPERS file. This should be done in a separate patch of the series."

Maybe the documentation needs updating?

The documentation has been updated in commit 8209d72211a (docs: update DEVELOPERS modification process).

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#5 lore raw

PATCH 1/2 brltty: new package

In reply to Mario Lang

Hi Mario,

Quoted 4 lines · Mario Lang

A daemon providing access to the Linux console for a blind person using a refreshable braille display.

Thank you very much for your contribution.

See below a few quick comments.

Quoted 35 lines
---
 package/Config.in             |  1 +
 package/brltty/Config.in      | 14 ++++++++++++++
 package/brltty/S10brltty      | 40 ++++++++++++++++++++++++++++++++++++++++
 package/brltty/brltty.hash    |  3 +++
 package/brltty/brltty.mk      | 39 +++++++++++++++++++++++++++++++++++++++
 package/brltty/brltty.service | 23 +++++++++++++++++++++++
 6 files changed, 120 insertions(+)
 create mode 100644 package/brltty/Config.in
 create mode 100644 package/brltty/S10brltty
 create mode 100644 package/brltty/brltty.hash
 create mode 100644 package/brltty/brltty.mk
 create mode 100644 package/brltty/brltty.service
package/Config.in +1 -0
index fe5ccc434e..83f639d4be 100644
@@ -380,6 +380,7 @@ endmenu
 	source "package/avrdude/Config.in"
 	source "package/bcache-tools/Config.in"
 	source "package/biosdevname/Config.in"
+	source "package/brltty/Config.in"
 	source "package/cbootimage/Config.in"
 	source "package/cc-tool/Config.in"
 	source "package/cdrkit/Config.in"
package/brltty/Config.in new file +3 -0
new file mode 100644
index 0000000000..03a0c635f0
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_BRLTTY
+	bool "brltty"
+	depends on BR2_USE_WCHAR

package/brltty/Config.in line 13

Quoted 10 lines
package/brltty/Config.in new file +10 -0
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  A daemon providing access to the Linux console
+	  for a blind person using a refreshable braille display.
+
+	  http://brltty.com/
+
+comment "brltty needs a toolchain w/ threads, wchar"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_USE_WCHAR

We cant this comment to show if either BR2_TOOLCHAIN_HAS_THREADS or BR2_USE_WCHAR is missing. So this should be:

  depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
Quoted 63 lines
package/brltty/Config.in new file +1 -0
+
package/brltty/S10brltty new file +40 -0
new file mode 100644
index 0000000000..8772a82350
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# brltty        Starts brltty.
+#
+
+start() {
+	printf "Starting brltty: "
+	start-stop-daemon -S -q -p /var/run/brltty.pid \
+		--exec /usr/bin/brltty -- -P /var/run/brltty.pid -q "$@"
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+stop() {
+	printf "Stopping brltty: "
+	start-stop-daemon -K -q -p /var/run/brltty.pid
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+restart() {
+	stop
+	start "$@"
+}
+
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart|reload)
+	restart
+	;;
+  force-reload)
+	restart
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart|force-reload}"
+	exit 1
+esac
+
+exit $?
package/brltty/brltty.hash new file +3 -0
new file mode 100644
index 0000000000..3bc2f9cf54
@@ -0,0 +1,3 @@
+sha256 4ebf1df5922df0efccac4795f5bd1c514fc850348c34d9ec0868e2798b565a36 brltty-5.5.tar.xz
+sha256 91df39d1816bfb17a4dda2d3d2c83b1f6f2d38d53e53e41e8f97ad5ac46a0cad LICENSE-GPL
+sha256 d80c9d084ebfb50ea1ed91bfbc2410d6ce542097a32c43b00781b83adcb8c77f LICENSE-LGPL
package/brltty/brltty.mk new file +1 -0
new file mode 100644
index 0000000000..8b0ccd310b
@@ -0,0 +1,39 @@
+################################################################################

package/brltty/brltty.mk line 11

Quoted 10 lines
package/brltty/brltty.mk new file +10 -0
+#
+# brltty
+#
+################################################################################
+
+BRLTTY_VERSION = 5.5
+BRLTTY_SOURCE = brltty-$(BRLTTY_VERSION).tar.xz
+BRLTTY_SITE = http://brltty.com/archive
+BRLTTY_INSTALL_STAGING = NO
+BRLTTY_INSTALL_TARGET = YES

These two are the defaults, so no need to set them explicitly.

package/brltty/brltty.mk line 14

Quoted 3 lines
package/brltty/brltty.mk new file +3 -0
+BRLTTY_INSTALL_STAGING_OPTS = INSTALL_ROOT=$(STAGING_DIR) install
+BRLTTY_INSTALL_TARGET_OPTS = INSTALL_ROOT=$(TARGET_DIR) install
+BRLTTY_LICENSE_FILES=LICENSE-GPL LICENSE-LGPL

Missing spaces around '='.

Also, please add an empty line here.

package/brltty/brltty.mk line 17

Quoted 3 lines
package/brltty/brltty.mk new file +3 -0
+ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS),y)
+BRLTTY_DEPENDENCIES += bluez5_utils
+endif

If there is an explicit enable/disable configure parameter please add it. Something like (untested; fictitious option names):

ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS),y)
BRLTTY_DEPENDENCIES += bluez5_utils
BRLTTY_CONF_OPTS += --with-bluez
else
BRLTTY_CONF_OPTS += --without-bluez
endif

Quoted 40 lines
package/brltty/brltty.mk new file +22 -0
+
+define BRLTTY_INSTALL_CONF
+	$(INSTALL) -D -m 644 $(@D)/Documents/brltty.conf $(TARGET_DIR)/etc/brltty.conf
+endef
+
+BRLTTY_POST_INSTALL_TARGET_HOOKS += BRLTTY_INSTALL_CONF
+
+define BRLTTY_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/brltty/S10brltty \
+		   $(TARGET_DIR)/etc/init.d/S10brltty
+endef
+
+define BRLTTY_INSTALL_INIT_SYSTEMD
+	$(INSTALL) -D -m 0644 package/brltty/brltty.service \
+		   $(TARGET_DIR)/usr/lib/systemd/system/brltty.service
+
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
+	ln -fs  ../../../../usr/lib/systemd/system/brltty.service \
+		$(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/brltty.service
+endef
+
+$(eval $(autotools-package))
package/brltty/brltty.service new file +12 -0
new file mode 100644
index 0000000000..070ec94b7c
@@ -0,0 +1,23 @@
+[Unit]
+Description=Braille Device Support
+Documentation=man:brltty(1)
+Documentation=http://brltty.com/
+
+DefaultDependencies=no
+Before=sysinit.target
+After=systemd-udev-settle.service
+Wants=systemd-udev-settle.service
+
+[Service]
+Type=simple

package/brltty/brltty.service line 22

Quoted 10 lines
package/brltty/brltty.service new file +10 -0
+ExecStart=/usr/bin/brltty --no-daemon
+TimeoutStartSec=5
+TimeoutStopSec=10
+Restart=always
+RestartSec=30
+Nice=-10
+OOMScoreAdjust=-900
+
+[Install]
+WantedBy=sysinit.target

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -