From d308127893b568485a3230ab8e20efeb47c3759a Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 21 May 2024 10:53:15 +0200 Subject: [PATCH] Build GGMorse in CI --- .appveyor.yml | 1 + cmake/ci/build_ggmorse.sh | 13 +++++++++++ external/CMakeLists.txt | 32 ++++++++++++++++++++++++++ plugins/feature/morsedecoder/readme.md | 2 +- 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 cmake/ci/build_ggmorse.sh diff --git a/.appveyor.yml b/.appveyor.yml index cb9b4d1ed..bce5c11b2 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -100,6 +100,7 @@ for: - sh: if [[ ! "${CMAKE_CUSTOM_OPTIONS}" =~ "ENABLE_EXTERNAL_LIBRARIES" ]]; then bash cmake/ci/build_airspyhf.sh; fi - sh: if [[ ! "${CMAKE_CUSTOM_OPTIONS}" =~ "ENABLE_EXTERNAL_LIBRARIES" ]]; then bash cmake/ci/build_rtlsdr.sh; fi - sh: if [[ ! "${CMAKE_CUSTOM_OPTIONS}" =~ "ENABLE_EXTERNAL_LIBRARIES" ]]; then bash cmake/ci/build_limesuite.sh; fi + - sh: if [[ ! "${CMAKE_CUSTOM_OPTIONS}" =~ "ENABLE_EXTERNAL_LIBRARIES" ]]; then bash cmake/ci/build_ggmorse.sh; fi - sh: bash cmake/ci/build_sdrplay.sh before_build: - sh: bash -c export diff --git a/cmake/ci/build_ggmorse.sh b/cmake/ci/build_ggmorse.sh new file mode 100644 index 000000000..b15743dcd --- /dev/null +++ b/cmake/ci/build_ggmorse.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +cd $HOME +mkdir -p external && cd external +mkdir -p f4exb && cd f4exb + +git clone https://github.com/f4exb/ggmorse.git + +cd ggmorse +mkdir -p build && cd build +cmake -DGGMORSE_BUILD_TESTS=OFF -DGGMORSE_BUILD_EXAMPLES=OFF .. +sudo make install +sudo ldconfig diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 7fc4a5362..c1ea9cd11 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -851,6 +851,38 @@ if(ENABLE_FEATURE_SATELLITETRACKER OR ENABLE_CHANNELRX_DEMODAPT) endif () endif () +# For Morse Decoder feature +if(ENABLE_FEATURE_MORSEDECODER) + if (WIN32) + set(GGMORSE_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/ggmorse.lib" CACHE INTERNAL "") + elseif (LINUX) + set(GGMORSE_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib${LIB_SUFFIX}/libggmorse${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") + endif() + ExternalProject_Add(ggmorse + GIT_REPOSITORY https://github.com/f4exb/ggmorse.git + PREFIX "${EXTERNAL_BUILD_LIBRARIES}/ggmorse" + CMAKE_ARGS ${COMMON_CMAKE_ARGS} + -DGGMORSE_BUILD_TESTS=OFF + -DGGMORSE_BUILD_EXAMPLES=OFF + BUILD_BYPRODUCTS "${GGMORSE_LIBRARIES}" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) + ExternalProject_Get_Property(ggmorse source_dir binary_dir) + set(GGMORSE_DEPENDS ggmorse CACHE INTERNAL "") + set_global_cache(GGMORSE_FOUND ON) + set(GGMORSE_EXTERNAL ON CACHE INTERNAL "") + set(GGMORSE_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/ggmorse/src" CACHE INTERNAL "") + if (WIN32) + install(FILES "${SDRANGEL_BINARY_BIN_DIR}/ggmorse${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") + elseif (APPLE) + set(GGMORSE_LIBRARIES "${binary_dir}/libsggmorse/libggmorse${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") + install(DIRECTORY "${binary_dir}/libggmorse" DESTINATION "${INSTALL_LIB_DIR}" + FILES_MATCHING PATTERN "libggmorse*${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/libggmorse") + endif () +endif() + # VkFFT (header only library) ExternalProject_Add(vkfft GIT_REPOSITORY https://github.com/DTolm/VkFFT.git diff --git a/plugins/feature/morsedecoder/readme.md b/plugins/feature/morsedecoder/readme.md index e5561a674..68ec78417 100644 --- a/plugins/feature/morsedecoder/readme.md +++ b/plugins/feature/morsedecoder/readme.md @@ -8,7 +8,7 @@ This plugin uses the demodulated audio of some Rx channel plugins. - AM demodulator - NFM demodulator - - SSB demodulator + - SSB demodulator (use mono audio - not binaural) - WFM demodulator Typical sequence of operations: