From: Yu Watanabe Date: Tue, 16 May 2017 00:51:22 +0000 (+0900) Subject: meson: do not use generate_gperfs.py for keyboard-keys-from-name.gperf (#5968) X-Git-Tag: v234~200 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8ff213fd65e2c0614d183e594bb779b5b27f4121;p=thirdparty%2Fsystemd.git meson: do not use generate_gperfs.py for keyboard-keys-from-name.gperf (#5968) Fixes #5967. --- diff --git a/src/udev/generate-keyboard-gperf.py b/src/udev/generate-keyboard-gperf.py new file mode 100755 index 00000000000..03d3bba7d3c --- /dev/null +++ b/src/udev/generate-keyboard-gperf.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +"""Generate keyboard-keys-from-name.gperf from keyboard-keys-list.txt +""" + +import sys + +input = sys.argv[1] + +print("""\ +struct key_name { const char* name; unsigned short id; }; +%null-strings +%%""") + +for line in open(input): + print("{0}, {1}".format(line.rstrip()[4:].lower(), line.rstrip())) diff --git a/src/udev/meson.build b/src/udev/meson.build index 90033edda8f..9c81bce5454 100644 --- a/src/udev/meson.build +++ b/src/udev/meson.build @@ -59,12 +59,13 @@ keyboard_keys_list_txt = custom_target( command : [generate_keyboard_keys_list, cpp], capture : true) +generate_keyboard_gperf = find_program('generate-keyboard-gperf.py') fname = 'keyboard-keys-from-name.gperf' gperf_file = custom_target( fname, input : keyboard_keys_list_txt, output : fname, - command : [generate_gperfs, 'key', '', '@INPUT@'], + command : [generate_keyboard_gperf, '@INPUT@'], capture : true) fname = 'keyboard-keys-from-name.h' @@ -73,7 +74,7 @@ keyboard_keys_from_name_h = custom_target( input : gperf_file, output : fname, command : [gperf, - '-L', 'ANSI-C', '-t', '--ignore-case', + '-L', 'ANSI-C', '-t', '-N', 'keyboard_lookup_key', '-H', 'hash_key_name', '-p', '-C',