From 6ccfbda5aa9b89d77936e302d96d44ed5d9347e7 Mon Sep 17 00:00:00 2001 From: arham Date: Wed, 26 Aug 2026 13:31:12 +0000 Subject: [PATCH] build: libraries to make rakurai v12 build --- src/app_sparkd/CMakeLists.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/app_sparkd/CMakeLists.txt b/src/app_sparkd/CMakeLists.txt index 6fd1ff952..f573ef2d0 100644 --- a/src/app_sparkd/CMakeLists.txt +++ b/src/app_sparkd/CMakeLists.txt @@ -50,6 +50,31 @@ pkg_check_modules( IMPORTED_TARGET rakurai-dex-connector ) +# Rakurai's static dex SDK uses hidapi's libudev backend. Keep this explicit so +# existing CMake build trees also pick up the dependency when the connector's +# pkg-config metadata changes between package versions. +find_library(RAKURAI_UDEV_LIBRARY NAMES udev libudev.so.1 REQUIRED) + +# The Rakurai package currently publishes a bare `udev` dependency. Minimal +# runtime images only contain libudev.so.1, so replace that entry with the +# resolved library while preserving its position after Rakurai's static SDK. +get_target_property( + RAKURAI_LINK_LIBRARIES + PkgConfig::rakurai-dex-connector-library + INTERFACE_LINK_LIBRARIES +) +set(RAKURAI_RESOLVED_LINK_LIBRARIES) +foreach(RAKURAI_LINK_LIBRARY IN LISTS RAKURAI_LINK_LIBRARIES) + if(RAKURAI_LINK_LIBRARY STREQUAL "udev" OR RAKURAI_LINK_LIBRARY STREQUAL "-ludev") + list(APPEND RAKURAI_RESOLVED_LINK_LIBRARIES ${RAKURAI_UDEV_LIBRARY}) + else() + list(APPEND RAKURAI_RESOLVED_LINK_LIBRARIES ${RAKURAI_LINK_LIBRARY}) + endif() +endforeach() +set_property( + TARGET PkgConfig::rakurai-dex-connector-library + PROPERTY INTERFACE_LINK_LIBRARIES ${RAKURAI_RESOLVED_LINK_LIBRARIES} +) # include paths target_include_directories(