mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-25 10:03:03 +01:00
system/bicon: Added (Bidirectional Console).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
c6f8078c1b
commit
964c516cd0
7 changed files with 436 additions and 0 deletions
114
system/bicon/1e7128710f49ca1c53a892b9db3a364ec038f931.patch
Normal file
114
system/bicon/1e7128710f49ca1c53a892b9db3a364ec038f931.patch
Normal file
|
@ -0,0 +1,114 @@
|
|||
# From 1e7128710f49ca1c53a892b9db3a364ec038f931 Mon Sep 17 00:00:00 2001
|
||||
# From: Behdad Esfahbod <behdad@behdad.org>
|
||||
# Date: Tue, 14 Oct 2014 17:36:50 -0700
|
||||
# Subject: [PATCH] Properly exit if child exited but didn't die
|
||||
#
|
||||
# Happens, if for example you have a subprocess running in a shell but
|
||||
# exit the shell...
|
||||
# ---
|
||||
bicon/pty_spawn.c | 29 ++++++++++++++++++++++-------
|
||||
1 file changed, 22 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/bicon/pty_spawn.c b/bicon/pty_spawn.c
|
||||
index ad1da96..21ab737 100644
|
||||
--- a/bicon/pty_spawn.c
|
||||
+++ b/bicon/pty_spawn.c
|
||||
@@ -10,6 +10,7 @@ namely the PSF License Agreement For Python 2.2.3
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
+#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <pty.h>
|
||||
@@ -21,6 +22,8 @@ namely the PSF License Agreement For Python 2.2.3
|
||||
#include <signal.h>
|
||||
#include "pty_spawn.h"
|
||||
|
||||
+static volatile int done;
|
||||
+
|
||||
static pid_t
|
||||
_fork (int *master_fd, int *slave_fd)
|
||||
{
|
||||
@@ -66,7 +69,7 @@ _xread (
|
||||
int ret;
|
||||
do {
|
||||
ret = read (fd, buf, count);
|
||||
- } while (ret == -1 && errno == EINTR);
|
||||
+ } while (ret == -1 && errno == EINTR && !done);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -81,7 +84,7 @@ _xwrite (
|
||||
{
|
||||
do {
|
||||
ret = write (fd, buf, count);
|
||||
- } while (ret == -1 && errno == EINTR);
|
||||
+ } while (ret == -1 && errno == EINTR && !done);
|
||||
if (ret == -1)
|
||||
{
|
||||
fprintf (stderr, "bicon: write() failed.\n");
|
||||
@@ -105,7 +108,7 @@ _copy (
|
||||
ino_t cwd = -1;
|
||||
char _proc_child_cwd[32];
|
||||
snprintf (_proc_child_cwd, sizeof (_proc_child_cwd), "/proc/%u/cwd", pid);
|
||||
- for (;;)
|
||||
+ for (;!done;)
|
||||
{
|
||||
|
||||
FD_ZERO (&rfds);
|
||||
@@ -114,9 +117,9 @@ _copy (
|
||||
ret = select (master_fd + 1, &rfds, NULL, NULL, ptimeout);
|
||||
if (-1 == ret)
|
||||
{
|
||||
- if (errno == EINTR)
|
||||
+ if (errno == EINTR && !done)
|
||||
continue;
|
||||
- return -1;
|
||||
+ return;
|
||||
}
|
||||
if (0 == ret)
|
||||
{
|
||||
@@ -147,14 +150,14 @@ _copy (
|
||||
{
|
||||
count = _xread (master_read, master_fd, buf, sizeof (buf));
|
||||
if (count == -1)
|
||||
- return -1;
|
||||
+ return;
|
||||
_xwrite (1, buf, count);
|
||||
}
|
||||
if (FD_ISSET (0, &rfds))
|
||||
{
|
||||
count = _xread (stdin_read, 0, buf, sizeof (buf));
|
||||
if (count == -1)
|
||||
- return -1;
|
||||
+ return;
|
||||
_xwrite (master_fd, buf, count);
|
||||
}
|
||||
/* Set timeout, such that if things are steady, we update cwd
|
||||
@@ -180,6 +183,13 @@ resize(int dummy)
|
||||
kill(pid, SIGWINCH);
|
||||
}
|
||||
|
||||
+static void
|
||||
+child(int dummy)
|
||||
+{
|
||||
+ done = 1;
|
||||
+ fprintf (stderr, "done\n");
|
||||
+}
|
||||
+
|
||||
int
|
||||
bicon_spawn (
|
||||
const char *file,
|
||||
@@ -206,6 +216,11 @@ bicon_spawn (
|
||||
sa.sa_handler = resize;
|
||||
if (sigaction(SIGWINCH, &sa, NULL) == -1)
|
||||
fprintf (stderr, "bicon: sigaction() failed.\n");
|
||||
+ sigemptyset (&sa.sa_mask);
|
||||
+ sa.sa_flags = 0;
|
||||
+ sa.sa_handler = child;
|
||||
+ if (sigaction(SIGCHLD, &sa, NULL) == -1)
|
||||
+ fprintf (stderr, "bicon: sigaction() failed.\n");
|
||||
|
||||
tcgetattr (1, &ts);
|
||||
newts = ts;
|
87
system/bicon/HISTORY
Normal file
87
system/bicon/HISTORY
Normal file
|
@ -0,0 +1,87 @@
|
|||
========
|
||||
History
|
||||
========
|
||||
|
||||
This program, BiCon, has a very entangled history.
|
||||
That being said, here is a try on explaining it.
|
||||
|
||||
Prologue
|
||||
--------
|
||||
|
||||
The program is the last in a series on programs to make the
|
||||
console support bidirectionality. This has been needed in the
|
||||
Arabic, Persian and Hebrew languages among others.
|
||||
|
||||
Acon
|
||||
----
|
||||
Written by Ahmed Abdel-Hamid Mohamed, this was the first program
|
||||
that enjoyed relatively wide support, as it was distributed in
|
||||
Mandrake.
|
||||
|
||||
Akka
|
||||
----
|
||||
The second effort has gone into improving the original acon code
|
||||
and giving it vast additional abilities, this was the Akka
|
||||
project, in Arabeyes. The Akka project is still there, if
|
||||
somebody wants to look at it. Key contributors are Chahine
|
||||
Hamila, Mohamed Elzubeir and Samy Al Bahra. It reached the
|
||||
version 1.0 beta, but the code is becoming too complicated for
|
||||
further enhancements. Additional information is found in the
|
||||
project site, at Arabeyes.
|
||||
|
||||
Farsi
|
||||
-----
|
||||
Taking place more or less parallel to the Akka development,
|
||||
Behdad Esfahbod - widely known for his work on FriBidi - wrote
|
||||
"farsi", as a tool doing the same job as Akka, more Persian
|
||||
oriented. He adopted the basic joining code from Roozbeh
|
||||
Pournader, and borrowed some from script(1), mixed and matched
|
||||
with FriBidi and Voila! The code from script(1) proved to be the
|
||||
major stopper for its distribution. More of the story can be
|
||||
found in HISTORY.farsi, in this package.
|
||||
|
||||
At last: BiCon
|
||||
--------------
|
||||
The next step in Arabeyes was to base the code on the old farsi
|
||||
code. After cleaning up the problematic-licensed code and
|
||||
enhancing Arabic support besides Persian, _BiCon_ was there.
|
||||
|
||||
Here is the old ChangeLog:
|
||||
|
||||
|
||||
2004-January Behdad Esfahbod <bicon@behdad.org>
|
||||
* *: Well, code is handed to Arabeyes people. Decided to
|
||||
change the name to "BiCon". I'm not going to be the
|
||||
maintainer anymore (hopefully). Already imported to
|
||||
Arabeyes CVS. These nice people have removed the code
|
||||
borrowed from "script" and replaced with code from Python
|
||||
sources. We are still to make changes to fit the new
|
||||
system. Thanks guys.
|
||||
|
||||
==========================================================================
|
||||
|
||||
2002-06-13 Behdad Esfahbod <farsi@behdad.org>
|
||||
* */*.[ch]: Major changes. Support many options now, among them is
|
||||
the option to output logical text, not visual.
|
||||
|
||||
2002-06-12 Behdad Esfahbod <farsi@behdad.org>
|
||||
* keymap/isiri2901.kmap.gz: Proposed key positions for bidi marks
|
||||
added.
|
||||
|
||||
2001-12-14 Behdad Esfahbod <behdad@bamdad.org>
|
||||
* farsi: Makes the shells current directory to be the same as when
|
||||
user runs the script.
|
||||
|
||||
2001-12-05 Behdad Esfahbod <behdad@bamdad.org>
|
||||
* fcon/fcon.c: Now accepts parameters to run instead of default /bin/sh.
|
||||
* bin/farsi: Pass parameteres to fcon.
|
||||
* bin/farsidict: A small script for dictionary lookup, using farsi.
|
||||
|
||||
2001-10-13 Behdad Esfahbod <behdad@bamdad.org>
|
||||
* */Makefile: Small changes.
|
||||
|
||||
2001-10-04 Behdad Esfahbod <behdad@bamdad.org>
|
||||
* fconsole/Makefile: Set target clean to remove fconsole-config too.
|
||||
|
||||
2001-9-22 Behdad Esfahbod <behdad@bamdad.org>
|
||||
* First released under farsidev mailing list.
|
21
system/bicon/README
Normal file
21
system/bicon/README
Normal file
|
@ -0,0 +1,21 @@
|
|||
BiCon: a Bidirectional Console
|
||||
|
||||
BiCon can be used under Linux console, or terminal emulators with
|
||||
basic Unicode rendering (UTF-8).
|
||||
|
||||
Run "bicon" to get a console supporting Arabic or Persian according
|
||||
to LANG or specify the country on the command line, for instance:
|
||||
bicon ir # for Persian (Iran)
|
||||
|
||||
Keymaps and fonts for Arabic and Persian are included.
|
||||
|
||||
Use alt+shift to switch keyboard layouts in a graphical environment.
|
||||
To know more:
|
||||
|
||||
"man bicon"
|
||||
and
|
||||
"man bicon.bin"
|
||||
|
||||
See also /usr/doc/bicon-<VERSION>/README.Slackware for BiCon's usage.
|
||||
|
||||
BiCon is maintained by Behdad Esfahbod.
|
68
system/bicon/README.Slackware
Normal file
68
system/bicon/README.Slackware
Normal file
|
@ -0,0 +1,68 @@
|
|||
Additional information about BiCon's behavior
|
||||
=============================================
|
||||
|
||||
BiCon behaves differently if called as "bicon" or "bicon.bin", and also
|
||||
started from the console (or a tty) versus in a graphical environment.
|
||||
|
||||
BiCon ships two keymaps: arabic.map.gz and ir.map.gz and some console
|
||||
fonts, mainly bicon-8x16-512.psfu.gz.
|
||||
|
||||
It can be started as "bicon" or "bicon.bin"
|
||||
|
||||
If started as "bicon" it sets the keymap or keyboard layout in a way that
|
||||
depends whether the "bicon" command is given or not an argument.
|
||||
|
||||
1) If started as "bicon" from the console.
|
||||
|
||||
If a two characters country code is given as argument it is considered
|
||||
to choose the keymap, else the country (or "territory" to be accurate)
|
||||
part of LANG is used.
|
||||
_ If the country (converted to lowercase letters) is found in this list:
|
||||
ae dz eg iq jo ko kw lb ly ma om qa sa sd sy tn ye
|
||||
then the keymap "arabic" is chosen.
|
||||
_ If the country is "IR" or "ir" then the keymap "ir" is chosen.
|
||||
|
||||
The font bicon-8x16-512 is always used with its Unicode map.
|
||||
|
||||
IMPORTANT. You won't be able to use the "setfont" command after having
|
||||
started bicon as a regular user. You will have to tentatively become root
|
||||
with "su" to change the font if you want.
|
||||
|
||||
2) If started as "bicon" from an X terminal.
|
||||
|
||||
You will need to use an UTF-8 able or enabled terminal.
|
||||
|
||||
A switchable keyboard layout (us + the language that correspond to the
|
||||
country set by the user or found in LANG) is set.
|
||||
|
||||
IMPORTANT:
|
||||
_ BiCon doesn't set the font. You'll have to do that yourself. Be careful
|
||||
to use a font including the needed glyphs.
|
||||
_ BiCon sets the "option" for the X server to:
|
||||
"grp:alt_shift_toggle,grp_led:scroll"
|
||||
and the "layout" to:
|
||||
"us,<ir or (country code)>"
|
||||
|
||||
This will override the key combination that you possibly have set in
|
||||
/etc/X11/xorg.conf.d/90-keyboard-layout.conf to toggle keyboards.
|
||||
|
||||
But you can change the settings made by BiCon with a command like this
|
||||
one (after having started BiCon, of course):
|
||||
setxkbmap \
|
||||
-display "$DISPLAY" \
|
||||
-layout "<layout1>,<layout2>" \
|
||||
-option "<your options"> \
|
||||
-print | \
|
||||
xkbcomp -w 2 - "$DISPLAY"
|
||||
|
||||
3) If started as bicon.bin, BiCon doesn't load any font or keyboard.
|
||||
You might prefer it that way if you want to keep your own settings.
|
||||
|
||||
Reference: file bin/bicon.in in the source archive.
|
||||
|
||||
See also:
|
||||
_ man bicon
|
||||
_ man bicon.bin
|
||||
_ documents in /usr/doc/bicon-<version>
|
||||
|
||||
Didier Spaier <didier at slint dot fr>, 27/07/2015
|
117
system/bicon/bicon.SlackBuild
Normal file
117
system/bicon/bicon.SlackBuild
Normal file
|
@ -0,0 +1,117 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Slackware build script for bicon
|
||||
|
||||
# Copyright 2015 Didier Spaier Paris, France
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use of this script, with or without modification, is
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of this script must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
PRGNAM=bicon
|
||||
VERSION=${VERSION:-0.4}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
|
||||
if [ -z "$ARCH" ]; then
|
||||
case "$( uname -m )" in
|
||||
i?86) ARCH=i486 ;;
|
||||
arm*) ARCH=arm ;;
|
||||
*) ARCH=$( uname -m ) ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
CWD=$(pwd)
|
||||
TMP=${TMP:-/tmp/SBo}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
if [ "$ARCH" = "i486" ]; then
|
||||
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "i686" ]; then
|
||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||||
LIBDIRSUFFIX=""
|
||||
elif [ "$ARCH" = "x86_64" ]; then
|
||||
SLKCFLAGS="-O2 -fPIC"
|
||||
LIBDIRSUFFIX="64"
|
||||
else
|
||||
SLKCFLAGS="-O2"
|
||||
LIBDIRSUFFIX=""
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
find -L . \
|
||||
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
||||
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
||||
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
||||
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
||||
|
||||
cat $CWD/*patch | patch -p1 --verbose
|
||||
|
||||
CFLAGS="$SLKCFLAGS" \
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var \
|
||||
--mandir=/usr/man \
|
||||
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
||||
--enable-static=no \
|
||||
--build=$ARCH-slackware-linux
|
||||
|
||||
make
|
||||
make install DESTDIR=$PKG
|
||||
|
||||
# Lets move the fonts and keymaps where they should go
|
||||
mkdir -p $PKG/usr/share/kbd/{consolefonts,keymaps/i386/qwerty}
|
||||
# We don't ship bicon-8x16.bdf beacuse it's heavy (392393 bytes) and we
|
||||
# ship the psf fonts that are useful on the console.
|
||||
mv $PKG/usr/share/bicon/font/*gz $PKG/usr/share/kbd/consolefonts
|
||||
mv $PKG/usr/share/bicon/keymap/* $PKG/usr/share/kbd/keymaps/i386/qwerty
|
||||
rm -r $PKG/usr/share/bicon
|
||||
|
||||
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
||||
|
||||
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
||||
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
||||
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cp -a AUTHORS NEWS README THANKS TODO COPYING $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
|
||||
# The file HISTORY is missing in the source tarball but can be of interest
|
||||
# to some.
|
||||
cp -a $CWD/HISTORY $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
|
||||
# Some additional explanations about BiCon's usage could help the user
|
||||
cp -a $CWD/README.Slackware $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|
10
system/bicon/bicon.info
Normal file
10
system/bicon/bicon.info
Normal file
|
@ -0,0 +1,10 @@
|
|||
PRGNAM="bicon"
|
||||
VERSION="0.4"
|
||||
HOMEPAGE="https://github.com/behdad/bicon"
|
||||
DOWNLOAD="https://github.com/behdad/bicon/releases/download/0.4/bicon-0.4.tar.gz"
|
||||
MD5SUM="82ba589b332ba6dfc9c39f66c246361b"
|
||||
DOWNLOAD_x86_64=""
|
||||
MD5SUM_x86_64=""
|
||||
REQUIRES=""
|
||||
MAINTAINER="Didier Spaier"
|
||||
EMAIL="didier dot spaier at slint dot fr"
|
19
system/bicon/slack-desc
Normal file
19
system/bicon/slack-desc
Normal file
|
@ -0,0 +1,19 @@
|
|||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description.
|
||||
# Line up the first '|' above the ':' following the base package name, and
|
||||
# the '|' on the right side marks the last column you can put a character in.
|
||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
bicon: bicon (Bidirectional Console)
|
||||
bicon:
|
||||
bicon: BiCon can be used under Linux console, or terminal emulators with
|
||||
bicon: basic Unicode rendering (UTF-8).
|
||||
bicon:
|
||||
bicon: Run "bicon" to get a console supporting Arabic or Persian according
|
||||
bicon: to LANG or specify the country on the command line, for instance:
|
||||
bicon: bicon ir # for Persian (Iran)
|
||||
bicon:
|
||||
bicon: Use alt+shift to switch keyboard layouts. See "man bicon".
|
||||
bicon: Keymaps and fonts for Arabic and Persian are included.
|
Loading…
Reference in a new issue