From e1eed5190b6285941df69959e479e4273438d3e2 Mon Sep 17 00:00:00 2001 From: Alastair Poole Date: Mon, 12 Apr 2021 12:47:27 +0100 Subject: [PATCH] freebsd: make elput optional. --- confs/freebsd.sh | 2 +- meson.build | 6 +++++- meson_options.txt | 5 +++++ src/bin/e_gesture.c | 4 ++++ src/bin/e_gesture.h | 4 ++++ src/bin/e_main.c | 3 ++- src/modules/conf_bindings/e_mod_main.c | 2 ++ src/modules/conf_bindings/meson.build | 5 +++-- 8 files changed, 26 insertions(+), 5 deletions(-) diff --git a/confs/freebsd.sh b/confs/freebsd.sh index 6d108a51f..32d73f18b 100755 --- a/confs/freebsd.sh +++ b/confs/freebsd.sh @@ -1,3 +1,3 @@ #!/bin/sh -e -meson -Dsystemd=false -Ddevice-udev=false -Dgesture-recognition=false \ +meson -Dsystemd=false -Delput=false -Ddevice-udev=false -Dgesture-recognition=false \ $@ . build diff --git a/meson.build b/meson.build index fb3749bb3..c82233b1a 100644 --- a/meson.build +++ b/meson.build @@ -309,7 +309,7 @@ dep_eo = dependency('eo' , required: true) dep_eldbus = dependency('eldbus' , required: true) dep_emotion = dependency('emotion' , required: true) dep_elementary = dependency('elementary' , required: true) -dep_elput = dependency('elput' , required: true) +dep_elput = dependency('elput' , required: false) dep_wayland = [] if get_option('wl') == true @@ -361,6 +361,10 @@ else dep_ecore_x = dependency('ecore-x') endif +if get_option('elput') == true + config_h.set('HAVE_ELPUT', '1') +endif + dep_xkeyboard_config = dependency('xkeyboard-config', required: false) if dep_xkeyboard_config.found() == true config_h.set_quoted('XKB_BASE', dep_xkeyboard_config.get_pkgconfig_variable('xkb_base')) diff --git a/meson_options.txt b/meson_options.txt index b214df80f..ce0f88d69 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -40,6 +40,11 @@ option('libexif', value: true, description: 'enable EXIF support: (default=true)') +option('elput', + type: 'boolean', + value: true, + description: 'enable elput support: (default=true)') + option('device-udev', type: 'boolean', value: true, diff --git a/src/bin/e_gesture.c b/src/bin/e_gesture.c index 94622836d..35eb9744c 100644 --- a/src/bin/e_gesture.c +++ b/src/bin/e_gesture.c @@ -1,3 +1,5 @@ +#ifdef HAVE_ELPUT + #include #include #include @@ -247,3 +249,5 @@ e_bindings_gesture_capable_devices_get(void) { return gesture_capable_devices; } + +#endif diff --git a/src/bin/e_gesture.h b/src/bin/e_gesture.h index 0593ec472..56d37c4a6 100644 --- a/src/bin/e_gesture.h +++ b/src/bin/e_gesture.h @@ -1,3 +1,5 @@ +#ifdef HAVE_ELPUT + #ifdef E_TYPEDEFS typedef void (*E_Bindings_Swipe_Live_Update)(void *data, Eina_Bool end, double direction, double length, double error, unsigned int fingers); @@ -11,3 +13,5 @@ E_API void e_bindings_swipe_live_update_hook_set(E_Bindings_Swipe_Live_Update up E_API int e_bindings_gesture_capable_devices_get(void); #endif #endif + +#endif diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 2fdaeee17..ec3076280 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -1053,11 +1053,12 @@ main(int argc, char **argv) TS("E_Comp_Canvas Keys Grab"); e_comp_canvas_keys_grab(); TS("E_Comp_Canvas Keys Grab Done"); - +#ifdef HAVE_ELPUT TS("E_Gesture Init"); e_gesture_init(); TS("E_Gesture Init Done"); _e_main_shutdown_push(e_gesture_shutdown); +#endif TS("Run Startup Apps"); if (!nostartup) diff --git a/src/modules/conf_bindings/e_mod_main.c b/src/modules/conf_bindings/e_mod_main.c index 8800faed8..41de4d67b 100644 --- a/src/modules/conf_bindings/e_mod_main.c +++ b/src/modules/conf_bindings/e_mod_main.c @@ -33,10 +33,12 @@ e_modapi_init(E_Module *m) _("Edge Bindings"), NULL, "preferences-desktop-edge-bindings", e_int_config_edgebindings); +#ifdef HAVE_ELPUT e_configure_registry_item_add("keyboard_and_mouse/swipe_bindings", 10, _("Swipe Bindings"), NULL, "preferences-desktop-swipe-bindings", e_int_config_swipebindings); +#endif e_configure_registry_category_add("advanced", 80, _("Advanced"), NULL, "preferences-advanced"); e_configure_registry_item_add("advanced/signal_bindings", 10, diff --git a/src/modules/conf_bindings/meson.build b/src/modules/conf_bindings/meson.build index ee1adad55..9a2b9ca2a 100644 --- a/src/modules/conf_bindings/meson.build +++ b/src/modules/conf_bindings/meson.build @@ -5,8 +5,9 @@ src = files( 'e_int_config_keybindings.c', 'e_int_config_mousebindings.c', 'e_int_config_signalbindings.c', - 'e_int_config_swipebindings.c', 'e_mod_main.h' ) - +if get_option('gesture-recognition') == true + src += files('e_int_config_swipebindings.c') +endif desktop_only = true