Fix #32 introduced in 1e2d641 We need the constants from both keysymdef.h and X.h

pull/36/head
Seiei Miyagi 6 years ago
parent 1e2d641fe3
commit e9bbb31bc4
No known key found for this signature in database
GPG Key ID: CECD34C119139FA8

5
.gitignore vendored

@ -2,5 +2,6 @@
/mruby
tags
TAGS
src/x11_constants.inc
src/x11_constants_XF86.inc
src/x11_constants_keysymdef.inc
src/x11_constants_X.inc
src/x11_constants_XF86keysym.inc

@ -22,11 +22,14 @@ mruby:
git clone https://github.com/mruby/mruby
git -C mruby reset --hard $(REVISION)
src/x11_constants.inc:
cat /usr/include/X11/keysymdef.h | ruby -e 'puts STDIN.read.split("\n").select {|l| l.match(/\A(#define XK_|#ifdef|#endif)/) }.map{|l| l.match(/\A#define XK_/) ? %Q[ define_x11_const(#{l.split(" ")[1]});] : l }.join("\n")' > src/x11_constants.inc
src/x11_constants_keysymdef.inc:
cat /usr/include/X11/keysymdef.h | ruby -e 'puts STDIN.read.split("\n").select {|l| l.match(/\A(#define XK_|#ifdef|#endif)/) }.map{|l| l.match(/\A#define XK_/) ? %Q[ define_x11_const(#{l.split(" ")[1]});] : l }.join("\n")' > src/x11_constants_keysymdef.inc
src/x11_constants_XF86.inc:
cat /usr/include/X11/XF86keysym.h | ruby -e 'puts STDIN.read.split("\n").select {|l| l.start_with?("#")}[2..-2].map{|l| l.start_with?("#define") ? %Q[ define_x11_const(#{l.split(" ")[1]});] : l}' > src/x11_constants_XF86.inc
src/x11_constants_X.inc:
cat /usr/include/X11/X.h | ruby -e 'puts STDIN.read.split("\n").select {|l| l.start_with?("#")}[2..-2].map{|l| l.start_with?("#define") ? %Q[ define_x11_const(#{l.split(" ")[1]});] : l}' > src/x11_constants_X.inc
mruby/build/host/bin/xremap: mruby build_config.rb src/x11_constants.inc src/x11_constants_XF86.inc $(CSRCS) $(MRBSRCS) $(MRBCSRCS)
src/x11_constants_XF86keysym.inc:
cat /usr/include/X11/XF86keysym.h | ruby -e 'puts STDIN.read.split("\n").select {|l| l.match(/\A(#define XF86XK_)/) }.map{|l| l.match(/\A#define XF*86XK_/) ? %Q[ define_x11_const(#{l.split(" ")[1]});] : l }.join("\n")' > src/x11_constants_XF86keysym.inc
mruby/build/host/bin/xremap: mruby build_config.rb src/x11_constants_keysymdef.inc src/x11_constants_X.inc src/x11_constants_XF86keysym.inc $(CSRCS) $(MRBSRCS) $(MRBCSRCS)
cd mruby && MRUBY_CONFIG="$(current_dir)/build_config.rb" make

@ -11,6 +11,7 @@ mrb_xremap_x11_constants_init(mrb_state *mrb, struct RClass *mXremap)
// original constant.
mrb_define_const(mrb, mX11, "NoModifier", mrb_fixnum_value(0));
#include "x11_constants.inc"
#include "x11_constants_XF86.inc"
#include "x11_constants_keysymdef.inc"
#include "x11_constants_X.inc"
#include "x11_constants_XF86keysym.inc"
}

Loading…
Cancel
Save