diff options
-rw-r--r-- | configure.ac | 15 | ||||
-rwxr-xr-x | gen_tables.sh | 5 | ||||
-rwxr-xr-x | make_tizen_keymap.sh | 62 | ||||
-rw-r--r-- | packaging/libxkbcommon.spec | 17 | ||||
-rw-r--r-- | xkbcommon-uninstalled.pc.in | 2 | ||||
-rw-r--r-- | xkbcommon-x11-uninstalled.pc.in | 2 | ||||
-rw-r--r-- | xkbcommon-x11.pc.in | 2 | ||||
-rw-r--r-- | xkbcommon.pc.in | 2 |
8 files changed, 102 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index ee94581..fda13fa 100644 --- a/configure.ac +++ b/configure.ac @@ -150,6 +150,13 @@ AS_IF([test "x$DEFAULT_XKB_OPTIONS" != x], [ [Default XKB options]) ]) +AC_ARG_WITH(tizen_profile, + [AS_HELP_STRING([--with-tizen-profile=PROFILE], + [Tizen Profile (default: (common))])], + tizen_profile="$withval", + tizen_profile="common" +) + AC_ARG_ENABLE([x11], [AS_HELP_STRING([--disable-x11], [Disable support for creating keymaps with the X11 protocol (default: enabled)])], @@ -161,6 +168,14 @@ You can disable X11 support with --disable-x11.])]) ], [enable_x11=no]) AM_CONDITIONAL([ENABLE_X11], [test "x$enable_x11" = xyes]) +AC_SUBST(tizen_profile) +AM_CONDITIONAL(TIZEN_COMMON_PROFILE, test "${tizen_profile}" = "common") +if test "${tizen_profile}" = "common"; then + TIZEN_COMMON_CFLAGS="-D_F_TIZEN_COMMON_PROFILE_" + AC_SUBST(TIZEN_COMMON_CFLAGS) + CFLAGS+=" ${TIZEN_COMMON_CFLAGS} " +fi + AC_CONFIG_FILES([ Makefile xkbcommon-uninstalled.pc diff --git a/gen_tables.sh b/gen_tables.sh new file mode 100755 index 0000000..2661cf9 --- /dev/null +++ b/gen_tables.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +BASE_HEADER_FILE="./xkbcommon/xkbcommon-keysyms.h" + +LC_CTYPE=C python ./makekeys.py ${BASE_HEADER_FILE} > ./src/ks_tables.h diff --git a/make_tizen_keymap.sh b/make_tizen_keymap.sh new file mode 100755 index 0000000..8617112 --- /dev/null +++ b/make_tizen_keymap.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +KEYMAP_FILE_PATH="/usr/share/X11/xkb/tizen_key_layout.txt" +BASE_KEYSYM="0x10090000" +TARGET_HEADER_FILE="./xkbcommon/tizen_keymap.h" +TEMP_TEXT_FILE="./temp_file.txt" +NEW_DEFINE_SYM_FILE="./new_define_sym.txt" +KEYMAP_HEADER_FILE="./xkbcommon/xkbcommon-keysyms.h" +cout=1 +BASE_KEYSYM_DEC=`python -c "print int('$BASE_KEYSYM', 16)"` + +if [ -e ${KEYMAP_FILE_PATH} ] +then + echo "${TIZEN_PROFILE} have a key layout file: ${KEYMAP_FILE_PATH}" +else + echo "${TIZEN_PROFILE} doesn't have a key layout file: ${KEYMAP_FILE_PATH}" + exit +fi + +echo "Generate a tizen keymap header file" + +while read KEYNAME KEYCODE +do + KEYSYM="XKB_KEY_${KEYNAME}" + grep -rn "${KEYSYM}" $KEYMAP_HEADER_FILE > $TEMP_TEXT_FILE + FINDED_DEFINE=`cat temp_file.txt | awk '{print $2}'` + + BOOL_FOUND_SYM=false + for SEARCH_SYM in ${FINDED_DEFINE} + do + if [ "$SEARCH_SYM" = "$KEYSYM" ] + then + BOOL_FOUND_SYM=true + break + fi + done + if [ "$BOOL_FOUND_SYM" = false ] + then + echo "${KEYSYM}" >> $NEW_DEFINE_SYM_FILE + fi +done < ${KEYMAP_FILE_PATH} + +sed -i '$s/#endif//g' ${KEYMAP_HEADER_FILE} +echo "/**************************************************************" >> ${KEYMAP_HEADER_FILE} +echo " * These keys defined for tizen platform." >> ${KEYMAP_HEADER_FILE} +echo " * Key symbols are defined by keymap builder." >> ${KEYMAP_HEADER_FILE} +echo " */" >> ${KEYMAP_HEADER_FILE} + +while read KEYNAME +do + KEYSYM_DEC=$(echo $BASE_KEYSYM_DEC $cout | awk '{print $1 + $2}') + KEYSYM=$(printf "%x" $KEYSYM_DEC) + echo -en "#define ${KEYNAME}\t\t0x$KEYSYM\n" >> ${KEYMAP_HEADER_FILE} + cout=$(echo $cout 1 | awk '{print $1 + $2}') +done < ${NEW_DEFINE_SYM_FILE} + +echo "" >> ${KEYMAP_HEADER_FILE} +echo "" >> ${KEYMAP_HEADER_FILE} +echo "#endif" >> ${KEYMAP_HEADER_FILE} + +rm $NEW_DEFINE_SYM_FILE +rm $TEMP_TEXT_FILE diff --git a/packaging/libxkbcommon.spec b/packaging/libxkbcommon.spec index e3f4d18..6fe3e0b 100644 --- a/packaging/libxkbcommon.spec +++ b/packaging/libxkbcommon.spec @@ -15,6 +15,11 @@ BuildRequires: bison BuildRequires: flex BuildRequires: libtool >= 2 BuildRequires: pkgconfig(xorg-macros) >= 1.8 +%if "%{?profile}" == "common" +%else +BuildRequires: python +BuildRequires: e-tizen-data +%endif %description Keyboard handling library using XKB data. @@ -34,8 +39,18 @@ in %{name}. %setup -qn %{name} cp %{SOURCE1001} . +# Generate tizen keymap header except common profile +%if "%{?profile}" == "common" +%else +export TIZEN_PROFILE="%{?profile}" +chmod a+x ./make_tizen_keymap.sh +./make_tizen_keymap.sh +chmod a+x ./gen_tables.sh +./gen_tables.sh +%endif + %build -%autogen --disable-static --disable-x11 +%autogen --disable-static --disable-x11 --with-tizen-profile="%{?profile}" %__make %{?_smp_mflags} V=1; %install diff --git a/xkbcommon-uninstalled.pc.in b/xkbcommon-uninstalled.pc.in index d4d6a2b..789c2fe 100644 --- a/xkbcommon-uninstalled.pc.in +++ b/xkbcommon-uninstalled.pc.in @@ -4,5 +4,5 @@ includedir=@abs_top_srcdir@ Name: xkbcommon Description: XKB API common to servers and clients (uninstalled) Version: @PACKAGE_VERSION@ -Cflags: -I${includedir} +Cflags: -I${includedir} @TIZEN_COMMON_CFLAGS@ Libs: -L${libdir} -lxkbcommon diff --git a/xkbcommon-x11-uninstalled.pc.in b/xkbcommon-x11-uninstalled.pc.in index d99ca49..0c64dfe 100644 --- a/xkbcommon-x11-uninstalled.pc.in +++ b/xkbcommon-x11-uninstalled.pc.in @@ -6,5 +6,5 @@ Description: XKB API common to servers and clients - X11 support (uninstalled) Version: @PACKAGE_VERSION@ Requires: xkbcommon Requires.private: xcb xcb-xkb -Cflags: -I${includedir} +Cflags: -I${includedir} @TIZEN_COMMON_CFLAGS@ Libs: -L${libdir} -lxkbcommon-x11 diff --git a/xkbcommon-x11.pc.in b/xkbcommon-x11.pc.in index c4efc43..922f35a 100644 --- a/xkbcommon-x11.pc.in +++ b/xkbcommon-x11.pc.in @@ -8,5 +8,5 @@ Description: XKB API common to servers and clients - X11 support Version: @PACKAGE_VERSION@ Requires: xkbcommon Requires.private: xcb xcb-xkb -Cflags: -I${includedir} +Cflags: -I${includedir} @TIZEN_COMMON_CFLAGS@ Libs: -L${libdir} -lxkbcommon-x11 diff --git a/xkbcommon.pc.in b/xkbcommon.pc.in index 17e1172..2e9a8bd 100644 --- a/xkbcommon.pc.in +++ b/xkbcommon.pc.in @@ -6,5 +6,5 @@ includedir=@includedir@ Name: xkbcommon Description: XKB API common to servers and clients Version: @PACKAGE_VERSION@ -Cflags: -I${includedir} +Cflags: -I${includedir} @TIZEN_COMMON_CFLAGS@ Libs: -L${libdir} -lxkbcommon |