From 737a6ee41396a6b6fb9f1ba2c751ae9f8ca1301e Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Mon, 15 Sep 2025 19:30:41 +0100 Subject: [PATCH] Snap: Update packaging for http dashboard --- snap/snapcraft.yaml | 6 +----- src/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 913e12bf..b9c68320 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -22,10 +22,6 @@ apps: command: usr/bin/mosquitto_ctrl plugs: [home, network] - db_dump: - command: usr/bin/mosquitto_db_dump - plugs: [home] - pub: command: usr/bin/mosquitto_pub plugs: [home, network] @@ -70,7 +66,7 @@ parts: plugin: cmake cmake-parameters: - -DCMAKE_INSTALL_PREFIX=/usr - - -DHTTP_API_DIR=\\\"/snap/mosquitto/current/dashboard/\\\" + - -DHTTP_API_DIR="/snap/mosquitto/current/dashboard/" - -DWITH_TESTS=OFF source: https://github.com/eclipse-mosquitto/mosquitto source-type: git diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 93efe2ae..17a2a068 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -105,12 +105,17 @@ endif() option(WITH_HTTP_API "Include http_api support for listeners?" ON) +option(HTTP_API_DIR + "Default http_api directory" "") if(WITH_HTTP_API) find_library(MICROHTTPD_LIBRARY NAMES microhttpd) if(MICROHTTPD_LIBRARY) target_sources(mosquitto PRIVATE http_api.c) target_compile_definitions(mosquitto PRIVATE "WITH_HTTP_API") target_link_libraries(mosquitto PRIVATE ${MICROHTTPD_LIBRARY}) + if(HTTP_API_DIR) + target_compile_definitions(mosquitto PRIVATE "HTTP_API_DIR=\"${HTTP_API_DIR}\"") + endif() endif() endif()