From efd8c6cde2dbf0054f41947eb5f0a038b2d9eec1 Mon Sep 17 00:00:00 2001 From: Danct12 Date: Sat, 4 Jan 2020 10:42:13 +0700 Subject: [PATCH] console/*: add initial support for TTY keyboard (!858) Signed-off-by: Danct12 --- console/console-keyboard-basic/APKBUILD | 29 +++++++++++++++ console/console-keyboard-multiplexer/APKBUILD | 32 +++++++++++++++++ console/console-keyboard-multiplexer/ckmvt | 24 +++++++++++++ .../console-keyboard-multiplexer.post-install | 5 +++ console/libconsolekeyboard/APKBUILD | 28 +++++++++++++++ console/libttymultiplex/APKBUILD | 35 +++++++++++++++++++ 6 files changed, 153 insertions(+) create mode 100644 console/console-keyboard-basic/APKBUILD create mode 100644 console/console-keyboard-multiplexer/APKBUILD create mode 100755 console/console-keyboard-multiplexer/ckmvt create mode 100755 console/console-keyboard-multiplexer/console-keyboard-multiplexer.post-install create mode 100644 console/libconsolekeyboard/APKBUILD create mode 100644 console/libttymultiplex/APKBUILD diff --git a/console/console-keyboard-basic/APKBUILD b/console/console-keyboard-basic/APKBUILD new file mode 100644 index 000000000..c1ed0890c --- /dev/null +++ b/console/console-keyboard-basic/APKBUILD @@ -0,0 +1,29 @@ +# Contributor: Danct12 +# Maintainer: Danct12 +pkgname="console-keyboard-basic" +pkgver=0_git20200104 +pkgrel=0 +pkgdesc="A basic console keyboard" +arch="all" +url="https://github.com/Daniel-Abrecht/console-keyboard-basic" +license="GPL-3.0-or-later" +options="!check" # no testsuite +depends="console-keyboard-multiplexer" +makedepends="ncurses-dev libconsolekeyboard-dev" + +# Source +_commit="005fd482e9423b5d45743f098e52ba25255bffc0" +source=" + $pkgname-$_commit.tar.gz::https://github.com/Daniel-Abrecht/$pkgname/archive/$_commit.tar.gz +" +builddir="$srcdir/$pkgname-$_commit" + +build() { + make +} + +package() { + make install-all DESTDIR="$pkgdir" + ln -sf /usr/bin/console-keyboard-basic $pkgdir/usr/bin/console-keyboard +} +sha512sums="6e4ffbfa6f44a2a7a90e7bafc3944e5c34c007ae9c9ab0d7cd26930422af9fb381ece6e4357b4bd2568d319393491130e880ebc0861c729fff482c02cce0114e console-keyboard-basic-005fd482e9423b5d45743f098e52ba25255bffc0.tar.gz" diff --git a/console/console-keyboard-multiplexer/APKBUILD b/console/console-keyboard-multiplexer/APKBUILD new file mode 100644 index 000000000..479818485 --- /dev/null +++ b/console/console-keyboard-multiplexer/APKBUILD @@ -0,0 +1,32 @@ +# Contributor: Danct12 +# Maintainer: Danct12 +pkgname="console-keyboard-multiplexer" +pkgver=0_git20200104 +pkgrel=0 +pkgdesc="An on screen keyboard for terminals" +arch="all" +url="https://github.com/Daniel-Abrecht/console-keyboard-multiplexer" +install="$pkgname.post-install" +license="AGPL-3.0-or-later" +options="!check" # no testsuite +depends="libconsolekeyboard kbd terminus-font" +makedepends="libconsolekeyboard-dev libttymultiplex-dev libexecinfo-dev" + +# Source +_commit="e304969224ba79cdac9e6715fd329a8af278cc33" +source=" + $pkgname-$_commit.tar.gz::https://github.com/Daniel-Abrecht/$pkgname/archive/$_commit.tar.gz + ckmvt +" +builddir="$srcdir/$pkgname-$_commit" + +build() { + make +} + +package() { + make install-bin DESTDIR="$pkgdir" + cp -f $srcdir/ckmvt $pkgdir/usr/bin/ckmvt +} +sha512sums="be8e3a892409ee316ee0478c7d46249ab5eefffaffbe11215f593beab2b0da5ae24392e407748a50d567eaffb9cdcd847e24f077030447fb4753470bc75b8cf4 console-keyboard-multiplexer-e304969224ba79cdac9e6715fd329a8af278cc33.tar.gz +1c56ec846de906ec63446aa07cb40d0e64c7e609e5756497aa63fef6b3b071d0f098071e42450e973b6a7bad670771b1c680e5788b987b852c471d074f909ac1 ckmvt" diff --git a/console/console-keyboard-multiplexer/ckmvt b/console/console-keyboard-multiplexer/ckmvt new file mode 100755 index 000000000..441e76198 --- /dev/null +++ b/console/console-keyboard-multiplexer/ckmvt @@ -0,0 +1,24 @@ +#!/bin/sh + +# as for right now, it seems that postmarketOS runs without any color :( +export TERM=linux + +nr="$(printf "%s" "$1" | /bin/sed 's/^tty//')"; shift + +case "$nr" in + *[!0-9]*) + echo "Usage: $0 vtnumber" + exit 1 + ;; +esac + +tty="$(tty)" + +if [ "$(tty)" != "/dev/tty$nr" ] + then exec /sbin/getty -n -l "$0" 38400 "tty$nr" linux +fi + +# nicer font (requires terminus-font to be installed) +setfont /usr/share/consolefonts/ter-u24b.psf.gz + +exec /usr/bin/console-keyboard-multiplexer -w : -l "CKM$nr" -- login diff --git a/console/console-keyboard-multiplexer/console-keyboard-multiplexer.post-install b/console/console-keyboard-multiplexer/console-keyboard-multiplexer.post-install new file mode 100755 index 000000000..5de8980a5 --- /dev/null +++ b/console/console-keyboard-multiplexer/console-keyboard-multiplexer.post-install @@ -0,0 +1,5 @@ +#!/bin/sh + +echo -e "\n\nTo run getty with keyboard on startup, you'll need to edit /etc/inittab" +echo -e "For example, you want the keyboard on tty1, this is how the entry should be:\n" +echo -e "tty1::respawn:/usr/bin/ckmvt 1\n\n" diff --git a/console/libconsolekeyboard/APKBUILD b/console/libconsolekeyboard/APKBUILD new file mode 100644 index 000000000..72007a2ed --- /dev/null +++ b/console/libconsolekeyboard/APKBUILD @@ -0,0 +1,28 @@ +# Contributor: Danct12 +# Maintainer: Danct12 +pkgname="libconsolekeyboard" +pkgver=1.0.0_git20191011 +pkgrel=0 +pkgdesc="A terminal multiplexer library" +arch="all" +url="https://github.com/Daniel-Abrecht/console-keyboard-multiplexer/tree/libconsolekeyboard" +license="LGPL-3.0-or-later" +subpackages="$pkgname-dev" +options="!check" # fails without a proper devfs + +# Source +_commit="73611fa86c8a4c375102a4251cb795b30758e32b" +source=" + console-keyboard-multiplexer-$_commit.tar.gz::https://github.com/Daniel-Abrecht/console-keyboard-multiplexer/archive/$_commit.tar.gz +" +builddir="$srcdir/console-keyboard-multiplexer-$_commit" + +build() { + make +} + +package() { + make install DESTDIR="$pkgdir" +} + +sha512sums="3f2bd8aa62489068b02e4ac985a69a84ad12a59beabecca0a5a8cc0faba4250ff34e81be9d3dde8861bf9907f7137bea976e036eec286e0fe0bfdb2505e1f0ba console-keyboard-multiplexer-73611fa86c8a4c375102a4251cb795b30758e32b.tar.gz" diff --git a/console/libttymultiplex/APKBUILD b/console/libttymultiplex/APKBUILD new file mode 100644 index 000000000..aad6e2975 --- /dev/null +++ b/console/libttymultiplex/APKBUILD @@ -0,0 +1,35 @@ +# Contributor: Danct12 +# Maintainer: Danct12 +pkgname="libttymultiplex" +pkgver=0.0.1_git20200204 +pkgrel=0 +pkgdesc="A terminal multiplexer library" +arch="all" +url="https://github.com/Daniel-Abrecht/libttymultiplex" +license="MIT AND AGPL-3.0-or-later" +depends="ncurses" +makedepends="bash ncurses-dev" +subpackages="$pkgname-dev" + +options="!check" # fails without a proper devfs + +# Source +_commit="91dfd9c6de24314977dd537d25b82cdb994e96ec" +source=" + $pkgname-$_commit.tar.gz::https://github.com/Daniel-Abrecht/$pkgname/archive/$_commit.tar.gz +" +builddir="$srcdir/$pkgname-$_commit" + +build() { + make -j1 # workaround for ld issues +} + +package() { + make install DESTDIR="$pkgdir" +} + +check() { + make test +} + +sha512sums="955c48003b5612616c40afe2f832a7a0035afd71602a161d71c34d80c886215211185f6a3e13382d235b2936f2459cda105d2c2438c1f750d63de9e7d9304143 libttymultiplex-91dfd9c6de24314977dd537d25b82cdb994e96ec.tar.gz"