From 7e1b8981e61fee0f45be93efab532da2db299fe0 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 10 Jul 2022 16:42:40 +0100 Subject: net-libs/gtk-vnc : import from gentoo, fix build with >=dev-util/meson-0.63.0 ( https://bugs.gentoo.org/846467 ) --- .../8da5e173ebdccbca60387ef2347c629be3c78dff.patch | 693 +++++++++++++++++++++ 1 file changed, 693 insertions(+) create mode 100644 net-libs/gtk-vnc/files/8da5e173ebdccbca60387ef2347c629be3c78dff.patch (limited to 'net-libs/gtk-vnc/files/8da5e173ebdccbca60387ef2347c629be3c78dff.patch') diff --git a/net-libs/gtk-vnc/files/8da5e173ebdccbca60387ef2347c629be3c78dff.patch b/net-libs/gtk-vnc/files/8da5e173ebdccbca60387ef2347c629be3c78dff.patch new file mode 100644 index 00000000..93f02b3f --- /dev/null +++ b/net-libs/gtk-vnc/files/8da5e173ebdccbca60387ef2347c629be3c78dff.patch @@ -0,0 +1,693 @@ +diff --git a/meson.build b/meson.build +index 299113a3fc24f58d3d3f3a01bb47bb3830a5f2a4..bf72f13eb256c48bd99146a47b118c16addac9e0 100644 +--- a/meson.build ++++ b/meson.build +@@ -133,10 +133,10 @@ gtk_vnc_version_check_flags = gvnc_version_check_flags + [ + '-DGDK_VERSION_MAX_ALLOWED=@0@'.format(gtk_min_version_symbol), + ] + +-subproject('keycodemapdb') ++keycodemapdb = subproject('keycodemapdb') + +-keymapgen = files('subprojects/keycodemapdb/tools/keymap-gen') +-keymapcsv = files('subprojects/keycodemapdb/data/keymaps.csv') ++keymapgen = find_program('keymap-gen') ++keymapcsv = keycodemapdb.get_variable('keymaps_csv') + + + gnome = import('gnome') +diff --git a/src/meson.build b/src/meson.build +index 247c59759a7422d939c9625d976ec8d1a9143bd7..67fa8b9333324587d2c9ec07f11c398ab862f7bb 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -336,9 +336,10 @@ foreach keymap: keymaps + cmd = [ + python, + keymapgen, ++ 'code-map', + '--lang', 'glib2', + '--varname', varname, +- 'code-map', keymapcsv, keymap, 'qnum' ++ keymapcsv, keymap, 'qnum' + ] + gtk_vnc_sources += custom_target( + target, +#diff --git a/subprojects/keycodemapdb b/subprojects/keycodemapdb +#index 6280c94f306df6a20bbc100ba15a5a81af0366e6..e15649b83a78f89f57205927022115536d2c1698 160000 +#--- a/subprojects/keycodemapdb +#+++ b/subprojects/keycodemapdb +#@@ -1 +1 @@ +#-Subproject commit 6280c94f306df6a20bbc100ba15a5a81af0366e6 +#+Subproject commit e15649b83a78f89f57205927022115536d2c1698 +diff --git a/subprojects/keycodemapdb/meson.build b/subprojects/keycodemapdb/meson.build +index eb9416b3e6c374579e11427a38b4240434b1b1fe..6d263aa454e1c905f8366619f1a856ae82dec825 100644 +--- a/subprojects/keycodemapdb/meson.build ++++ b/subprojects/keycodemapdb/meson.build +@@ -1 +1,6 @@ +-project('keycodemapdb') ++project('keycodemapdb', meson_version: '>=0.46.0') ++ ++keymap_gen = find_program('tools/keymap-gen') ++meson.override_find_program('keymap-gen', keymap_gen) ++ ++keymaps_csv = files('data/keymaps.csv') +diff -ru a/subprojects/keycodemapdb.old/data/keymaps.csv b/subprojects/keycodemapdb/data/keymaps.csv +--- a/subprojects/keycodemapdb.old/data/keymaps.csv 2021-11-17 04:24:01.168825600 -0600 ++++ b/subprojects/keycodemapdb/data/keymaps.csv 2022-07-10 10:19:10.152573436 -0500 +@@ -144,19 +144,19 @@ + KEY_KPDOT,83,ANSI_KeypadDecimal,0x41,0x53,0x71,0x71,99,VK_DECIMAL,0x6e,83,83,XK_KP_Decimal,0xffae,NumpadDecimal,KPDL,kp_decimal,0x32,0x41 + KEY_KPDOT,83,ANSI_KeypadDecimal,0x41,0x53,0x71,0x71,99,VK_DECIMAL,0x6e,83,83,XK_KP_Decimal,0xffae,NumpadDecimal,KPDC,kp_decimal,0x32,0x41 + ,84,,,0x54,,,,,,,,,,,,,, +-KEY_ZENKAKUHANKAKU,85,,,0x76,0x5f,,148,,,,,,,Lang5,HZTG,,, +-KEY_102ND,86,,,0x56,0x61,0x13,100,VK_OEM_102,0xe1,86,86,,,IntlBackslash,LSGT,less,0x7c, ++KEY_ZENKAKUHANKAKU,85,,,0x76,0x5f,,148,,,,,XK_Zenkaku_Hankaku,0xff2a,Lang5,HZTG,,, ++KEY_102ND,86,,,0x56,0x61,0x13,100,VK_OEM_102,0xe2,86,86,XK_backslash,0x005c,IntlBackslash,LSGT,less,0x7c, + KEY_F11,87,F11,0x67,0x57,0x78,0x56,68,VK_F11,0x7a,87,87,XK_F11,0xffc8,F11,FK11,f11,0x09,0x67 + KEY_F12,88,F12,0x6f,0x58,0x07,0x5e,69,VK_F12,0x7b,88,88,XK_F12,0xffc9,F12,FK12,f12,0x0b,0x6f +-KEY_RO,89,,,0x73,0x51,,135,,,,,,,IntlRo,AB11,ro,, +-KEY_KATAKANA,90,JIS_Kana,0x68,0x78,0x63,,146,VK_KANA,0x15,,,,,Katakana,KATA,,, +-KEY_KATAKANA,90,JIS_Kana,0x68,0x78,0x63,,146,VK_KANA,0x15,,,,,Lang3,KATA,,, +-KEY_HIRAGANA,91,,,0x77,0x62,0x87,147,,,,,,,Hiragana,HIRA,hiragana,, +-KEY_HIRAGANA,91,,,0x77,0x62,0x87,147,,,,,,,Lang4,HIRA,hiragana,, +-KEY_HENKAN,92,,,0x79,0x64,0x86,138,,,,,,,Convert,HENK,henkan,, +-KEY_KATAKANAHIRAGANA,93,,,0x70,0x13,0x87,136,,,0xc8,0xc8,,,KanaMode,HKTG,katakanahiragana,, +-KEY_MUHENKAN,94,,,0x7b,0x67,0x85,139,,,,,,,NonConvert,NFER,muhenkan,, +-KEY_MUHENKAN,94,,,0x7b,0x67,0x85,139,,,,,,,NonConvert,MUHE,muhenkan,, ++KEY_RO,89,JIS_Underscore,0x5e,0x73,0x51,,135,VK_OEM_102,0xe2,0xcb,0x73,XK_underscore,0x005f,IntlRo,AB11,ro,, ++KEY_KATAKANA,90,,,0x78,0x63,,146,VK_KANA,0x15,,,XK_Katakana,0xff26,Katakana,KATA,,, ++KEY_KATAKANA,90,,,0x78,0x63,,146,VK_KANA,0x15,,,XK_Katakana,0xff26,Lang3,KATA,,, ++KEY_HIRAGANA,91,,,0x77,0x62,0x87,147,,,,,XK_Hiragana,0xff25,Hiragana,HIRA,hiragana,, ++KEY_HIRAGANA,91,,,0x77,0x62,0x87,147,,,,,XK_Hiragana,0xff25,Lang4,HIRA,hiragana,, ++KEY_HENKAN,92,,,0x79,0x64,0x86,138,VK_CONVERT,0x1c,0x79,0x79,XK_Henkan,0xff23,Convert,HENK,henkan,, ++KEY_KATAKANAHIRAGANA,93,,,0x70,0x13,0x87,136,VK_OEM_COPY,0xf2,0xc8,0x70,XK_Hiragana_Katakana,0xff27,KanaMode,HKTG,katakanahiragana,, ++KEY_MUHENKAN,94,,,0x7b,0x67,0x85,139,VK_NONCONVERT,0x1d,0x7b,0x7b,XK_Muhenkan,0xff22,NonConvert,NFER,muhenkan,, ++KEY_MUHENKAN,94,,,0x7b,0x67,0x85,139,VK_NONCONVERT,0x1d,0x7b,0x7b,XK_Muhenkan,0xff22,NonConvert,MUHE,muhenkan,, + KEY_KPJPCOMMA,95,JIS_KeypadComma,0x5f,0x5c,0x27,,140,,,,,XK_KP_Separator,0xffac,,KPSP,,, + KEY_KPJPCOMMA,95,JIS_KeypadComma,0x5f,0x5c,0x27,,140,,,,,XK_KP_Separator,0xffac,,JPCM,,, + KEY_KPENTER,96,ANSI_KeypadEnter,0x4c,0xe01c,0xe05a,0x79,88,,,0x64,0x64,XK_KP_Enter,0xff8d,NumpadEnter,KPEN,kp_enter,0x5a,0x4c +@@ -192,9 +192,11 @@ + KEY_SCALE,120,,,0xe00b,,,,,,,,,,,I128,,, + KEY_KPCOMMA,121,,,0x7e,0x6d,,133,VK_SEPARATOR??,0x6c,,,,,NumpadComma,KPCO,kp_comma,, + KEY_KPCOMMA,121,,,0x7e,0x6d,,133,VK_SEPARATOR??,0x6c,,,,,NumpadComma,I129,,, +-KEY_HANGEUL,122,,,,,,144,VK_HANGEUL,0x15,,,,,,HNGL,,, +-KEY_HANJA,123,,,0xe00d,,,145,VK_HANJA,0x19,,,,,,HJCV,,, +-KEY_YEN,124,JIS_Yen,0x5d,0x7d,0x6a,0x5d,137,,,0x7d,0x7d,,,IntlYen,AE13,yen,, ++KEY_HANGEUL,122,JIS_Kana,0x68,0x72,,,144,VK_HANGEUL,0x15,,0x71,,,Lang1,HNGL,lang1,, ++KEY_HANGEUL,122,JIS_Kana,0x68,0x72,,,144,VK_IME_ON,0x16,,0x71,,,Lang1,HNGL,lang1,, ++KEY_HANJA,123,JIS_Eisu,0x66,0x71,,,145,VK_HANJA,0x19,,0x72,,,Lang2,HJCV,lang2,, ++KEY_HANJA,123,JIS_Eisu,0x66,0x71,,,145,VK_IME_OFF,0x1A,,0x72,,,Lang2,HJCV,lang2,, ++KEY_YEN,124,JIS_Yen,0x5d,0x7d,0x6a,0x5d,137,VK_OEM_5,0xdc,0x7d,0x7d,,,IntlYen,AE13,yen,, + KEY_LEFTMETA,125,Command,0x37,0xe05b,0xe01f,0x8b,227,VK_LWIN,0x5b,0x6b,0x6b,XK_Meta_L,0xffe7,MetaLeft,LMTA,meta_l,0x78,0x37 + KEY_LEFTMETA,125,Command,0x37,0xe05b,0xe01f,0x8b,227,VK_LWIN,0x5b,0x6b,0x6b,XK_Meta_L,0xffe7,MetaLeft,LWIN,meta_l,0x78,0x37 + KEY_RIGHTMETA,126,RightCommand,0x36,0xe05c,0xe027,0x8c,231,VK_RWIN,0x5c,0x6c,0x6c,XK_Meta_R,0xffe8,MetaRight,RMTA,meta_r,0x7a,0x37 +@@ -250,8 +252,8 @@ + KEY_CONFIG,171,,,0xe001,,,,,,,,,,,I179,,, + KEY_HOMEPAGE,172,,,0xe032,0xe03a,0x97,,VK_BROWSER_HOME,0xac,,,,,BrowserHome,I180,ac_home,, + KEY_REFRESH,173,,,0xe067,0xe020,,250,VK_BROWSER_REFRESH,0xa8,,,,,BrowserRefresh,I181,ac_refresh,, +-KEY_EXIT,174,,,0x71,,,,,,,,,,,I182,,, +-KEY_MOVE,175,,,0x72,,,,,,,,,,,I183,,, ++KEY_EXIT,174,,,,,,,,,,,,,,I182,,, ++KEY_MOVE,175,,,,,,,,,,,,,,I183,,, + KEY_EDIT,176,,,0xe008,,,247,,,,,,,,I184,,, + KEY_SCROLLUP,177,,,0x75,,,245,,,,,,,,I185,,, + KEY_SCROLLDOWN,178,,,0xe00f,,,246,,,,,,,,I186,,, +diff -ru a/subprojects/keycodemapdb.old/README b/subprojects/keycodemapdb/README +--- a/subprojects/keycodemapdb.old/README 2021-11-17 04:24:01.167825700 -0600 ++++ b/subprojects/keycodemapdb/README 2022-07-10 10:19:10.152573436 -0500 +@@ -85,6 +85,7 @@ + - GLib2 (standard C, but with GLib2 data types) + - Python + - Perl ++ - Rust + + + Usage +diff -ru a/subprojects/keycodemapdb.old/tests/Makefile b/subprojects/keycodemapdb/tests/Makefile +--- a/subprojects/keycodemapdb.old/tests/Makefile 2021-11-17 04:24:01.168825600 -0600 ++++ b/subprojects/keycodemapdb/tests/Makefile 2022-07-10 10:19:10.152573436 -0500 +@@ -1,4 +1,4 @@ +-TESTS := stdc stdc++ python2 python3 javascript ++TESTS := stdc stdc++ python2 python3 javascript rust + + check: $(TESTS) + @set -e; for fn in $(TESTS); do \ +@@ -19,37 +19,37 @@ + osx.h osx.c osx_name.h osx_name.c + $(CC) -Wall -o $@ $(filter %.c, $^) + osx2win32.c: $(SOURCES) +- $(GEN) --lang stdc code-map $(DATA) osx win32 > $@ ++ $(GEN) code-map --lang stdc $(DATA) osx win32 > $@ + osx2win32.h: $(SOURCES) +- $(GEN) --lang stdc-header code-map $(DATA) osx win32 > $@ ++ $(GEN) code-map --lang stdc-header $(DATA) osx win32 > $@ + osx2win32_name.c: $(SOURCES) +- $(GEN) --lang stdc name-map $(DATA) osx win32 > $@ ++ $(GEN) name-map --lang stdc $(DATA) osx win32 > $@ + osx2win32_name.h: $(SOURCES) +- $(GEN) --lang stdc-header name-map $(DATA) osx win32 > $@ ++ $(GEN) name-map --lang stdc-header $(DATA) osx win32 > $@ + osx2xkb.c: $(SOURCES) +- $(GEN) --lang stdc code-map $(DATA) osx xkb > $@ ++ $(GEN) code-map --lang stdc $(DATA) osx xkb > $@ + osx2xkb.h: $(SOURCES) +- $(GEN) --lang stdc-header code-map $(DATA) osx xkb > $@ ++ $(GEN) code-map --lang stdc-header $(DATA) osx xkb > $@ + osx2xkb_name.c: $(SOURCES) +- $(GEN) --lang stdc name-map $(DATA) osx xkb > $@ ++ $(GEN) name-map --lang stdc $(DATA) osx xkb > $@ + osx2xkb_name.h: $(SOURCES) +- $(GEN) --lang stdc-header name-map $(DATA) osx xkb > $@ ++ $(GEN) name-map --lang stdc-header $(DATA) osx xkb > $@ + html2win32.c: $(SOURCES) +- $(GEN) --lang stdc code-map $(DATA) html win32 > $@ ++ $(GEN) code-map --lang stdc $(DATA) html win32 > $@ + html2win32.h: $(SOURCES) +- $(GEN) --lang stdc-header code-map $(DATA) html win32 > $@ ++ $(GEN) code-map --lang stdc-header $(DATA) html win32 > $@ + html2win32_name.c: $(SOURCES) +- $(GEN) --lang stdc name-map $(DATA) html win32 > $@ ++ $(GEN) name-map --lang stdc $(DATA) html win32 > $@ + html2win32_name.h: $(SOURCES) +- $(GEN) --lang stdc-header name-map $(DATA) html win32 > $@ ++ $(GEN) name-map --lang stdc-header $(DATA) html win32 > $@ + osx.c: $(SOURCES) +- $(GEN) --lang stdc code-table $(DATA) osx > $@ ++ $(GEN) code-table --lang stdc $(DATA) osx > $@ + osx.h: $(SOURCES) +- $(GEN) --lang stdc-header code-table $(DATA) osx > $@ ++ $(GEN) code-table --lang stdc-header $(DATA) osx > $@ + osx_name.c: $(SOURCES) +- $(GEN) --lang stdc name-table $(DATA) osx > $@ ++ $(GEN) name-table --lang stdc $(DATA) osx > $@ + osx_name.h: $(SOURCES) +- $(GEN) --lang stdc-header name-table $(DATA) osx > $@ ++ $(GEN) name-table --lang stdc-header $(DATA) osx > $@ + + stdc++: stdc++.cc osx2win32.hh osx2win32.cc osx2win32_name.hh osx2win32_name.cc \ + osx2xkb.hh osx2xkb.cc osx2xkb_name.hh osx2xkb_name.cc \ +@@ -57,58 +57,58 @@ + osx.hh osx.cc osx_name.hh osx_name.cc + $(CXX) -Wall -std=c++11 -o $@ $(filter %.cc, $^) + osx2win32.cc: $(SOURCES) +- $(GEN) --lang stdc++ code-map $(DATA) osx win32 > $@ ++ $(GEN) code-map --lang stdc++ $(DATA) osx win32 > $@ + osx2win32.hh: $(SOURCES) +- $(GEN) --lang stdc++-header code-map $(DATA) osx win32 > $@ ++ $(GEN) code-map --lang stdc++-header $(DATA) osx win32 > $@ + osx2win32_name.cc: $(SOURCES) +- $(GEN) --lang stdc++ name-map $(DATA) osx win32 > $@ ++ $(GEN) name-map --lang stdc++ $(DATA) osx win32 > $@ + osx2win32_name.hh: $(SOURCES) +- $(GEN) --lang stdc++-header name-map $(DATA) osx win32 > $@ ++ $(GEN) name-map --lang stdc++-header $(DATA) osx win32 > $@ + osx2xkb.cc: $(SOURCES) +- $(GEN) --lang stdc++ code-map $(DATA) osx xkb > $@ ++ $(GEN) code-map --lang stdc++ $(DATA) osx xkb > $@ + osx2xkb.hh: $(SOURCES) +- $(GEN) --lang stdc++-header code-map $(DATA) osx xkb > $@ ++ $(GEN) code-map --lang stdc++-header $(DATA) osx xkb > $@ + osx2xkb_name.cc: $(SOURCES) +- $(GEN) --lang stdc++ name-map $(DATA) osx xkb > $@ ++ $(GEN) name-map --lang stdc++ $(DATA) osx xkb > $@ + osx2xkb_name.hh: $(SOURCES) +- $(GEN) --lang stdc++-header name-map $(DATA) osx xkb > $@ ++ $(GEN) name-map --lang stdc++-header $(DATA) osx xkb > $@ + html2win32.cc: $(SOURCES) +- $(GEN) --lang stdc++ code-map $(DATA) html win32 > $@ ++ $(GEN) code-map --lang stdc++ $(DATA) html win32 > $@ + html2win32.hh: $(SOURCES) +- $(GEN) --lang stdc++-header code-map $(DATA) html win32 > $@ ++ $(GEN) code-map --lang stdc++-header $(DATA) html win32 > $@ + html2win32_name.cc: $(SOURCES) +- $(GEN) --lang stdc++ name-map $(DATA) html win32 > $@ ++ $(GEN) name-map --lang stdc++ $(DATA) html win32 > $@ + html2win32_name.hh: $(SOURCES) +- $(GEN) --lang stdc++-header name-map $(DATA) html win32 > $@ ++ $(GEN) name-map --lang stdc++-header $(DATA) html win32 > $@ + osx.cc: $(SOURCES) +- $(GEN) --lang stdc++ code-table $(DATA) osx > $@ ++ $(GEN) code-table --lang stdc++ $(DATA) osx > $@ + osx.hh: $(SOURCES) +- $(GEN) --lang stdc++-header code-table $(DATA) osx > $@ ++ $(GEN) code-table --lang stdc++-header $(DATA) osx > $@ + osx_name.cc: $(SOURCES) +- $(GEN) --lang stdc++ name-table $(DATA) osx > $@ ++ $(GEN) name-table --lang stdc++ $(DATA) osx > $@ + osx_name.hh: $(SOURCES) +- $(GEN) --lang stdc++-header name-table $(DATA) osx > $@ ++ $(GEN) name-table --lang stdc++-header $(DATA) osx > $@ + + python2: osx2win32.py osx2win32_name.py \ + osx2xkb.py osx2xkb_name.py \ + html2win32.py html2win32_name.py \ + osx.py osx_name.py + osx2win32.py: $(SOURCES) +- $(GEN) --lang python2 code-map $(DATA) osx win32 > $@ ++ $(GEN) code-map --lang python2 $(DATA) osx win32 > $@ + osx2win32_name.py: $(SOURCES) +- $(GEN) --lang python2 name-map $(DATA) osx win32 > $@ ++ $(GEN) name-map --lang python2 $(DATA) osx win32 > $@ + osx2xkb.py: $(SOURCES) +- $(GEN) --lang python2 code-map $(DATA) osx xkb > $@ ++ $(GEN) code-map --lang python2 $(DATA) osx xkb > $@ + osx2xkb_name.py: $(SOURCES) +- $(GEN) --lang python2 name-map $(DATA) osx xkb > $@ ++ $(GEN) name-map --lang python2 $(DATA) osx xkb > $@ + html2win32.py: $(SOURCES) +- $(GEN) --lang python2 code-map $(DATA) html win32 > $@ ++ $(GEN) code-map --lang python2 $(DATA) html win32 > $@ + html2win32_name.py: $(SOURCES) +- $(GEN) --lang python2 name-map $(DATA) html win32 > $@ ++ $(GEN) name-map --lang python2 $(DATA) html win32 > $@ + osx.py: $(SOURCES) +- $(GEN) --lang python2 code-table $(DATA) osx > $@ ++ $(GEN) code-table --lang python2 $(DATA) osx > $@ + osx_name.py: $(SOURCES) +- $(GEN) --lang python2 name-table $(DATA) osx > $@ ++ $(GEN) name-table --lang python2 $(DATA) osx > $@ + + javascript: node_modules/babel-core \ + node_modules/babel-plugin-transform-es2015-modules-commonjs \ +@@ -121,21 +121,42 @@ + node_modules/babel-plugin-transform-es2015-modules-commonjs: + npm install babel-plugin-transform-es2015-modules-commonjs + osx2win32.js: $(SOURCES) +- $(GEN) --lang js code-map $(DATA) osx win32 > $@ ++ $(GEN) code-map --lang js $(DATA) osx win32 > $@ + osx2win32_name.js: $(SOURCES) +- $(GEN) --lang js name-map $(DATA) osx win32 > $@ ++ $(GEN) name-map --lang js $(DATA) osx win32 > $@ + osx2xkb.js: $(SOURCES) +- $(GEN) --lang js code-map $(DATA) osx xkb > $@ ++ $(GEN) code-map --lang js $(DATA) osx xkb > $@ + osx2xkb_name.js: $(SOURCES) +- $(GEN) --lang js name-map $(DATA) osx xkb > $@ ++ $(GEN) name-map --lang js $(DATA) osx xkb > $@ + html2win32.js: $(SOURCES) +- $(GEN) --lang js code-map $(DATA) html win32 > $@ ++ $(GEN) code-map --lang js $(DATA) html win32 > $@ + html2win32_name.js: $(SOURCES) +- $(GEN) --lang js name-map $(DATA) html win32 > $@ ++ $(GEN) name-map --lang js $(DATA) html win32 > $@ + osx.js: $(SOURCES) +- $(GEN) --lang js code-table $(DATA) osx > $@ ++ $(GEN) code-table --lang js $(DATA) osx > $@ + osx_name.js: $(SOURCES) +- $(GEN) --lang js name-table $(DATA) osx > $@ ++ $(GEN) name-table --lang js $(DATA) osx > $@ ++ ++rust: osx2win32.rs osx2win32_name.rs \ ++ osx2xkb.rs osx2xkb_name.rs \ ++ html2win32.rs html2win32_name.rs \ ++ osx.rs osx_name.rs ++osx2win32.rs: $(SOURCES) ++ $(GEN) code-map --lang rust $(DATA) osx win32 > $@ ++osx2win32_name.rs: $(SOURCES) ++ $(GEN) name-map --lang rust $(DATA) osx win32 > $@ ++osx2xkb.rs: $(SOURCES) ++ $(GEN) code-map --lang rust $(DATA) osx xkb > $@ ++osx2xkb_name.rs: $(SOURCES) ++ $(GEN) name-map --lang rust $(DATA) osx xkb > $@ ++html2win32.rs: $(SOURCES) ++ $(GEN) code-map --lang rust $(DATA) html win32 > $@ ++html2win32_name.rs: $(SOURCES) ++ $(GEN) name-map --lang rust $(DATA) html win32 > $@ ++osx.rs: $(SOURCES) ++ $(GEN) code-table --lang rust $(DATA) osx > $@ ++osx_name.rs: $(SOURCES) ++ $(GEN) name-table --lang rust $(DATA) osx > $@ + + clean: + rm -rf node_modules +diff -ru a/subprojects/keycodemapdb.old/tools/keymap-gen b/subprojects/keycodemapdb/tools/keymap-gen +--- a/subprojects/keycodemapdb.old/tools/keymap-gen 2021-11-17 04:24:01.170825700 -0600 ++++ b/subprojects/keycodemapdb/tools/keymap-gen 2022-07-10 10:19:10.155906857 -0500 +@@ -508,7 +508,7 @@ + def _array_code_entry(self, value, name): + raise NotImplementedError() + +- def generate_name_docs(self, varname, database, mapname): ++ def generate_name_docs(self, title, subtitle, database, mapname): + if mapname not in database.mapname: + raise Exception("Unknown map %s, expected one of %s" % ( + mapname, ", ".join(database.mapname.keys()))) +@@ -517,10 +517,12 @@ + keys.sort() + names = [database.mapname[Database.MAP_LINUX].get(key, "unnamed") for key in keys] + +- if varname is None: +- varname = mapname ++ if title is None: ++ title = mapname ++ if subtitle is None: ++ subtitle = "Docs for %s" % mapname + +- self._array_start_name_doc(varname, mapname) ++ self._array_start_name_doc(title, subtitle, mapname) + + for i in range(len(keys)): + key = keys[i] +@@ -530,7 +532,7 @@ + self._array_end() + + +- def generate_code_docs(self, varname, database, mapname): ++ def generate_code_docs(self, title, subtitle, database, mapname): + if mapname not in database.mapfrom: + raise Exception("Unknown map %s, expected one of %s" % ( + mapname, ", ".join(database.mapfrom.keys()))) +@@ -545,10 +547,12 @@ + names = database.mapname[Database.MAP_LINUX] + namemap = Database.MAP_LINUX + +- if varname is None: +- varname = mapname ++ if title is None: ++ title = mapname ++ if subtitle is None: ++ subtitle = "Docs for %s" % mapname + +- self._array_start_code_doc(varname, mapname, namemap) ++ self._array_start_code_doc(title, subtitle, mapname, namemap) + + for i in range(len(keys)): + key = keys[i] +@@ -748,6 +752,54 @@ + def __init__(self): + super(StdCppHeaderLanguageGenerator, self).__init__("unsigned short", "char *", "unsigned int") + ++ ++class RustLanguageGenerator(LanguageSrcGenerator): ++ ++ def _boilerplate(self, lines): ++ print("//") ++ for line in lines: ++ print("// %s" % line) ++ print("//") ++ ++ def _array_start(self, varname, length, defvalue, fromtype, totype): ++ if fromtype == self.TYPE_ENUM: ++ raise NotImplementedError("Enums not supported as source in Rust generator") ++ ++ totypename = "&str" if totype == self.TYPE_STRING else "u16" ++ if fromtype != self.TYPE_STRING: ++ print("pub static %s: &[%s] = &[" % (varname.upper(), totypename)) ++ else: ++ print("pub static %s: phf::Map<&str, %s> = phf::phf_map! {" % ++ (varname.upper(), totypename)) ++ ++ def _array_end(self, fromtype, totype): ++ if fromtype != self.TYPE_STRING: ++ print("];") ++ else: ++ print("};") ++ ++ def _array_entry(self, index, value, comment, fromtype, totype): ++ none = "\"\"" if totype == self.TYPE_STRING else "0" ++ if fromtype == self.TYPE_INT: ++ if value is None: ++ print(" %s, // %s" % (none, comment)) ++ elif totype == self.TYPE_INT: ++ print(" 0x%x, // %s" % (value, comment)) ++ elif totype == self.TYPE_ENUM: ++ print(" %s, // %s" % (value, comment)) ++ else: ++ print(" \"%s\", // %s" % (value, comment)) ++ else: ++ if value is None: ++ print(" \"%s\" => %s, // %s" % (index, none, comment)) ++ elif totype == self.TYPE_INT: ++ print(" \"%s\" => 0x%x, // %s" % (index, value, comment)) ++ elif totype == self.TYPE_ENUM: ++ print(" \"%s\" => %s, // %s" % (index, value, comment)) ++ else: ++ print(" \"%s\" => \"%s\", // %s" % (index, value, comment)) ++ ++ + class PythonLanguageGenerator(LanguageSrcGenerator): + + def _boilerplate(self, lines): +@@ -872,10 +924,10 @@ + print("# %s" % line) + print("#") + +- def _array_start_name_doc(self, varname, namemap): ++ def _array_start_name_doc(self, title, subtitle, namemap): + print("=head1 NAME") + print("") +- print("%s" % varname) ++ print("%s - %s" % (title, subtitle)) + print("") + print("=head1 DESCRIPTION") + print("") +@@ -884,10 +936,10 @@ + print("=over 4") + print("") + +- def _array_start_code_doc(self, varname, codemap, namemap): ++ def _array_start_code_doc(self, title, subtitle, codemap, namemap): + print("=head1 NAME") + print("") +- print("%s" % varname) ++ print("%s - %s" % (title, subtitle)) + print("") + print("=head1 DESCRIPTION") + print("") +@@ -912,6 +964,63 @@ + print("Key name %s" % name) + print("") + ++class RSTLanguageGenerator(LanguageDocGenerator): ++ ++ def _boilerplate(self, lines): ++ print("..") ++ for line in lines: ++ print(" %s" % line) ++ print("") ++ ++ def _array_start_name_doc(self, title, subtitle, namemap): ++ print("=" * len(title)) ++ print(title) ++ print("=" * len(title)) ++ print("") ++ print("-" * len(subtitle)) ++ print(subtitle) ++ print("-" * len(subtitle)) ++ print("") ++ print(":Manual section: 7") ++ print(":Manual group: Virtualization Support") ++ print("") ++ print("DESCRIPTION") ++ print("===========") ++ print("List of %s key code names, with corresponding key code values" % namemap) ++ print("") ++ ++ def _array_start_code_doc(self, title, subtitle, codemap, namemap): ++ print("=" * len(title)) ++ print(title) ++ print("=" * len(title)) ++ print("") ++ print("-" * len(subtitle)) ++ print(subtitle) ++ print("-" * len(subtitle)) ++ print("") ++ print(":Manual section: 7") ++ print(":Manual group: Virtualization Support") ++ print("") ++ print("DESCRIPTION") ++ print("===========") ++ print("List of %s key code values, with corresponding %s key code names" % (codemap, namemap)) ++ print("") ++ ++ def _array_end(self): ++ print("") ++ ++ def _array_name_entry(self, value, name): ++ print("* %s" % name) ++ print("") ++ print(" Key value %d (0x%x)" % (value, value)) ++ print("") ++ ++ def _array_code_entry(self, value, name): ++ print("* %d (0x%x)" % (value, value)) ++ print("") ++ print(" Key name %s" % name) ++ print("") ++ + SRC_GENERATORS = { + "stdc": StdCLanguageGenerator(), + "stdc-header": StdCHeaderLanguageGenerator(), +@@ -923,19 +1032,21 @@ + "python3": PythonLanguageGenerator(), + "perl": PerlLanguageGenerator(), + "js": JavaScriptLanguageGenerator(), ++ "rust": RustLanguageGenerator(), + } + DOC_GENERATORS = { + "pod": PodLanguageGenerator(), ++ "rst": RSTLanguageGenerator(), + } + + def code_map(args): + database = Database() + database.load(args.keymaps) + +- cliargs = ["keymap-gen", "--lang=%s" % args.lang] ++ cliargs = ["keymap-gen", "code-map", "--lang=%s" % args.lang] + if args.varname is not None: + cliargs.append("--varname=%s" % args.varname) +- cliargs.extend(["code-map", "keymaps.csv", args.frommapname, args.tomapname]) ++ cliargs.extend(["keymaps.csv", args.frommapname, args.tomapname]) + SRC_GENERATORS[args.lang].generate_header(database, " ".join(cliargs)) + + SRC_GENERATORS[args.lang].generate_code_map(args.varname, database, args.frommapname, args.tomapname) +@@ -944,10 +1055,10 @@ + database = Database() + database.load(args.keymaps) + +- cliargs = ["keymap-gen", "--lang=%s" % args.lang] ++ cliargs = ["keymap-gen", "code-table", "--lang=%s" % args.lang] + if args.varname is not None: + cliargs.append("--varname=%s" % args.varname) +- cliargs.extend(["code-table", "keymaps.csv", args.mapname]) ++ cliargs.extend(["keymaps.csv", args.mapname]) + SRC_GENERATORS[args.lang].generate_header(database, " ".join(cliargs)) + + SRC_GENERATORS[args.lang].generate_code_table(args.varname, database, args.mapname) +@@ -956,10 +1067,10 @@ + database = Database() + database.load(args.keymaps) + +- cliargs = ["keymap-gen", "--lang=%s" % args.lang] ++ cliargs = ["keymap-gen", "name-map", "--lang=%s" % args.lang] + if args.varname is not None: + cliargs.append("--varname=%s" % args.varname) +- cliargs.extend(["name-map", "keymaps.csv", args.frommapname, args.tomapname]) ++ cliargs.extend(["keymaps.csv", args.frommapname, args.tomapname]) + SRC_GENERATORS[args.lang].generate_header(database, " ".join(cliargs)) + + SRC_GENERATORS[args.lang].generate_name_map(args.varname, database, args.frommapname, args.tomapname) +@@ -969,10 +1080,10 @@ + database.load(args.keymaps) + + +- cliargs = ["keymap-gen", "--lang=%s" % args.lang] ++ cliargs = ["keymap-gen", "name-table", "--lang=%s" % args.lang] + if args.varname is not None: + cliargs.append("--varname=%s" % args.varname) +- cliargs.extend(["name-table", "keymaps.csv", args.mapname]) ++ cliargs.extend(["keymaps.csv", args.mapname]) + SRC_GENERATORS[args.lang].generate_header(database, " ".join(cliargs)) + + SRC_GENERATORS[args.lang].generate_name_table(args.varname, database, args.mapname) +@@ -982,26 +1093,30 @@ + database.load(args.keymaps) + + +- cliargs = ["keymap-gen", "--lang=%s" % args.lang] +- if args.varname is not None: +- cliargs.append("--varname=%s" % args.varname) +- cliargs.extend(["code-docs", "keymaps.csv", args.mapname]) ++ cliargs = ["keymap-gen", "code-docs", "--lang=%s" % args.lang] ++ if args.title is not None: ++ cliargs.append("--title=%s" % args.title) ++ if args.subtitle is not None: ++ cliargs.append("--subtitle=%s" % args.subtitle) ++ cliargs.extend(["keymaps.csv", args.mapname]) + DOC_GENERATORS[args.lang].generate_header(database, " ".join(cliargs)) + +- DOC_GENERATORS[args.lang].generate_code_docs(args.varname, database, args.mapname) ++ DOC_GENERATORS[args.lang].generate_code_docs(args.title, args.subtitle, database, args.mapname) + + def name_docs(args): + database = Database() + database.load(args.keymaps) + + +- cliargs = ["keymap-gen", "--lang=%s" % args.lang] +- if args.varname is not None: +- cliargs.append("--varname=%s" % args.varname) +- cliargs.extend(["name-docs", "keymaps.csv", args.mapname]) ++ cliargs = ["keymap-gen", "name-docs", "--lang=%s" % args.lang] ++ if args.title is not None: ++ cliargs.append("--title=%s" % args.title) ++ if args.subtitle is not None: ++ cliargs.append("--subtitle=%s" % args.subtitle) ++ cliargs.extend(["keymaps.csv", args.mapname]) + DOC_GENERATORS[args.lang].generate_header(database, " ".join(cliargs)) + +- DOC_GENERATORS[args.lang].generate_name_docs(args.varname, database, args.mapname) ++ DOC_GENERATORS[args.lang].generate_name_docs(args.title, args.subtitle, database, args.mapname) + + def usage(): + print ("Please select a command:") +@@ -1011,43 +1126,62 @@ + def main(): + parser = argparse.ArgumentParser() + +- parser.add_argument("--lang", default="stdc", +- help="Output language, (src=%s, doc=%s)" % ( +- ",".join(SRC_GENERATORS.keys()), +- ",".join(DOC_GENERATORS.keys()))) +- parser.add_argument("--varname", default=None, +- help="Data variable name") +- + subparsers = parser.add_subparsers(help="sub-command help") + + codemapparser = subparsers.add_parser("code-map", help="Generate a mapping between code tables") ++ codemapparser.add_argument("--varname", default=None, help="Data variable name") ++ codemapparser.add_argument("--lang", default="stdc", ++ help="Output language (%s)" % ( ++ ",".join(SRC_GENERATORS.keys()))) + codemapparser.add_argument("keymaps", help="Path to keymap CSV data file") + codemapparser.add_argument("frommapname", help="Source code table name") + codemapparser.add_argument("tomapname", help="Target code table name") + codemapparser.set_defaults(func=code_map) + + codetableparser = subparsers.add_parser("code-table", help="Generate a flat code table") ++ codetableparser.add_argument("--lang", default="stdc", ++ help="Output language (%s)" % ( ++ ",".join(SRC_GENERATORS.keys()))) ++ codetableparser.add_argument("--varname", default=None, help="Data variable name") + codetableparser.add_argument("keymaps", help="Path to keymap CSV data file") + codetableparser.add_argument("mapname", help="Code table name") + codetableparser.set_defaults(func=code_table) + + namemapparser = subparsers.add_parser("name-map", help="Generate a mapping to names") ++ namemapparser.add_argument("--lang", default="stdc", ++ help="Output language (%s)" % ( ++ ",".join(SRC_GENERATORS.keys()))) ++ namemapparser.add_argument("--varname", default=None, help="Data variable name") + namemapparser.add_argument("keymaps", help="Path to keymap CSV data file") + namemapparser.add_argument("frommapname", help="Source code table name") + namemapparser.add_argument("tomapname", help="Target name table name") + namemapparser.set_defaults(func=name_map) + + nametableparser = subparsers.add_parser("name-table", help="Generate a flat name table") ++ nametableparser.add_argument("--lang", default="stdc", ++ help="Output language, (%s)" % ( ++ ",".join(SRC_GENERATORS.keys()))) ++ nametableparser.add_argument("--varname", default=None, help="Data variable name") + nametableparser.add_argument("keymaps", help="Path to keymap CSV data file") + nametableparser.add_argument("mapname", help="Name table name") + nametableparser.set_defaults(func=name_table) + + codedocsparser = subparsers.add_parser("code-docs", help="Generate code documentation") ++ codedocsparser.add_argument("--lang", default="pod", ++ help="Output language (%s)" % ( ++ ",".join(DOC_GENERATORS.keys()))) ++ codedocsparser.add_argument("--title", default=None, help="Document title") ++ codedocsparser.add_argument("--subtitle", default=None, help="Document subtitle") + codedocsparser.add_argument("keymaps", help="Path to keymap CSV data file") + codedocsparser.add_argument("mapname", help="Code table name") + codedocsparser.set_defaults(func=code_docs) + + namedocsparser = subparsers.add_parser("name-docs", help="Generate name documentation") ++ namedocsparser.add_argument("--lang", default="pod", ++ help="Output language (%s)" % ( ++ ",".join(DOC_GENERATORS.keys()))) ++ namedocsparser.add_argument("--title", default=None, help="Document title") ++ namedocsparser.add_argument("--subtitle", default=None, help="Document subtitle") + namedocsparser.add_argument("keymaps", help="Path to keymap CSV data file") + namedocsparser.add_argument("mapname", help="Name table name") + namedocsparser.set_defaults(func=name_docs) -- cgit v1.2.3