From df640108df54cb29f28aabd3ac3040338729cd5a Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Sat, 9 Sep 2023 20:18:39 +0300 Subject: [PATCH 01/16] removing the inf loop, and changing the idle check logic. --- client/hostinfo_unix.cpp | 87 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index cec9401f5f7..3b88418b14e 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -179,6 +179,13 @@ extern "C" { // #if (defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(__HAIKU__) #define LINUX_LIKE_SYSTEM 1 +#include +#include +#include +// #include || alraedy included +#include +// #include || already included + #endif #if WASM @@ -2003,6 +2010,86 @@ const vector X_display_values_initialize() { return display_values; } +// call example: +// long linuxIdleTimeInSeconds = linuxGetIdleTimeInSeconds(&linuxLastSeen); +time_t linuxLastSeen = time(nullptr); +long linuxGetIdleTimeInSeconds(time_t *lastSeen) +{ + long idleTime = 0; + // Use glob to enumerate input devices in /dev/input/ + glob_t globbuf; + if (glob("/dev/input/event*", GLOB_NOSORT, nullptr, &globbuf) != 0) + { + std::cerr << "Failed to enumerate input devices. " << std::endl; + + return 0; + } + + // Create libevdev structures for each device + libevdev *devices[globbuf.gl_pathc]; + + // Open and initialize each device + for (size_t i = 0; i < globbuf.gl_pathc; ++i) + { + const char *devicePath = globbuf.gl_pathv[i]; + int fd = open(devicePath, O_RDONLY | O_NONBLOCK); + if (fd < 0) + { + std::cerr << "Failed to open device (Permission denied?): " << devicePath << std::endl; + return 0; + } + + if (libevdev_new_from_fd(fd, &devices[i]) < 0) + { + std::cerr << "Failed to initialize libevdev for device: " << devicePath << std::endl; + return 0; + } + } + bool systemInUse = false; + // Read events from all devices + for (size_t i = 0; i < globbuf.gl_pathc; ++i) + { + struct input_event ev; + int rc; + + while ((rc = libevdev_next_event(devices[i], LIBEVDEV_READ_FLAG_NORMAL, &ev)) == 1) + { + // Handle input events as needed + // For this example, we simply print event information + std::cout << "Event type: " << ev.type << ", code: " << ev.code << ", value: " << ev.value << std::endl; + + // Set systemInUse to true if an event is detected + systemInUse = true; + } + + if (rc < 0 && rc != -EAGAIN) + { + std::cerr << "Error reading from device: " << globbuf.gl_pathv[i] << std::endl; + return 0; + } + } + if (systemInUse) + { + std::cout << "System is being used." << std::endl; + *lastSeen = time(nullptr); + idleTime = 0; + } + else + { + std::cout << "System is not being used." << std::endl; + idleTime = time(nullptr) - *lastSeen; + } + // You can add a sleep here to reduce CPU usage + printf("Idle time: %ld\n", idleTime); + for (size_t i = 0; i < globbuf.gl_pathc; ++i) + { + libevdev_free(devices[i]); + } + globfree(&globbuf); + + return idleTime; +} + // Ask the X server for user idle time (using XScreenSaver API) // Return min of idle times. // This function assumes that the boinc user has been From 59b9e9be1257fd85507ce02b6cd4d9538bce5f49 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Sat, 9 Sep 2023 21:10:10 +0300 Subject: [PATCH 02/16] using msg_printf instead of the direct std:: calls --- client/hostinfo_unix.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index 3b88418b14e..45d50f76928 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -2020,7 +2020,9 @@ long linuxGetIdleTimeInSeconds(time_t *lastSeen) glob_t globbuf; if (glob("/dev/input/event*", GLOB_NOSORT, nullptr, &globbuf) != 0) { - std::cerr << "Failed to enumerate input devices. " << std::endl; + msg_printf(NULL, MSG_INFO, + "[idle_detection] Failed to enumerate input devices." + ); return 0; } @@ -2035,13 +2037,17 @@ long linuxGetIdleTimeInSeconds(time_t *lastSeen) int fd = open(devicePath, O_RDONLY | O_NONBLOCK); if (fd < 0) { - std::cerr << "Failed to open device (Permission denied?): " << devicePath << std::endl; + msg_printf(NULL, MSG_INFO, + "[idle_detection] Failed to open device (Permission denied?): %s", devicePath + ); return 0; } if (libevdev_new_from_fd(fd, &devices[i]) < 0) { - std::cerr << "Failed to initialize libevdev for device: " << devicePath << std::endl; + msg_printf(NULL, MSG_INFO, + "[idle_detection] Failed to initialize libevdev for device: %s", devicePath + ); return 0; } } @@ -2056,7 +2062,10 @@ long linuxGetIdleTimeInSeconds(time_t *lastSeen) { // Handle input events as needed // For this example, we simply print event information - std::cout << "Event type: " << ev.type << ", code: " << ev.code << ", value: " << ev.value << std::endl; + msg_printf(NULL, MSG_INFO, + "[idle_detection] Event type: %d, code: %d, value: %d", + ev.type, ev.code, ev.value + ); // Set systemInUse to true if an event is detected systemInUse = true; @@ -2064,19 +2073,25 @@ long linuxGetIdleTimeInSeconds(time_t *lastSeen) if (rc < 0 && rc != -EAGAIN) { - std::cerr << "Error reading from device: " << globbuf.gl_pathv[i] << std::endl; + msg_printf(NULL, MSG_INFO, + "[idle_detection] Error reading from device: %s", globbuf.gl_pathv[i] + ); return 0; } } if (systemInUse) { - std::cout << "System is being used." << std::endl; + msg_printf(NULL, MSG_INFO, + "[idle_detection] System is being used." + ); *lastSeen = time(nullptr); idleTime = 0; } else { - std::cout << "System is not being used." << std::endl; + msg_printf(NULL, MSG_INFO, + "[idle_detection] System is not being used." + ); idleTime = time(nullptr) - *lastSeen; } // You can add a sleep here to reduce CPU usage From 3b3d4e94c49f0936ff49dce2d3f03b41fcb1f8da Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Sun, 10 Sep 2023 15:13:03 +0300 Subject: [PATCH 03/16] adding libevdev-dev to github client packages to be installed --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c4461df8f08..d9750dfae04 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -50,7 +50,7 @@ jobs: - name: Install dependencies run: | sudo apt-get -qq update - sudo apt-get install -y libftgl-dev freeglut3-dev libcurl4-openssl-dev libxmu-dev libxi-dev libfcgi-dev libxss-dev libnotify-dev libxcb-util0-dev libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev libwebkit2gtk-4.0-dev p7zip-full libxxf86vm-dev ocl-icd-opencl-dev zip + sudo apt-get install -y libftgl-dev freeglut3-dev libcurl4-openssl-dev libxmu-dev libxi-dev libfcgi-dev libxss-dev libnotify-dev libxcb-util0-dev libgtk-3-dev libsecret-1-dev libgcrypt20-dev libsystemd-dev libwebkit2gtk-4.0-dev p7zip-full libxxf86vm-dev ocl-icd-opencl-dev zip libevdev-dev - name: Install dependencies for arm64 if: success() && endsWith(matrix.type, 'arm64') From 00988e004d021c528aba167daad9ad43e54a2244 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Sun, 10 Sep 2023 18:16:56 +0300 Subject: [PATCH 04/16] fixing libedev includes --- client/hostinfo_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index 45d50f76928..cdf2e9e57fb 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -180,7 +180,7 @@ extern "C" { #if (defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(__HAIKU__) #define LINUX_LIKE_SYSTEM 1 #include -#include +#include #include // #include || alraedy included #include From f49eb5fb269c1f00ef4b871ec52fc75c473df255 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Sun, 10 Sep 2023 18:41:28 +0300 Subject: [PATCH 05/16] remove unsed include libevdev-uinput --- client/hostinfo_unix.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index cdf2e9e57fb..06f5663a32c 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -180,7 +180,6 @@ extern "C" { #if (defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(__HAIKU__) #define LINUX_LIKE_SYSTEM 1 #include -#include #include // #include || alraedy included #include From 25c17a7a0aae43a8b3d3f09038f31099381e7ac0 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Sun, 10 Sep 2023 18:43:37 +0300 Subject: [PATCH 06/16] running trailing_whitespaces_check.py to fix trailing spaces on hostinfo_unix --- client/hostinfo_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index 06f5663a32c..d664ff8d8d4 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -181,7 +181,7 @@ extern "C" { #define LINUX_LIKE_SYSTEM 1 #include #include -// #include || alraedy included +// #include || alraedy included #include // #include || already included From 705549959520539d66c01089c6564947fb970a9b Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Sun, 10 Sep 2023 21:51:21 +0300 Subject: [PATCH 07/16] modifying the logic for checking IDLE time to make it more accurate, efficient and optimized. --- client/hostinfo_unix.cpp | 101 ++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 59 deletions(-) diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index d664ff8d8d4..4a808ca6fd5 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -181,10 +181,11 @@ extern "C" { #define LINUX_LIKE_SYSTEM 1 #include #include -// #include || alraedy included +// variables for getting linux IDLE time on linux. +size_t deviceCount = 0; +libevdev* devices[256]; // Assuming a maximum of 256 input devices +time_t linuxUserLastSeen = time(nullptr); #include -// #include || already included - #endif #if WASM @@ -2009,101 +2010,83 @@ const vector X_display_values_initialize() { return display_values; } +// Function to initialize libevdev for all input devices in /dev/input/ on linux systems // call example: -// long linuxIdleTimeInSeconds = linuxGetIdleTimeInSeconds(&linuxLastSeen); -time_t linuxLastSeen = time(nullptr); -long linuxGetIdleTimeInSeconds(time_t *lastSeen) -{ - long idleTime = 0; +// long linuxIdleTimeInSeconds = checkLinuxInputEventsAndGetIdleTime(&linuxUserLastSeen); +bool initializeLinuxInputDevices(libevdev** devices, size_t* deviceCount) { // Use glob to enumerate input devices in /dev/input/ glob_t globbuf; - if (glob("/dev/input/event*", GLOB_NOSORT, nullptr, &globbuf) != 0) - { + if (glob("/dev/input/event*", GLOB_NOSORT, nullptr, &globbuf) != 0) { msg_printf(NULL, MSG_INFO, "[idle_detection] Failed to enumerate input devices." ); - - return 0; + return false; } - // Create libevdev structures for each device - libevdev *devices[globbuf.gl_pathc]; - + *deviceCount = globbuf.gl_pathc; // Open and initialize each device - for (size_t i = 0; i < globbuf.gl_pathc; ++i) - { - const char *devicePath = globbuf.gl_pathv[i]; + for (size_t i = 0; i < *deviceCount; ++i) { + const char* devicePath = globbuf.gl_pathv[i]; int fd = open(devicePath, O_RDONLY | O_NONBLOCK); - if (fd < 0) - { + if (fd < 0) { msg_printf(NULL, MSG_INFO, - "[idle_detection] Failed to open device (Permission denied?): %s", devicePath + "[idle_detection] Failed to open device: %s", devicePath ); - return 0; + return false; } - if (libevdev_new_from_fd(fd, &devices[i]) < 0) - { + if (libevdev_new_from_fd(fd, &devices[i]) < 0) { msg_printf(NULL, MSG_INFO, "[idle_detection] Failed to initialize libevdev for device: %s", devicePath ); - return 0; + return false; } } + + // Free the glob buffer + globfree(&globbuf); + + return true; +} + +// Function to check input events and calculate idle time for linux systems +long checkLinuxInputEventsAndGetIdleTime(libevdev** devices, size_t deviceCount, time_t* lastSeen) { + long idleTime = 0; bool systemInUse = false; + // Read events from all devices - for (size_t i = 0; i < globbuf.gl_pathc; ++i) - { + for (size_t i = 0; i < deviceCount; ++i) { struct input_event ev; int rc; - while ((rc = libevdev_next_event(devices[i], LIBEVDEV_READ_FLAG_NORMAL, &ev)) == 1) - { - // Handle input events as needed - // For this example, we simply print event information - msg_printf(NULL, MSG_INFO, - "[idle_detection] Event type: %d, code: %d, value: %d", - ev.type, ev.code, ev.value - ); - + while ((rc = libevdev_next_event(devices[i], LIBEVDEV_READ_FLAG_NORMAL, &ev)) >= 0) { // Set systemInUse to true if an event is detected systemInUse = true; } - if (rc < 0 && rc != -EAGAIN) - { - msg_printf(NULL, MSG_INFO, - "[idle_detection] Error reading from device: %s", globbuf.gl_pathv[i] - ); + if (rc < 0 && rc != -EAGAIN) { return 0; } } - if (systemInUse) - { - msg_printf(NULL, MSG_INFO, - "[idle_detection] System is being used." - ); + + if (systemInUse) { *lastSeen = time(nullptr); idleTime = 0; - } - else - { - msg_printf(NULL, MSG_INFO, - "[idle_detection] System is not being used." - ); + } else { idleTime = time(nullptr) - *lastSeen; } - // You can add a sleep here to reduce CPU usage - printf("Idle time: %ld\n", idleTime); - for (size_t i = 0; i < globbuf.gl_pathc; ++i) - { - libevdev_free(devices[i]); - } - globfree(&globbuf); return idleTime; } +void cleanupLinuxInputDevices(libevdev** devices, size_t deviceCount) { + // Close and free libevdev structures + for (size_t i = 0; i < deviceCount; ++i) { + libevdev_free(devices[i]); + } +} + + // Ask the X server for user idle time (using XScreenSaver API) // Return min of idle times. // This function assumes that the boinc user has been From 533ee08c2b2a9fab33e7ea8ccd8d180f29ee7bf2 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Mon, 11 Sep 2023 00:26:14 +0300 Subject: [PATCH 08/16] adding levdev linker to --- configure.ac | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 7fc01b960af..f32db5b1682 100644 --- a/configure.ac +++ b/configure.ac @@ -1153,6 +1153,11 @@ dnl ====================================================================== CLIENTLIBS= +# Check for libevdev library +AC_CHECK_LIB([evdev], [libevdev_new_from_fd], + [CLIENTLIBS="$CLIENTLIBS -levdev"], + [AC_MSG_ERROR([libevdev library not found.])]) + SAH_CHECK_LIB([m],[sin], [ AC_DEFINE([HAVE_LIBM],[1],[Define to 1 if you have the math library]) CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) From 336d97dc3e35dbfd5c65428a40b53eb3fb791ee4 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Mon, 11 Sep 2023 13:33:02 +0300 Subject: [PATCH 09/16] trying to fix configure.ac after adding -levdev linker --- configure.ac | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index f32db5b1682..5d7113b2b1a 100644 --- a/configure.ac +++ b/configure.ac @@ -1153,10 +1153,8 @@ dnl ====================================================================== CLIENTLIBS= -# Check for libevdev library -AC_CHECK_LIB([evdev], [libevdev_new_from_fd], - [CLIENTLIBS="$CLIENTLIBS -levdev"], - [AC_MSG_ERROR([libevdev library not found.])]) +# Add -levdev linker +CLIENTLIBS="${CLIENTLIBS} -levdev" SAH_CHECK_LIB([m],[sin], [ AC_DEFINE([HAVE_LIBM],[1],[Define to 1 if you have the math library]) From 0a228c029e514fe44148b0de72678165666bcd04 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Mon, 11 Sep 2023 14:27:39 +0300 Subject: [PATCH 10/16] runnint trailing_whitespaces_check.py again to fix trailing spaces for source code checker --- client/hostinfo_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index 4a808ca6fd5..0f6e01c4b2d 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -2010,7 +2010,7 @@ const vector X_display_values_initialize() { return display_values; } -// Function to initialize libevdev for all input devices in /dev/input/ on linux systems +// Function to initialize libevdev for all input devices in /dev/input/ on linux systems // call example: // long linuxIdleTimeInSeconds = checkLinuxInputEventsAndGetIdleTime(&linuxUserLastSeen); bool initializeLinuxInputDevices(libevdev** devices, size_t* deviceCount) { From 1108490ef57ec1fa7fdf0cfc162e6fb2189cdc65 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Tue, 19 Sep 2023 00:41:48 +0300 Subject: [PATCH 11/16] trying to fix build for all OSs... --- client/hostinfo_unix.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index 0f6e01c4b2d..cb196e5d43e 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -179,13 +179,16 @@ extern "C" { // #if (defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(__HAIKU__) #define LINUX_LIKE_SYSTEM 1 +#include +#endif + +#if (defined(__linux__) && !defined(__HAIKU__)) #include #include // variables for getting linux IDLE time on linux. size_t deviceCount = 0; libevdev* devices[256]; // Assuming a maximum of 256 input devices time_t linuxUserLastSeen = time(nullptr); -#include #endif #if WASM From a5284cfc4d13a25b13730b46103fd9f5aa2e7419 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Tue, 19 Sep 2023 19:31:53 +0300 Subject: [PATCH 12/16] trying to fix build for all OSs by adding the levdev linker and an include only for linux --- client/hostinfo_unix.cpp | 4 ++-- configure.ac | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index cb196e5d43e..248c9da4c04 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -179,10 +179,10 @@ extern "C" { // #if (defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(__HAIKU__) #define LINUX_LIKE_SYSTEM 1 -#include #endif -#if (defined(__linux__) && !defined(__HAIKU__)) +#if (defined(__linux__) && !defined(__HAIKU__) && !defined(__ANDROID__)) +#include #include #include // variables for getting linux IDLE time on linux. diff --git a/configure.ac b/configure.ac index 5d7113b2b1a..058342f5f16 100644 --- a/configure.ac +++ b/configure.ac @@ -1154,7 +1154,13 @@ dnl ====================================================================== CLIENTLIBS= # Add -levdev linker -CLIENTLIBS="${CLIENTLIBS} -levdev" +AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ +#ifdef LINUX_SYSTEM + +#endif +]], [])], [ + CLIENTLIBS="${CLIENTLIBS} -levdev" +]) SAH_CHECK_LIB([m],[sin], [ AC_DEFINE([HAVE_LIBM],[1],[Define to 1 if you have the math library]) From 375ce7a7faf2d3416d490793f30f50ebee2ea9e3 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Wed, 20 Sep 2023 08:33:25 +0300 Subject: [PATCH 13/16] trying to fix build for android devices --- configure.ac | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 058342f5f16..0bc3c5d3b37 100644 --- a/configure.ac +++ b/configure.ac @@ -1153,14 +1153,20 @@ dnl ====================================================================== CLIENTLIBS= -# Add -levdev linker -AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ -#ifdef LINUX_SYSTEM +AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], + [[ + + ]])], + [ + AC_MSG_RESULT([yes]) + CLIENTLIBS="$CLIENTLIBS -levdev" + ], + [ + AC_MSG_RESULT([no]) + ] + ) + -#endif -]], [])], [ - CLIENTLIBS="${CLIENTLIBS} -levdev" -]) SAH_CHECK_LIB([m],[sin], [ AC_DEFINE([HAVE_LIBM],[1],[Define to 1 if you have the math library]) From ebc18d83c038a5bf56da51a86a1c85b6f6c47ad3 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Wed, 20 Sep 2023 08:56:46 +0300 Subject: [PATCH 14/16] trying to fix build for snap --- configure.ac | 2 +- snap/snapcraft.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0bc3c5d3b37..69da9a55232 100644 --- a/configure.ac +++ b/configure.ac @@ -1155,7 +1155,7 @@ CLIENTLIBS= AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[ - + ]])], [ AC_MSG_RESULT([yes]) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 44593f6454e..8118ecc8c17 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -57,6 +57,7 @@ parts: - libxrandr-dev - libdbus-1-dev - libxtst-dev + - libevdev-dev # vcpkg dependencies - build-essential - pkg-config From 33b250a102e5993a48e2cd1e3ead6ecab100f4c5 Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Wed, 20 Sep 2023 15:51:21 +0300 Subject: [PATCH 15/16] trying to fix build for snap --- snap/snapcraft.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 8118ecc8c17..86f39a62f22 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -58,6 +58,7 @@ parts: - libdbus-1-dev - libxtst-dev - libevdev-dev + - libevdev2 # vcpkg dependencies - build-essential - pkg-config From ffc5f0dccdf87faceb0e9bb3d8d0d4d99a05375c Mon Sep 17 00:00:00 2001 From: 0xOZ Date: Thu, 21 Sep 2023 15:21:48 +0300 Subject: [PATCH 16/16] trying to fix build for snap by adding another path to LID_PATH... --- snap/snapcraft.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 86f39a62f22..6c922e7f52a 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -104,6 +104,9 @@ parts: export PATH=/snap/cmake/current/bin/:$PATH cmake --version + # to recongize libevdev + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/ + # aws ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime sudo add-apt-repository ppa:lizthegrey/misc