Files
pkgsrc-ng/sysutils/hal/patches/patch-nc
2016-11-18 22:39:22 +01:00

33 lines
1.2 KiB
Plaintext

$NetBSD: patch-nc,v 1.2 2016/09/17 15:33:59 richard Exp $
key event codes have migrated from linux/input.h to linux/input-event-codes .h
so update to support generating gperf hash from either.
--- tools/Makefile.am.orig 2009-11-09 15:33:53.000000000 +0000
+++ tools/Makefile.am
@@ -8,8 +8,11 @@ endif
if HALD_COMPILE_FREEBSD
SUBDIRS += freebsd
endif
+if HALD_COMPILE_NETBSD
+SUBDIRS += netbsd
+endif
-DIST_SUBDIRS = freebsd linux
+DIST_SUBDIRS = freebsd linux netbsd
AM_CPPFLAGS = \
-DPACKAGE_LIBEXEC_DIR=\""$(libexecdir)"\" \
@@ -80,7 +83,11 @@ if BUILD_KEYMAPS
if HAVE_GPERF
hal-setup-keymap-keys.txt: @LINUX_INPUT_H@
- awk '/^#define.*KEY_/ { if ($$2 != "KEY_MAX") { print substr($$2, 5) } }' < $< > $@
+ if test -f /usr/include/linux/input-event-codes.h; then \
+ awk '/^#define.*KEY_/ { if ($$2 != "KEY_MAX") { print substr($$2, 5) } }' < /usr/include/linux/input-event-codes.h > $@; \
+ else \
+ awk '/^#define.*KEY_/ { if ($$2 != "KEY_MAX") { print substr($$2, 5) } }' < $< > $@; \
+ fi
hal-setup-keymap-hash-name.gperf: hal-setup-keymap-keys.txt
awk 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", KEY_" $$1 }' < $< > $@