From de517a654755ca82aa0bf4fded7e1b02250952d5 Mon Sep 17 00:00:00 2001 From: 5cript Date: Tue, 3 Mar 2026 19:23:56 +0100 Subject: [PATCH 01/17] Bumped nui and required cmake version. This is for clean WASM build environments. --- CMakeLists.txt | 2 +- work_dependencies.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe47e28..35e20cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 4.2) include("${CMAKE_CURRENT_LIST_DIR}/_cmake/version.cmake") diff --git a/work_dependencies.json b/work_dependencies.json index 056122f..7f7c156 100644 --- a/work_dependencies.json +++ b/work_dependencies.json @@ -8,7 +8,7 @@ }, { "url": "https://github.com/NuiCpp/Nui.git", - "rev": "d91ad07799eea440a017d146dd36f70e19bd091d", + "rev": "4869fef9aef86d14a10ed2d8b5a24a486f7c29ee", "branch": "main", "name": "Nui" }, From b6d503d6ff5ec31f5857f7f4bf43db4d9f1321e4 Mon Sep 17 00:00:00 2001 From: 5cript Date: Tue, 3 Mar 2026 19:24:04 +0100 Subject: [PATCH 02/17] Add desktop file to this repository. --- org.nuicpp.nui_sftp.desktop | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 org.nuicpp.nui_sftp.desktop diff --git a/org.nuicpp.nui_sftp.desktop b/org.nuicpp.nui_sftp.desktop new file mode 100644 index 0000000..7a37824 --- /dev/null +++ b/org.nuicpp.nui_sftp.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=nui-sftp +Comment=A SSH/SFTP client using the NuiCpp UI Framework +Exec=nui-sftp +Terminal=false +Categories=Utility; \ No newline at end of file From d3d0a8ae795a8b369bf188e65efeddcf4bccb7a2 Mon Sep 17 00:00:00 2001 From: 5cript Date: Wed, 4 Mar 2026 21:09:25 +0100 Subject: [PATCH 03/17] Added omit frontend to deploy script. --- scripts/deploy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 2572b1a..528c9f7 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -23,6 +23,8 @@ BUILD_DIRECTORY=$(canonicalPath "${BUILD_DIRECTORY}") SOURCE_DIRECTORY="${SOURCE_DIRECTORY:-${SCRIPT_DIR}/..}" SOURCE_DIRECTORY=$(canonicalPath "${SOURCE_DIRECTORY}") +OMIT_FRONTEND="${OMIT_FRONTEND:-false}" + NOLINK="${NOLINK:-false}" # On Windows executeable is called nui-sftp.exe, look if that exsists and then use that as the source for the executable @@ -51,7 +53,9 @@ mkdir -p "${INSTALL_TARGET}/themes/dark" cp "${EXECUTABLE}" "${INSTALL_TARGET}/bin/${EXECUTABLE_NAME}" cp -r "${BUILD_DIRECTORY}/assets/." "${INSTALL_TARGET}/assets" cp -r "${BUILD_DIRECTORY}/themes/." "${INSTALL_TARGET}/themes" -cp -r "${BUILD_DIRECTORY}/module_nui-sftp/bin/." "${INSTALL_TARGET}/frontend" +if [ "$OMIT_FRONTEND" = false ]; then + cp -r "${BUILD_DIRECTORY}/module_nui-sftp/bin/." "${INSTALL_TARGET}/frontend" +fi # Dont create a symlink on windows or if NOLINK is true if [ "$IS_WINDOWS" = false ] && [ "$NOLINK" = false ]; then From 76d7f24eb2abde587757f6e989a9f0866b565d57 Mon Sep 17 00:00:00 2001 From: 5cript Date: Wed, 4 Mar 2026 21:18:13 +0100 Subject: [PATCH 04/17] Removed style copy when omit frontend build. --- _cmake/copy_styles_to_build_dir.cmake | 86 ++++++++++++++------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/_cmake/copy_styles_to_build_dir.cmake b/_cmake/copy_styles_to_build_dir.cmake index 9028c9c..e9d1afb 100644 --- a/_cmake/copy_styles_to_build_dir.cmake +++ b/_cmake/copy_styles_to_build_dir.cmake @@ -1,43 +1,45 @@ -add_custom_command( - OUTPUT - "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" - "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" - COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/styles/nui-file-explorer" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/dropdown_menu.css" "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/file_grid.css" "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/button.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/color_picker.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/resizeable_table.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/select.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/switch.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/text_input.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" - DEPENDS - "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/dropdown_menu.css" - "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/file_grid.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/button.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/color_picker.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/resizeable_table.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/select.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/switch.css" - "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/text_input.css" -) +if (NOT OMIT_FRONTEND_BUILD) + add_custom_command( + OUTPUT + "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" + "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/styles/nui-file-explorer" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/dropdown_menu.css" "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/file_grid.css" "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/button.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/color_picker.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/resizeable_table.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/select.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/switch.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/text_input.css" "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" + DEPENDS + "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/dropdown_menu.css" + "${CMAKE_SOURCE_DIR}/nui-file-explorer/styles/file_grid.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/button.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/color_picker.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/resizeable_table.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/select.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/switch.css" + "${CMAKE_SOURCE_DIR}/dependencies/5cript-nui-components/styles/text_input.css" + ) -add_custom_target( - nui-sftp-style-copy - ALL - DEPENDS - "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" - "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" - "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" -) \ No newline at end of file + add_custom_target( + nui-sftp-style-copy + ALL + DEPENDS + "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/dropdown_menu.css" + "${CMAKE_BINARY_DIR}/styles/nui-file-explorer/file_grid.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/button.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/color_picker.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/resizeable_table.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/select.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/switch.css" + "${CMAKE_BINARY_DIR}/styles/5cript-nui-components/text_input.css" + ) +endif() \ No newline at end of file From 1faceaec0a639684d529cfb650a82df7ed83e99d Mon Sep 17 00:00:00 2001 From: 5cript Date: Wed, 4 Mar 2026 21:31:50 +0100 Subject: [PATCH 05/17] Made OMIT_FRONTEND forward into nui. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35e20cd..b6480aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,10 @@ option(NUI_SFTP_ENABLE_TESTING "Enable testing for nui-sftp" OFF) option(FLATPAK_BUILD "Inform CMake that we are building for flatpak, this will set some additional flags and dependencies" OFF) option(OMIT_FRONTEND_BUILD "Dont build the frontend, used primarily for flatpak, because using emscripten there is hell" OFF) +if (OMIT_FRONTEND_BUILD) + set(NUI_OMIT_FRONTEND ON CACHE BOOL "Do not build the frontend, sometimes useful for environments where emscripten is hard to use" FORCE) +endif() + include (${CMAKE_CURRENT_LIST_DIR}/_cmake/common_options.cmake) # Webkit from custom build From 570965002b92d95821b006d8c5f61571bd528721 Mon Sep 17 00:00:00 2001 From: 5cript Date: Wed, 4 Mar 2026 21:35:15 +0100 Subject: [PATCH 06/17] Added portable-file-dialog as subdir for flatpak. --- _cmake/flatpak.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/_cmake/flatpak.cmake b/_cmake/flatpak.cmake index 68edfaf..7298240 100644 --- a/_cmake/flatpak.cmake +++ b/_cmake/flatpak.cmake @@ -1,9 +1,6 @@ # When this file is included its a flatpak build -if(EMSCRIPTEN) - # add_subdirectory("${CMAKE_CURRENT_BINARY_DIR}/flatpakdeps/nlohmann_json" EXCLUDE_FROM_ALL) - # add_subdirectory("${CMAKE_CURRENT_BINARY_DIR}/flatpakdeps/fmt" EXCLUDE_FROM_ALL) -else() +if(NOT EMSCRIPTEN) find_package(nlohmann_json REQUIRED) find_package(fmt REQUIRED) @@ -11,4 +8,6 @@ else() add_library(interval-tree INTERFACE IMPORTED GLOBAL) add_library(boost_describe INTERFACE IMPORTED GLOBAL) add_library(boost_mp11 INTERFACE IMPORTED GLOBAL) + + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/portable-file-dialogs" EXCLUDE_FROM_ALL) endif() \ No newline at end of file From 5357a972d0011b4a92dd16bb5f307676bbfd6d4a Mon Sep 17 00:00:00 2001 From: 5cript Date: Wed, 4 Mar 2026 22:02:23 +0100 Subject: [PATCH 07/17] Added webview add_subdirectory for flatpak. --- _cmake/flatpak.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/_cmake/flatpak.cmake b/_cmake/flatpak.cmake index 7298240..802eec7 100644 --- a/_cmake/flatpak.cmake +++ b/_cmake/flatpak.cmake @@ -10,4 +10,5 @@ if(NOT EMSCRIPTEN) add_library(boost_mp11 INTERFACE IMPORTED GLOBAL) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/portable-file-dialogs" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/webview" EXCLUDE_FROM_ALL) endif() \ No newline at end of file From 606b036b920df0e4d3aa408e88fc1a85df84ea95 Mon Sep 17 00:00:00 2001 From: 5cript Date: Wed, 4 Mar 2026 22:21:35 +0100 Subject: [PATCH 08/17] Made yaml-cpp fetch optional. --- CMakeLists.txt | 1 + _cmake/dependencies/yaml-cpp.cmake | 16 +++++++++------- _cmake/flatpak.cmake | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6480aa..796bb7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ set(NUI_JSON_DIAGNOSTICS ON CACHE BOOL "Enable json diagnostics for nlohmann_jso set(WEBKIT_PATH "" CACHE PATH "Path to custom built WebKit, if empty, will use system WebKit") set(WEBKIT_PACKAGE_NAME "webkitgtk-6.0" CACHE STRING "Pkg-config package name for WebKit, used if WEBKIT_PATH is set") +option(FETCH_YAML_CPP "Fetch yaml-cpp" ON) option(BUILD_SHARED_LIBS "Do not build shared libraries" OFF) option(BUILD_STATIC_LIBS "Build static libraries" ON) option(NUI_SFTP_ENABLE_TESTING "Enable testing for nui-sftp" OFF) diff --git a/_cmake/dependencies/yaml-cpp.cmake b/_cmake/dependencies/yaml-cpp.cmake index 2117fd7..dd88283 100644 --- a/_cmake/dependencies/yaml-cpp.cmake +++ b/_cmake/dependencies/yaml-cpp.cmake @@ -1,8 +1,10 @@ -include(FetchContent) +if (FETCH_YAML_CPP) + include(FetchContent) -FetchContent_Declare( - yaml-cpp - GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git - GIT_TAG 89ff142b991af432b5d7a7cee55282f082a7e629 -) -FetchContent_MakeAvailable(yaml-cpp) \ No newline at end of file + FetchContent_Declare( + yaml-cpp + GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git + GIT_TAG 89ff142b991af432b5d7a7cee55282f082a7e629 + ) + FetchContent_MakeAvailable(yaml-cpp) +endif() \ No newline at end of file diff --git a/_cmake/flatpak.cmake b/_cmake/flatpak.cmake index 802eec7..eb90775 100644 --- a/_cmake/flatpak.cmake +++ b/_cmake/flatpak.cmake @@ -11,4 +11,5 @@ if(NOT EMSCRIPTEN) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/portable-file-dialogs" EXCLUDE_FROM_ALL) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/webview" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/yaml-cpp" EXCLUDE_FROM_ALL) endif() \ No newline at end of file From 6dc6611ad30f262b0cf22b57266f1d29d44dc57f Mon Sep 17 00:00:00 2001 From: 5cript Date: Wed, 4 Mar 2026 22:24:16 +0100 Subject: [PATCH 09/17] Removed unused expected cmake. --- _cmake/dependencies/expected.cmake | 8 -------- 1 file changed, 8 deletions(-) delete mode 100755 _cmake/dependencies/expected.cmake diff --git a/_cmake/dependencies/expected.cmake b/_cmake/dependencies/expected.cmake deleted file mode 100755 index 17f9c93..0000000 --- a/_cmake/dependencies/expected.cmake +++ /dev/null @@ -1,8 +0,0 @@ -include(FetchContent) -FetchContent_Declare( - expected - GIT_REPOSITORY https://github.com/TartanLlama/expected.git - GIT_TAG 3f0ca7b19253129700a073abfa6d8638d9f7c80c -) - -FetchContent_MakeAvailable(expected) \ No newline at end of file From 6bb4b22f3f452ccd942c4ddbdaa960f4573038c2 Mon Sep 17 00:00:00 2001 From: 5cript Date: Wed, 4 Mar 2026 22:27:50 +0100 Subject: [PATCH 10/17] Made rapidfuzz and spdlog optional fetches. --- CMakeLists.txt | 2 ++ _cmake/dependencies/rapidfuzz.cmake | 15 +++++++++------ _cmake/dependencies/spdlog.cmake | 16 +++++++++------- _cmake/flatpak.cmake | 2 ++ 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 796bb7c..abc733a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,8 @@ option(BUILD_STATIC_LIBS "Build static libraries" ON) option(NUI_SFTP_ENABLE_TESTING "Enable testing for nui-sftp" OFF) option(FLATPAK_BUILD "Inform CMake that we are building for flatpak, this will set some additional flags and dependencies" OFF) option(OMIT_FRONTEND_BUILD "Dont build the frontend, used primarily for flatpak, because using emscripten there is hell" OFF) +option(FETCH_RAPIDFUZZ "Fetch rapidfuzz" ON) +option(FETCH_SPDLOG "Fetch spdlog" ON) if (OMIT_FRONTEND_BUILD) set(NUI_OMIT_FRONTEND ON CACHE BOOL "Do not build the frontend, sometimes useful for environments where emscripten is hard to use" FORCE) diff --git a/_cmake/dependencies/rapidfuzz.cmake b/_cmake/dependencies/rapidfuzz.cmake index b481394..be94bed 100644 --- a/_cmake/dependencies/rapidfuzz.cmake +++ b/_cmake/dependencies/rapidfuzz.cmake @@ -1,6 +1,9 @@ -FetchContent_Declare( - rapidfuzz - GIT_REPOSITORY https://github.com/rapidfuzz/rapidfuzz-cpp.git - GIT_TAG main -) -FetchContent_MakeAvailable(rapidfuzz) \ No newline at end of file +if (FETCH_RAPIDFUZZ) + include(FetchContent) + FetchContent_Declare( + rapidfuzz + GIT_REPOSITORY https://github.com/rapidfuzz/rapidfuzz-cpp.git + GIT_TAG b8ce411e91e01599d0697ad307933e05ddf3a723 + ) + FetchContent_MakeAvailable(rapidfuzz) +endif() \ No newline at end of file diff --git a/_cmake/dependencies/spdlog.cmake b/_cmake/dependencies/spdlog.cmake index 1df55da..6bff555 100755 --- a/_cmake/dependencies/spdlog.cmake +++ b/_cmake/dependencies/spdlog.cmake @@ -1,10 +1,12 @@ set(SPDLOG_FMT_EXTERNAL ON CACHE BOOL "Use an external fmt library (provide it manually)" FORCE) -include(FetchContent) -FetchContent_Declare( - spdlog - GIT_REPOSITORY https://github.com/gabime/spdlog.git - GIT_TAG v1.17.0 -) +if (FETCH_SPDLOG) + include(FetchContent) + FetchContent_Declare( + spdlog + GIT_REPOSITORY https://github.com/gabime/spdlog.git + GIT_TAG v1.17.0 + ) -FetchContent_MakeAvailable(spdlog) + FetchContent_MakeAvailable(spdlog) +endif() \ No newline at end of file diff --git a/_cmake/flatpak.cmake b/_cmake/flatpak.cmake index eb90775..2e9745e 100644 --- a/_cmake/flatpak.cmake +++ b/_cmake/flatpak.cmake @@ -12,4 +12,6 @@ if(NOT EMSCRIPTEN) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/portable-file-dialogs" EXCLUDE_FROM_ALL) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/webview" EXCLUDE_FROM_ALL) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/yaml-cpp" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/rapidfuzz" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/spdlog" EXCLUDE_FROM_ALL) endif() \ No newline at end of file From 58e1ab4bff98c09e1f734c9d75a1c8c346a9955a Mon Sep 17 00:00:00 2001 From: 5cript Date: Wed, 4 Mar 2026 22:36:43 +0100 Subject: [PATCH 11/17] Made efsw fetch optional. --- CMakeLists.txt | 1 + _cmake/dependencies/efsw.cmake | 16 +++++++++------- _cmake/flatpak.cmake | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index abc733a..f4634b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ option(FLATPAK_BUILD "Inform CMake that we are building for flatpak, this will s option(OMIT_FRONTEND_BUILD "Dont build the frontend, used primarily for flatpak, because using emscripten there is hell" OFF) option(FETCH_RAPIDFUZZ "Fetch rapidfuzz" ON) option(FETCH_SPDLOG "Fetch spdlog" ON) +option(FETCH_EFSW "Fetch efsw" ON) if (OMIT_FRONTEND_BUILD) set(NUI_OMIT_FRONTEND ON CACHE BOOL "Do not build the frontend, sometimes useful for environments where emscripten is hard to use" FORCE) diff --git a/_cmake/dependencies/efsw.cmake b/_cmake/dependencies/efsw.cmake index 6586a4d..b4828c1 100755 --- a/_cmake/dependencies/efsw.cmake +++ b/_cmake/dependencies/efsw.cmake @@ -1,8 +1,10 @@ -include(FetchContent) -FetchContent_Declare( - efsw - GIT_REPOSITORY https://github.com/SpartanJ/efsw.git - GIT_TAG 87abe599995d5646f5d83cf2e3a225bd73148b3a -) +if (FETCH_EFSW) + include(FetchContent) + FetchContent_Declare( + efsw + GIT_REPOSITORY https://github.com/SpartanJ/efsw.git + GIT_TAG 87abe599995d5646f5d83cf2e3a225bd73148b3a + ) -FetchContent_MakeAvailable(efsw) \ No newline at end of file + FetchContent_MakeAvailable(efsw) +endif() \ No newline at end of file diff --git a/_cmake/flatpak.cmake b/_cmake/flatpak.cmake index 2e9745e..cdd31e2 100644 --- a/_cmake/flatpak.cmake +++ b/_cmake/flatpak.cmake @@ -14,4 +14,5 @@ if(NOT EMSCRIPTEN) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/yaml-cpp" EXCLUDE_FROM_ALL) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/rapidfuzz" EXCLUDE_FROM_ALL) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/spdlog" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/efsw" EXCLUDE_FROM_ALL) endif() \ No newline at end of file From be2b76cf6b3c52c4de4d42add674624c0e943c65 Mon Sep 17 00:00:00 2001 From: 5cript Date: Wed, 4 Mar 2026 22:45:19 +0100 Subject: [PATCH 12/17] Made icon fetch optional. --- CMakeLists.txt | 1 + _cmake/resource_copy.cmake | 89 ++++++++++++++++++++------------------ 2 files changed, 48 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4634b8..7363113 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ option(OMIT_FRONTEND_BUILD "Dont build the frontend, used primarily for flatpak, option(FETCH_RAPIDFUZZ "Fetch rapidfuzz" ON) option(FETCH_SPDLOG "Fetch spdlog" ON) option(FETCH_EFSW "Fetch efsw" ON) +option(FETCH_ICONS "Fetch icons" ON) if (OMIT_FRONTEND_BUILD) set(NUI_OMIT_FRONTEND ON CACHE BOOL "Do not build the frontend, sometimes useful for environments where emscripten is hard to use" FORCE) diff --git a/_cmake/resource_copy.cmake b/_cmake/resource_copy.cmake index 31b49f3..2e70481 100644 --- a/_cmake/resource_copy.cmake +++ b/_cmake/resource_copy.cmake @@ -1,15 +1,20 @@ # Icons -include(FetchContent) +if (FETCH_ICONS) + include(FetchContent) -FetchContent_Declare( - base-icons - URL "https://s3.g.s4.mega.io/jgemkib4a5fte35rktt5wxrwkw4ejk4ybemkf/nui-scp/icons.tar.gz" - URL_HASH MD5=38d01d8769dda2a006495c7a3caa11b4 - DOWNLOAD_EXTRACT_TIMESTAMP TRUE -) + FetchContent_Declare( + base-icons + URL "https://s3.g.s4.mega.io/jgemkib4a5fte35rktt5wxrwkw4ejk4ybemkf/nui-scp/icons.tar.gz" + URL_HASH MD5=38d01d8769dda2a006495c7a3caa11b4 + DOWNLOAD_EXTRACT_TIMESTAMP TRUE + ) -FetchContent_MakeAvailable(base-icons) + FetchContent_MakeAvailable(base-icons) + set(BASE_ICONS_DIR "${base-icons_SOURCE_DIR}") +else() + set(BASE_ICONS_DIR "${CMAKE_SOURCE_DIR}/dependencies/icons") +endif() add_custom_command( OUTPUT @@ -32,44 +37,44 @@ add_custom_command( "${CMAKE_BINARY_DIR}/assets/icons/rust.png" "${CMAKE_BINARY_DIR}/assets/icons/python.png" "${CMAKE_BINARY_DIR}/themes/dark/css_variables.css" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/os_folders/windows/11/folder_main.png" "${CMAKE_BINARY_DIR}/assets/icons/folder_main.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Others/hard-drive.png" "${CMAKE_BINARY_DIR}/assets/icons/hard_drive.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/os_folders/windows/11/folder_main.png" "${CMAKE_BINARY_DIR}/assets/icons/folder_main.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Others/hard-drive.png" "${CMAKE_BINARY_DIR}/assets/icons/hard_drive.png" COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/../static/assets/file.png" "${CMAKE_BINARY_DIR}/assets/icons/file.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-c-4921409.png" "${CMAKE_BINARY_DIR}/assets/icons/cpp.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/css-3-logo.png" "${CMAKE_BINARY_DIR}/assets/icons/css.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-html-1174764.png" "${CMAKE_BINARY_DIR}/assets/icons/html.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/Go-Logo_Black.png" "${CMAKE_BINARY_DIR}/assets/icons/go.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-c-4921443.png" "${CMAKE_BINARY_DIR}/assets/icons/csharp.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-cad-4921405.png" "${CMAKE_BINARY_DIR}/assets/icons/cad.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-c-file-115671.png" "${CMAKE_BINARY_DIR}/assets/icons/c.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-jar-4921452.png" "${CMAKE_BINARY_DIR}/assets/icons/jar.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-java-1156842.png" "${CMAKE_BINARY_DIR}/assets/icons/java.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-js-4921450.png" "${CMAKE_BINARY_DIR}/assets/icons/js.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-log-4921382.png" "${CMAKE_BINARY_DIR}/assets/icons/log.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-sql-4921378.png" "${CMAKE_BINARY_DIR}/assets/icons/sql.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-swift-file-3001056.png" "${CMAKE_BINARY_DIR}/assets/icons/swift.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/Rust_programming_language.png" "${CMAKE_BINARY_DIR}/assets/icons/rust.png" - COMMAND ${CMAKE_COMMAND} -E copy "${base-icons_SOURCE_DIR}/masks/Development/noun-python-1375869.png" "${CMAKE_BINARY_DIR}/assets/icons/python.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-c-4921409.png" "${CMAKE_BINARY_DIR}/assets/icons/cpp.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/css-3-logo.png" "${CMAKE_BINARY_DIR}/assets/icons/css.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-html-1174764.png" "${CMAKE_BINARY_DIR}/assets/icons/html.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/Go-Logo_Black.png" "${CMAKE_BINARY_DIR}/assets/icons/go.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-c-4921443.png" "${CMAKE_BINARY_DIR}/assets/icons/csharp.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-cad-4921405.png" "${CMAKE_BINARY_DIR}/assets/icons/cad.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-c-file-115671.png" "${CMAKE_BINARY_DIR}/assets/icons/c.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-jar-4921452.png" "${CMAKE_BINARY_DIR}/assets/icons/jar.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-java-1156842.png" "${CMAKE_BINARY_DIR}/assets/icons/java.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-js-4921450.png" "${CMAKE_BINARY_DIR}/assets/icons/js.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-log-4921382.png" "${CMAKE_BINARY_DIR}/assets/icons/log.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-sql-4921378.png" "${CMAKE_BINARY_DIR}/assets/icons/sql.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-swift-file-3001056.png" "${CMAKE_BINARY_DIR}/assets/icons/swift.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/Rust_programming_language.png" "${CMAKE_BINARY_DIR}/assets/icons/rust.png" + COMMAND ${CMAKE_COMMAND} -E copy "${BASE_ICONS_DIR}/masks/Development/noun-python-1375869.png" "${CMAKE_BINARY_DIR}/assets/icons/python.png" COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/../themes/dark/css_variables.css" "${CMAKE_BINARY_DIR}/themes/dark/css_variables.css" DEPENDS - "${base-icons_SOURCE_DIR}/os_folders/windows/11/folder_main.png" + "${BASE_ICONS_DIR}/os_folders/windows/11/folder_main.png" "${CMAKE_CURRENT_LIST_DIR}/../static/assets/file.png" - "${base-icons_SOURCE_DIR}/masks/Others/hard-drive.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-c-4921409.png" - "${base-icons_SOURCE_DIR}/masks/Development/css-3-logo.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-html-1174764.png" - "${base-icons_SOURCE_DIR}/masks/Development/Go-Logo_Black.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-c-4921443.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-cad-4921405.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-c-file-115671.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-jar-4921452.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-java-1156842.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-js-4921450.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-log-4921382.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-sql-4921378.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-swift-file-3001056.png" - "${base-icons_SOURCE_DIR}/masks/Development/Rust_programming_language.png" - "${base-icons_SOURCE_DIR}/masks/Development/noun-python-1375869.png" + "${BASE_ICONS_DIR}/masks/Others/hard-drive.png" + "${BASE_ICONS_DIR}/masks/Development/noun-c-4921409.png" + "${BASE_ICONS_DIR}/masks/Development/css-3-logo.png" + "${BASE_ICONS_DIR}/masks/Development/noun-html-1174764.png" + "${BASE_ICONS_DIR}/masks/Development/Go-Logo_Black.png" + "${BASE_ICONS_DIR}/masks/Development/noun-c-4921443.png" + "${BASE_ICONS_DIR}/masks/Development/noun-cad-4921405.png" + "${BASE_ICONS_DIR}/masks/Development/noun-c-file-115671.png" + "${BASE_ICONS_DIR}/masks/Development/noun-jar-4921452.png" + "${BASE_ICONS_DIR}/masks/Development/noun-java-1156842.png" + "${BASE_ICONS_DIR}/masks/Development/noun-js-4921450.png" + "${BASE_ICONS_DIR}/masks/Development/noun-log-4921382.png" + "${BASE_ICONS_DIR}/masks/Development/noun-sql-4921378.png" + "${BASE_ICONS_DIR}/masks/Development/noun-swift-file-3001056.png" + "${BASE_ICONS_DIR}/masks/Development/Rust_programming_language.png" + "${BASE_ICONS_DIR}/masks/Development/noun-python-1375869.png" "${CMAKE_CURRENT_LIST_DIR}/../themes/dark/css_variables.css" ) From f79fa5c0b401e98668b3da14322fe210378f0865 Mon Sep 17 00:00:00 2001 From: 5cript Date: Wed, 4 Mar 2026 22:49:59 +0100 Subject: [PATCH 13/17] Added promise-cpp for roar to flatpak. --- _cmake/flatpak.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/_cmake/flatpak.cmake b/_cmake/flatpak.cmake index cdd31e2..f632315 100644 --- a/_cmake/flatpak.cmake +++ b/_cmake/flatpak.cmake @@ -15,4 +15,5 @@ if(NOT EMSCRIPTEN) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/rapidfuzz" EXCLUDE_FROM_ALL) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/spdlog" EXCLUDE_FROM_ALL) add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/efsw" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/promise-cpp" EXCLUDE_FROM_ALL) endif() \ No newline at end of file From c4dce5188265b5a58de4be8c0c55d21db0f5c236 Mon Sep 17 00:00:00 2001 From: 5cript Date: Thu, 5 Mar 2026 00:03:33 +0100 Subject: [PATCH 14/17] Added icon to desktop file. --- org.nuicpp.nui_sftp.desktop | 1 + 1 file changed, 1 insertion(+) diff --git a/org.nuicpp.nui_sftp.desktop b/org.nuicpp.nui_sftp.desktop index 7a37824..f78e248 100644 --- a/org.nuicpp.nui_sftp.desktop +++ b/org.nuicpp.nui_sftp.desktop @@ -1,6 +1,7 @@ [Desktop Entry] Type=Application Name=nui-sftp +Icon=nui-sftp Comment=A SSH/SFTP client using the NuiCpp UI Framework Exec=nui-sftp Terminal=false From e72524033622eb20a815111ff4b8a022c2352b0d Mon Sep 17 00:00:00 2001 From: 5cript Date: Fri, 6 Mar 2026 21:37:10 +0100 Subject: [PATCH 15/17] Rebranded flatpak build as offline build. --- CMakeLists.txt | 10 +++---- _cmake/dependencies/efsw.cmake | 1 + _cmake/dependencies/rapidfuzz.cmake | 1 + _cmake/dependencies/spdlog.cmake | 1 + _cmake/dependencies/yaml-cpp.cmake | 1 + _cmake/flatpak.cmake | 19 ------------ _cmake/offline_build.cmake | 43 +++++++++++++++++++++++++++ backend/source/backend/CMakeLists.txt | 2 +- org.nuicpp.nui_sftp.desktop | 2 +- work_dependencies.json | 42 ++++++++++++++++++++++++++ 10 files changed, 96 insertions(+), 26 deletions(-) delete mode 100644 _cmake/flatpak.cmake create mode 100644 _cmake/offline_build.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 7363113..91790b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,13 +16,17 @@ option(FETCH_YAML_CPP "Fetch yaml-cpp" ON) option(BUILD_SHARED_LIBS "Do not build shared libraries" OFF) option(BUILD_STATIC_LIBS "Build static libraries" ON) option(NUI_SFTP_ENABLE_TESTING "Enable testing for nui-sftp" OFF) -option(FLATPAK_BUILD "Inform CMake that we are building for flatpak, this will set some additional flags and dependencies" OFF) +option(OFFLINE_BUILD "Inform CMake that we are building for offline environments (flatpak, yocto), this will set some additional flags and dependencies" OFF) option(OMIT_FRONTEND_BUILD "Dont build the frontend, used primarily for flatpak, because using emscripten there is hell" OFF) option(FETCH_RAPIDFUZZ "Fetch rapidfuzz" ON) option(FETCH_SPDLOG "Fetch spdlog" ON) option(FETCH_EFSW "Fetch efsw" ON) option(FETCH_ICONS "Fetch icons" ON) +if (OFFLINE_BUILD) + include("${CMAKE_CURRENT_LIST_DIR}/_cmake/offline_build.cmake") +endif() + if (OMIT_FRONTEND_BUILD) set(NUI_OMIT_FRONTEND ON CACHE BOOL "Do not build the frontend, sometimes useful for environments where emscripten is hard to use" FORCE) endif() @@ -49,10 +53,6 @@ if (NOT EMSCRIPTEN) endif() endif() -if (FLATPAK_BUILD) - include("${CMAKE_CURRENT_LIST_DIR}/_cmake/flatpak.cmake") -endif() - # Nui Dependency add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/Nui" EXCLUDE_FROM_ALL) diff --git a/_cmake/dependencies/efsw.cmake b/_cmake/dependencies/efsw.cmake index b4828c1..df1d42f 100755 --- a/_cmake/dependencies/efsw.cmake +++ b/_cmake/dependencies/efsw.cmake @@ -1,5 +1,6 @@ if (FETCH_EFSW) include(FetchContent) + # If you edit here, update work_dependencies.json FetchContent_Declare( efsw GIT_REPOSITORY https://github.com/SpartanJ/efsw.git diff --git a/_cmake/dependencies/rapidfuzz.cmake b/_cmake/dependencies/rapidfuzz.cmake index be94bed..99bb8ff 100644 --- a/_cmake/dependencies/rapidfuzz.cmake +++ b/_cmake/dependencies/rapidfuzz.cmake @@ -1,5 +1,6 @@ if (FETCH_RAPIDFUZZ) include(FetchContent) + # If you edit here, update work_dependencies.json FetchContent_Declare( rapidfuzz GIT_REPOSITORY https://github.com/rapidfuzz/rapidfuzz-cpp.git diff --git a/_cmake/dependencies/spdlog.cmake b/_cmake/dependencies/spdlog.cmake index 6bff555..910c43d 100755 --- a/_cmake/dependencies/spdlog.cmake +++ b/_cmake/dependencies/spdlog.cmake @@ -2,6 +2,7 @@ set(SPDLOG_FMT_EXTERNAL ON CACHE BOOL "Use an external fmt library (provide it m if (FETCH_SPDLOG) include(FetchContent) + # If you edit here, update work_dependencies.json FetchContent_Declare( spdlog GIT_REPOSITORY https://github.com/gabime/spdlog.git diff --git a/_cmake/dependencies/yaml-cpp.cmake b/_cmake/dependencies/yaml-cpp.cmake index dd88283..fc9dc8b 100644 --- a/_cmake/dependencies/yaml-cpp.cmake +++ b/_cmake/dependencies/yaml-cpp.cmake @@ -1,6 +1,7 @@ if (FETCH_YAML_CPP) include(FetchContent) + # If you edit here, update work_dependencies.json FetchContent_Declare( yaml-cpp GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git diff --git a/_cmake/flatpak.cmake b/_cmake/flatpak.cmake deleted file mode 100644 index f632315..0000000 --- a/_cmake/flatpak.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# When this file is included its a flatpak build - -if(NOT EMSCRIPTEN) - find_package(nlohmann_json REQUIRED) - find_package(fmt REQUIRED) - - add_library(boost_preprocessor INTERFACE IMPORTED GLOBAL) - add_library(interval-tree INTERFACE IMPORTED GLOBAL) - add_library(boost_describe INTERFACE IMPORTED GLOBAL) - add_library(boost_mp11 INTERFACE IMPORTED GLOBAL) - - add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/portable-file-dialogs" EXCLUDE_FROM_ALL) - add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/webview" EXCLUDE_FROM_ALL) - add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/yaml-cpp" EXCLUDE_FROM_ALL) - add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/rapidfuzz" EXCLUDE_FROM_ALL) - add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/spdlog" EXCLUDE_FROM_ALL) - add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/efsw" EXCLUDE_FROM_ALL) - add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/promise-cpp" EXCLUDE_FROM_ALL) -endif() \ No newline at end of file diff --git a/_cmake/offline_build.cmake b/_cmake/offline_build.cmake new file mode 100644 index 0000000..6b1c70e --- /dev/null +++ b/_cmake/offline_build.cmake @@ -0,0 +1,43 @@ +# When this file is included its a build requiring to be offline (flatpak, yocto). +if(NOT EMSCRIPTEN) + # Installed into sytem: + set(NUI_FETCH_BOOST_PREPROCESSOR OFF CACHE BOOL "Do not fetch boost preprocessor, assume it is provided by the system" FORCE) + set(NUI_FETCH_INTERVAL_TREE OFF CACHE BOOL "Do not fetch interval tree, assume it is provided by the system" FORCE) + set(NUI_FETCH_BOOST_DESCRIBE OFF CACHE BOOL "Do not fetch boost describe, assume it is provided by the system" FORCE) + set(NUI_FETCH_BOOST_MP11 OFF CACHE BOOL "Do not fetch boost mp11, assume it is provided by the system" FORCE) + set(NUI_FETCH_NLOHMANN_JSON OFF CACHE BOOL "Do not fetch nlohmann_json, assume it is provided by the system" FORCE) + set(NUI_FETCH_BINARYEN OFF CACHE BOOL "Do not fetch binaryen, assume it is provided by the system" FORCE) + set(NUI_FETCH_FMT OFF CACHE BOOL "Do not fetch fmt, assume it is provided by the system" FORCE) + set(NUI_FIND_FMT OFF CACHE BOOL "Do not find fmt, assume it is provided by the system" FORCE) + set(ROAR_EXTERNAL_NLOHMANN_JSON ON CACHE BOOL "Use external nlohmann_json for roar, assume it is provided by the system" FORCE) + + # Checked out in dependencies directory in source dir: + set(NUI_FETCH_TRAITS OFF CACHE BOOL "Do not fetch nui traits, assume it is in dependencies/traits" FORCE) + set(NUI_FETCH_WEBVIEW OFF CACHE BOOL "Do not fetch webview, assume it is in dependencies/webview" FORCE) + set(NUI_FETCH_PORTABLE_FILE_DIALOG OFF CACHE BOOL "Do not fetch portable file dialog, assume it is in dependencies/portable-file-dialogs" FORCE) + set(NUI_FETCH_ROAR OFF CACHE BOOL "Do not fetch roar, assume it is in dependencies/roar" FORCE) + set(ROAR_EXTERNAL_PROMISE ON CACHE BOOL "Use external promise-cpp for roar, assume it is in dependencies/promise-cpp" FORCE) + set(FETCH_YAML_CPP OFF CACHE BOOL "Do not fetch yaml-cpp, assume it is in dependencies/yml-cpp" FORCE) + set(FETCH_RAPIDFUZZ OFF CACHE BOOL "Do not fetch rapidfuzz, assume it is in dependencies/rapidfuzz" FORCE) + set(FETCH_SPDLOG OFF CACHE BOOL "Do not fetch spdlog, assume it is in dependencies/spdlog" FORCE) + set(FETCH_EFSW OFF CACHE BOOL "Do not fetch efsw, assume it is in dependencies/efsw" FORCE) + set(FETCH_ICONS OFF CACHE BOOL "Do not fetch icons, assume it is in dependencies/icons" FORCE) + + set(OMIT_FRONTEND_BUILD ON CACHE BOOL "Do not build the frontend, in offline environments emscripten is hard to use" FORCE) + + find_package(nlohmann_json REQUIRED) + find_package(fmt REQUIRED) + + add_library(boost_preprocessor INTERFACE IMPORTED GLOBAL) + add_library(interval-tree INTERFACE IMPORTED GLOBAL) + add_library(boost_describe INTERFACE IMPORTED GLOBAL) + add_library(boost_mp11 INTERFACE IMPORTED GLOBAL) + + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/portable-file-dialogs" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/webview" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/yaml-cpp" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/rapidfuzz" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/spdlog" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/efsw" EXCLUDE_FROM_ALL) + add_subdirectory("${CMAKE_SOURCE_DIR}/dependencies/promise-cpp" EXCLUDE_FROM_ALL) +endif() \ No newline at end of file diff --git a/backend/source/backend/CMakeLists.txt b/backend/source/backend/CMakeLists.txt index c24efe7..3904526 100644 --- a/backend/source/backend/CMakeLists.txt +++ b/backend/source/backend/CMakeLists.txt @@ -114,7 +114,7 @@ if (NOT OMIT_FRONTEND_BUILD) -DNUI_FIND_FMT=OFF -DBROWSER_ENGINE=${BROWSER_ENGINE} # -DXML_TO_NUI_TOOL=$ - -DFLATPAK_BUILD=${FLATPAK_BUILD} + -DOFFLINE_BUILD=${OFFLINE_BUILD} -DFLATPAK_INCLUDE_DIR=${FLATPAK_INCLUDE_DIR} ) diff --git a/org.nuicpp.nui_sftp.desktop b/org.nuicpp.nui_sftp.desktop index f78e248..90d8faf 100644 --- a/org.nuicpp.nui_sftp.desktop +++ b/org.nuicpp.nui_sftp.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=Application Name=nui-sftp -Icon=nui-sftp +Icon=nui_sftp Comment=A SSH/SFTP client using the NuiCpp UI Framework Exec=nui-sftp Terminal=false diff --git a/work_dependencies.json b/work_dependencies.json index 7f7c156..23ddd25 100644 --- a/work_dependencies.json +++ b/work_dependencies.json @@ -41,6 +41,48 @@ "rev": "fb33b5f751eed174b930329fbecf52138e63c0cf", "branch": "main", "name": "5cript-nui-components" + }, + { + "url": "https://github.com/5cript/portable-file-dialogs.git", + "rev": "13ac8d8655514486d0d700ea7063dcb05f8363da", + "branch": "main", + "name": "portable-file-dialogs" + }, + { + "url": "https://github.com/5cript/webview.git", + "rev": "1dc3cbda951de8de0ff2ae5cc286b070d61f972d", + "branch": "main", + "name": "webview" + }, + { + "url": "https://github.com/jbeder/yaml-cpp.git", + "rev": "89ff142b991af432b5d7a7cee55282f082a7e629", + "branch": "main", + "name": "yaml-cpp" + }, + { + "url": "https://github.com/rapidfuzz/rapidfuzz-cpp.git", + "rev": "b8ce411e91e01599d0697ad307933e05ddf3a723", + "branch": "main", + "name": "rapidfuzz" + }, + { + "url": "https://github.com/gabime/spdlog.git", + "rev": "v1.17.0", + "branch": "main", + "name": "spdlog" + }, + { + "url": "https://github.com/SpartanJ/efsw.git", + "rev": "87abe599995d5646f5d83cf2e3a225bd73148b3a", + "branch": "main", + "name": "efsw" + }, + { + "url": "https://github.com/5cript/promise-cpp.git", + "rev": "bfad5bdd58f29465741858d826338e5b4ca65826", + "branch": "main", + "name": "promise-cpp" } ] } \ No newline at end of file From 27fc3fbeb467ef6cf3850689afe998ffe8a83a10 Mon Sep 17 00:00:00 2001 From: 5cript Date: Fri, 6 Mar 2026 22:44:10 +0100 Subject: [PATCH 16/17] Update Nui. --- work_dependencies.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/work_dependencies.json b/work_dependencies.json index 23ddd25..bc08746 100644 --- a/work_dependencies.json +++ b/work_dependencies.json @@ -8,7 +8,7 @@ }, { "url": "https://github.com/NuiCpp/Nui.git", - "rev": "4869fef9aef86d14a10ed2d8b5a24a486f7c29ee", + "rev": "d066aebccc5ef40612e4c072ad14686ca8c16072", "branch": "main", "name": "Nui" }, From 0a4b9fc249767d05dafa94bbdd8e727cdd41009f Mon Sep 17 00:00:00 2001 From: 5cript Date: Fri, 6 Mar 2026 23:38:33 +0100 Subject: [PATCH 17/17] Cleaned up some cmake. --- _cmake/common_options.cmake | 13 ++++++------- backend/source/backend/CMakeLists.txt | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/_cmake/common_options.cmake b/_cmake/common_options.cmake index 2219838..ecb85b6 100644 --- a/_cmake/common_options.cmake +++ b/_cmake/common_options.cmake @@ -6,19 +6,18 @@ else() target_compile_options(core-target INTERFACE -Wall -Wextra -Wpedantic) endif() -set(MEM64 "") -set(EXCEPTIONS "") if (EMSCRIPTEN) if (WIN32) - set(MEM64 "-sMEMORY64=1") + target_compile_options(core-target INTERFACE -sMEMORY64=1) + target_link_options(core-target INTERFACE -sMEMORY64=1) else() # No support for WASM64 in webkit - set(MEM64 "-sWASM_BIGINT=1") + target_compile_options(core-target INTERFACE -sWASM_BIGINT=1) endif() - set(EXCEPTIONS "-fexceptions") + target_link_options(core-target INTERFACE "-fexceptions") endif() -target_compile_options(core-target INTERFACE -Wbad-function-cast -Wcast-function-type -fexceptions -pedantic $<$:-g;-Werror=return-type> $<$:-O3> ${MEM64} ${EXCEPTIONS}) -target_link_options(core-target INTERFACE $<$:-s;-static-libgcc;-static-libstdc++> ${MEM64} ${EXCEPTIONS}) +target_compile_options(core-target INTERFACE -Wbad-function-cast -Wcast-function-type -fexceptions -pedantic $<$:-g;-Werror=return-type> $<$:-O3>) +target_link_options(core-target INTERFACE $<$:-s;-static-libgcc;-static-libstdc++>) target_compile_features(core-target INTERFACE cxx_std_23) target_compile_definitions(core-target INTERFACE JSON_DIAGNOSTICS=1) \ No newline at end of file diff --git a/backend/source/backend/CMakeLists.txt b/backend/source/backend/CMakeLists.txt index 3904526..657afce 100644 --- a/backend/source/backend/CMakeLists.txt +++ b/backend/source/backend/CMakeLists.txt @@ -115,7 +115,6 @@ if (NOT OMIT_FRONTEND_BUILD) -DBROWSER_ENGINE=${BROWSER_ENGINE} # -DXML_TO_NUI_TOOL=$ -DOFFLINE_BUILD=${OFFLINE_BUILD} - -DFLATPAK_INCLUDE_DIR=${FLATPAK_INCLUDE_DIR} ) # add_dependencies(${PROJECT_NAME}-emscripten xml-to-nui)