1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
#!/bin/sh
# Build script for xf86-input-keyboard (autotools, Template A).
#
# Phase 2 Task 4 (M3). Ships a pre-generated `configure` (standard fd.o
# release tarball, unlike xf86-video-illumosfb's git-commit-archive), so no
# autogen.sh/autoreconf step is needed - straight Template A.
#
# Patches (patches/, applied below):
# 01-sun-kbd-headers.patch - add sys/param.h, unistd.h, stropts.h includes
# to src/sun_kbd.c (missing-header compile fix
# on GCC 14 / illumos headers). Equivalent of
# OI's 01-sun-kbd.patch.
#
# Module install dir: like xf86-video-illumosfb, this driver's configure.ac
# computes inputdir=${moduledir}/input, and moduledir defaults from
# --with-xorg-module-dir. The XLibre Xorg server (base/xlibre-xserver-xorg)
# advertises input_drivers_dir=${exec_prefix}/lib/xorg/modules/xlibre-25/drivers/input
# in its xorg-server.pc, so pass
# --with-xorg-module-dir="$PREFIX/lib/xorg/modules/xlibre-25/drivers"
# (NOT ".../xlibre-25" as the video driver used - video's own Makefile.am
# appends "/drivers" itself, whereas ours appends "/input" directly) so the
# built .../input subdir lines up with where Xorg actually looks.
set -e
# Resolve the port dir (holds patches/) BEFORE cd'ing into the extracted source.
PORTDIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
cd "$SRCDIR"
# --- Hammerhead/illumos portability patches ---
for p in "$PORTDIR"/patches/*.patch; do
[ -f "$p" ] || continue
echo "==> Applying patch: $(basename "$p")"
patch -p1 < "$p"
done
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
export CFLAGS="${CFLAGS} -I$PREFIX/include -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS"
export LDFLAGS="${LDFLAGS} -L$PREFIX/lib -R$PREFIX/lib"
# MANDATORY libtool fix (Template A) - piggyback hammerhead onto the
# kopensolaris arm in configure's dynamic-linker case block.
if [ -f configure ]; then
sed -i -E 's/(kopensolaris\*-gnu)([^)]*\))/\1 | hammerhead*\2/' configure
fi
# OS-detection fix: sun_kbd.c (the VUID /dev/kbd backend) is only selected
# when configure's `case $host_os in ... solaris*) IS_SOLARIS="yes" ;;`
# matches - our host_os is "hammerhead", not "solaris*", so the generated
# configure's unmatched `*)` arm hard-errors with "Your operating system is
# not supported by the kbd driver." Piggyback hammerhead* onto the solaris*
# arm (same VUID/STREAMS ioctl convention) in the *generated* configure
# (this tarball ships one; there is no configure.ac regen step here).
if [ -f configure ]; then
sed -i -E 's/^ solaris\*\)$/ solaris* | hammerhead*)/' configure
fi
./configure \
--prefix="$PREFIX" \
--build="$BUILD_TRIPLE" \
--host="$BUILD_TRIPLE" \
--sysconfdir="$SYSCONFDIR" \
--disable-static \
--with-xorg-module-dir="$PREFIX/lib/xorg/modules/xlibre-25/drivers"
gmake -j${JOBS:-1}
gmake install DESTDIR="$PKGDIR"
# xf86-input-keyboard - X.Org keyboard input driver
#
# Phase 2 Task 4 (M3): the VUID /dev/kbd STREAMS backend (src/sun_kbd.c) is
# already upstream (uses sys/vuid_event.h, sys/kbd.h). One local patch adds
# a few missing header includes needed to compile against GCC 14 / illumos
# headers (see patches/01-sun-kbd-headers.patch).
[package]
name = "xf86-input-keyboard"
version = "1.9.0"
release = 1
description = "X.Org keyboard input driver (illumos /dev/kbd VUID backend)"
url = "https://gitlab.freedesktop.org/xorg/driver/xf86-input-keyboard"
license = "MIT"
maintainer = "Chris Tusa <chris.tusa@leafscale.com>"
arch = "x86_64"
[dependencies]
runtime = ["xlibre-xserver-xorg"]
build = ["xlibre-xserver-xorg", "util-macros"]
[[source]]
file = "xf86-input-keyboard-1.9.0.tar.gz"
urls = ["https://www.x.org/archive/individual/driver/xf86-input-keyboard-1.9.0.tar.gz"]
checksum = "407cf742246708843126617feee85b30a8b7b7567b3bc507a6cfda7443a8d9ac"
extract = true
[build]
parallel = true
--- a/src/sun_kbd.c 2026-07-23 13:55:22.652012681 -0500
+++ b/src/sun_kbd.c 2026-07-23 13:59:47.345032786 -0500
@@ -56,9 +56,21 @@
#include "xf86OSKbd.h"
#include "sun_kbd.h"
-#include <sys/stropts.h>
+/* OI fix (missing-header build failure on illumos/GCC 14): pull in
+ * sys/param.h, unistd.h, stropts.h explicitly - sun_kbd.c uses
+ * usleep()/ioctl() and STREAMS ioctl constants (I_PUSH/I_POP/I_FIND)
+ * that are not reliably pulled in transitively on this toolchain.
+ * sys/kbio.h is ALSO required (not just sys/kbd.h): Hammerhead's
+ * <sys/kbd.h> does not transitively include it, and it is the header
+ * that actually defines the KIOC* keyboard ioctl constants
+ * (KIOCSLED/KIOCGLED/KIOCTYPE/KIOCLAYOUT/KIOCGDIRECT/KIOCSDIRECT/
+ * KIOCCMD/KIOCMKTONE/...) this driver uses throughout. */
+#include <sys/param.h>
+#include <unistd.h>
+#include <stropts.h>
#include <sys/vuid_event.h>
#include <sys/kbd.h>
+#include <sys/kbio.h>
#include <sys/note.h> /* needed before including older versions of hid.h */
#include <sys/usb/clients/hid/hid.h>
|