jinx: more work on xf86-input-keyboard and several X related ports

This commit is contained in:
Matheus
2022-10-26 19:48:56 -03:00
parent 47487e7757
commit e904c89104
14 changed files with 289 additions and 19 deletions
+7
View File
@@ -6,3 +6,10 @@ Section "Device"
Identifier "Card0"
Driver "fbdev"
EndSection
Section "InputDevice"
Identifier "Keyboard"
Driver "kbd"
Option "Device" "/dev/keyboard"
Option "Protocol" "Standard"
EndSection
+38
View File
@@ -0,0 +1,38 @@
diff --git xedit-clean/lisp/mathimp.c xedit-workdir/lisp/mathimp.c
index 0433968..3734efb 100644
--- xedit-clean/lisp/mathimp.c
+++ xedit-workdir/lisp/mathimp.c
@@ -29,6 +29,7 @@
/* $XFree86: xc/programs/xedit/lisp/mathimp.c,v 1.14tsi Exp $ */
+int finite(double);
/*
* Defines
diff --git xedit-clean/lisp/mp/mpi.c xedit-workdir/lisp/mp/mpi.c
index 7fcc30e..6984f09 100644
--- xedit-clean/lisp/mp/mpi.c
+++ xedit-workdir/lisp/mp/mpi.c
@@ -29,6 +29,8 @@
/* $XFree86: xc/programs/xedit/lisp/mp/mpi.c,v 1.12 2002/11/20 07:44:43 paulo Exp $ */
+int finite(double);
+
#include "mp.h"
#if defined(__UNIXOS2__) || defined(__APPLE__)
diff --git xedit-clean/lisp/read.c xedit-workdir/lisp/read.c
index 4103736..8898b1b 100644
--- xedit-clean/lisp/read.c
+++ xedit-workdir/lisp/read.c
@@ -29,6 +29,8 @@
/* $XFree86: xc/programs/xedit/lisp/read.c,v 1.36tsi Exp $ */
+int finite(double);
+
#include <errno.h>
#include "lisp/read.h"
#include "lisp/package.h"
@@ -22,19 +22,15 @@ index 0f71ce3..024edd3 100644
AM_CONDITIONAL(BSD, [test "x$IS_BSD" = xyes])
AM_CONDITIONAL(SOLARIS, [test "x$IS_SOLARIS" = xyes])
AM_CONDITIONAL(HURD, [test "x$IS_HURD" = xyes])
diff --git xf86-input-keyboard-workdir/src/.astral_kbd.c.swp xf86-input-keyboard-workdir/src/.astral_kbd.c.swp
new file mode 100644
index 0000000..fd1ca48
Binary files /dev/null and xf86-input-keyboard-workdir/src/.astral_kbd.c.swp differ
diff --git xf86-input-keyboard-clean/src/Makefile.am xf86-input-keyboard-workdir/src/Makefile.am
index 52f5f4d..95b684d 100644
index 52f5f4d..7de71b9 100644
--- xf86-input-keyboard-clean/src/Makefile.am
+++ xf86-input-keyboard-workdir/src/Makefile.am
@@ -26,10 +26,15 @@ kbd_drv_la_SOURCES = kbd.c xf86OSKbd.h xf86Keymap.h atKeynames.h
kbd_drv_la_LIBADD = $(XORG_LIBS)
kbd_drv_ladir = @inputdir@
+ASTRAL_SRCS = astral_kbd.c
+ASTRAL_SRCS = astral_kbd.c astral_KbdMap.c
BSD_SRCS = bsd_KbdMap.c bsd_kbd.c bsd_kbd.h at_scancode.c
HURD_SRCS = hurd_kbd.c at_scancode.c
SOLARIS_SRCS = sun_kbd.c sun_kbd.h sun_kbdMap.c
@@ -52,12 +48,45 @@ index 52f5f4d..95b684d 100644
-EXTRA_DIST = $(BSD_SRCS) $(HURD_SRCS) $(SOLARIS_SRCS)
+EXTRA_DIST = $(ASTRAL_SRCS) $(BSD_SRCS) $(HURD_SRCS) $(SOLARIS_SRCS)
diff --git xf86-input-keyboard-workdir/src/astral_KbdMap.c xf86-input-keyboard-workdir/src/astral_KbdMap.c
new file mode 100644
index 0000000..2ca19fd
--- /dev/null
+++ xf86-input-keyboard-workdir/src/astral_KbdMap.c
@@ -0,0 +1,27 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <xorg-server.h>
+#include <X11/X.h>
+
+#include "compiler.h"
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+
+#include "xf86Xinput.h"
+#include "xf86OSKbd.h"
+#include "atKeynames.h"
+#include "xf86Keymap.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+void getmap(InputInfoPtr info, KeySymsPtr syms, CARD8 *map){
+ syms->map = map;
+ syms->mapWidth = GLYPHS_PER_KEY;
+ syms->minKeyCode = MIN_KEYCODE;
+ syms->maxKeyCode = MAX_KEYCODE;
+}
diff --git xf86-input-keyboard-workdir/src/astral_kbd.c xf86-input-keyboard-workdir/src/astral_kbd.c
new file mode 100644
index 0000000..2ed6906
index 0000000..44c4007
--- /dev/null
+++ xf86-input-keyboard-workdir/src/astral_kbd.c
@@ -0,0 +1,87 @@
@@ -0,0 +1,94 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
@@ -107,25 +136,33 @@ index 0000000..2ed6906
+
+static int init(InputInfoPtr, int){return Success;}
+
+static Bool openkeyboard(InputInfoPtr info){
+ info->fd = open("/dev/keyboard", O_RDONLY, 0);
+ if(info->fd == -1)
+ FatalError("Failed to open /dev/keyboard (%s)\n",strerror(errno));
+ return TRUE;
+}
+
+static void kbdread(InputInfoPtr info){
+ KbdDevPtr kbd = (KbdDevPtr) info->private;
+ kbpacket_t packet;
+
+ printf("amogus\n");
+
+ while(read(info->fd, &packet, sizeof(kbpacket_t)))
+ kbd->PostEvent(info, packet.keycode, packet.flags & KBPACKET_FLAGS_RELEASED ? FALSE : TRUE);
+
+}
+static void getmap(InputInfoPtr info, KeySymsPtr syms, CARD8 *map){
+ printf("read %c\n", packet.ascii);
+
+}
+
+static Bool openkeyboard(InputInfoPtr info){
+ char *kbdPath = xf86SetStrOption(info->options, "Device", "/dev/keyboard");
+ info->fd = open("/dev/keyboard", O_NONBLOCK | O_RDONLY);
+ if(info->fd == -1)
+ FatalError("Failed to open keyboard (%s)\n",strerror(errno));
+
+ info->read_input = kbdread;
+
+ return TRUE;
+}
+
+
+void getmap(InputInfoPtr info, KeySymsPtr syms, CARD8 *map);
+
+Bool xf86OSKbdPreInit(InputInfoPtr info){
+
+ KbdDevPtr kbd = info->private;
@@ -137,9 +174,8 @@ index 0000000..2ed6906
+ kbd->SetLeds = nop;
+ kbd->GetLeds = getleds;
+ kbd->KbdGetMapping = getmap;
+ kbd->RemapScanCode = NULL;
+ kbd->RemapScanCode = 0;
+ kbd->OpenKeyboard = openkeyboard;
+ info->read_input = kbdread;
+
+ kbd->private = NULL;
+
+24
View File
@@ -0,0 +1,24 @@
name=libxinerama
revision=1
from_source=libxinerama
imagedeps="gcc"
hostdeps="gcc-cross binutils-cross pkgconfig util-macros"
deps="mlibc xorgproto libx11 libxext"
configure() {
${source_dir}/configure --prefix=${prefix} --host=x86_64-astral --disable-malloc0returnsnull
}
build() {
make -j${parallelism}
}
install() {
DESTDIR=${dest_dir} make install
}
+24
View File
@@ -0,0 +1,24 @@
name=libxrandr
revision=1
from_source=libxrandr
imagedeps="gcc"
hostdeps="gcc-cross binutils-cross pkgconfig util-macros"
deps="mlibc libx11 xorgproto util-macros libxext libxrender"
configure() {
${source_dir}/configure --prefix=${prefix} --host=x86_64-astral --disable-malloc0returnsnull
}
build() {
make -j${parallelism}
}
install() {
make DESTDIR=${dest_dir} install
}
+24
View File
@@ -0,0 +1,24 @@
name=util-macros
revision=1
from_source=util-macros
imagedeps="base-devel"
hostdeps="gcc-cross binutils-cross pkgconfig"
deps="mlibc"
configure() {
${source_dir}/configure --host=x86_64-astral --prefix=${prefix}
}
build() {
make -j ${parallelism}
}
install() {
make install DESTDIR=${dest_dir}
}
+24
View File
@@ -0,0 +1,24 @@
name=xedit
revision=1
from_source=xedit
imagedeps="gcc"
hostdeps="gcc-cross binutils-cross pkgconfig"
deps="mlibc libx11 xorgproto libxt libxaw libxmu"
configure() {
${source_dir}/configure --prefix=${prefix} --host=x86_64-astral
}
build() {
make -j${parallelism}
}
install() {
make DESTDIR=${dest_dir} install
}
+24
View File
@@ -0,0 +1,24 @@
name=xev
revision=1
from_source=xev
imagedeps="gcc"
hostdeps="gcc-cross binutils-cross pkgconfig"
deps="mlibc libx11 xorgproto libxrandr"
configure() {
${source_dir}/configure --prefix=${prefix} --host=x86_64-astral
}
build() {
make -j${parallelism}
}
install() {
make DESTDIR=${dest_dir} install
}
+24
View File
@@ -0,0 +1,24 @@
name=xrandr
revision=1
from_source=xrandr
imagedeps="gcc"
hostdeps="gcc-cross binutils-cross pkgconfig"
deps="mlibc xorgproto libx11 libxrandr"
configure() {
${source_dir}/configure --prefix=${prefix} --host=x86_64-astral
}
build() {
make -j${parallelism}
}
install() {
make DESTDIR=${dest_dir} install
}
+9
View File
@@ -0,0 +1,9 @@
name=libxinerama
version=1.1.4
source_method=tarball
tarball_url="https://www.x.org/archive/individual/lib/libXinerama-${version}.tar.gz"
tarball_sha512=a
hostdeps="autoconf automake libtool pkgconfig util-macros xtrans"
regenerate() {
autoreconf -fvi
}
+9
View File
@@ -0,0 +1,9 @@
name=libxrandr
version=1.5.2
source_method=tarball
tarball_url="https://www.x.org/pub/individual/lib/libXrandr-${version}.tar.gz"
tarball_sha512=a
hostdeps="autoconf automake util-macros pkgconfig libtool"
regenerate() {
autoreconf -fvi
}
+9
View File
@@ -0,0 +1,9 @@
name=xedit
version=1.2.3
source_method=tarball
tarball_url="https://www.x.org/pub/individual/app/xedit-${version}.tar.xz"
tarball_sha512=a
hostdeps="autoconf automake util-macros pkgconfig libtool"
regenerate() {
autoreconf -fvi
}
+9
View File
@@ -0,0 +1,9 @@
name=xev
version=1.2.5
source_method=tarball
tarball_url="https://www.x.org/pub/individual/app/xev-${version}.tar.xz"
tarball_sha512=a
hostdeps="autoconf automake util-macros pkgconfig libtool"
regenerate() {
autoreconf -fvi
}
+9
View File
@@ -0,0 +1,9 @@
name=xrandr
version=1.5.1
source_method=tarball
tarball_url="https://www.x.org/pub/individual/app/xrandr-${version}.tar.xz"
tarball_sha512=a
hostdeps="autoconf automake util-macros pkgconfig libtool"
regenerate() {
autoreconf -fvi
}