diff --git a/.github/workflows/sdrangel.yml b/.github/workflows/sdrangel.yml index d77248f37a..a26c2e7929 100644 --- a/.github/workflows/sdrangel.yml +++ b/.github/workflows/sdrangel.yml @@ -6,6 +6,7 @@ on: push: branches: - master + - mac_ci tags: - 'v*' pull_request: @@ -40,9 +41,6 @@ jobs: echo github.event_name: ${{ github.event_name }} echo github.ref: ${{ github.ref }} echo github.workspace: ${{ github.workspace }} - - name: Get version - id: get_version - run: echo "version=$(git describe --tags | cut -c2-)" >> $env:GITHUB_OUTPUT - name: Install basic dependencies on Windows if: startsWith(matrix.config.os, 'windows') run: | @@ -85,6 +83,11 @@ jobs: mkdir build && cd build cmake .. -G "${{ matrix.config.generators }}" -DCMAKE_BUILD_TYPE=Release -DARCH_OPT=SSE4_2 -DDEBUG_OUTPUT=ON -DENABLE_MIRISDR=OFF -DBUILD_SERVER=OFF -DCMAKE_PREFIX_PATH="C:\Qt\5.15.2\msvc2019_64;C:\Libraries\boost_1_73_0" cmake --build . --config Release --target package + - name: Check disk space + run: Get-PSDrive + - name: Get version + id: get_version + run: echo "version=$(grep sdrangel_VERSION build/CMakeCache.txt | cut -d "=" -f2)" >> $env:GITHUB_OUTPUT - name: Upload artifact uses: actions/upload-artifact@v3 with: @@ -95,3 +98,31 @@ jobs: uses: softprops/action-gh-release@v0.1.13 with: files: ${{ github.workspace }}/build/sdrangel-${{ steps.get_version.outputs.version }}-win64.exe + + build_mac: + runs-on: macos-11 + steps: + - uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + - name: Update brew + run: brew update + - name: Install brew packages + run: brew install nasm boost hidapi libusb fftw ffmpeg faad2 opencv zlib airspy airspyhf hackrf rtl-sdr libbladerf uhd soapysdr + - name: Configure SDRangel + run: | + mkdir build && cd build + cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_QT6=ON -DCMAKE_BUILD_TYPE=Release -DARCH_OPT=nehalem -DDEBUG_OUTPUT=ON -DENABLE_MIRISDR=OFF -DBUILD_SERVER=OFF -DENABLE_EXTERNAL_LIBRARIES=AUTO -DBUNDLE=ON -DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=TRUE + - name: Get filename + id: get_filename + run: echo "filename=$(grep CPACK_PACKAGE_FILE_NAME build/CMakeCache.txt | cut -d "=" -f2)" >> $GITHUB_OUTPUT + - name: Build SDRangel on Mac + run: | + cd build + make package -j3 + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.get_filename.outputs.filename }}.dmg + path: ${{ github.workspace }}/build/${{ steps.get_filename.outputs.filename }}.dmg diff --git a/CMakeLists.txt b/CMakeLists.txt index d7fda37af8..e6cf4cea8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,7 +173,7 @@ if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git/") endif() endif() -set(sdrangel_VERSION "${sdrangel_VERSION_MAJOR}.${sdrangel_VERSION_MINOR}.${sdrangel_VERSION_PATCH}${sdrangel_VERSION_SUFFIX}") +set(sdrangel_VERSION "${sdrangel_VERSION_MAJOR}.${sdrangel_VERSION_MINOR}.${sdrangel_VERSION_PATCH}${sdrangel_VERSION_SUFFIX}" CACHE INTERNAL "") message(STATUS "${APPLICATION_NAME} Version: ${sdrangel_VERSION}") add_definitions("-DSDRANGEL_LIB_VERSION=\"${sdrangel_VERSION_MAJOR}.${sdrangel_VERSION_MINOR}.${sdrangel_VERSION_PATCH}\"") add_definitions("-DSDRANGEL_VERSION=\"${sdrangel_VERSION}\"") @@ -753,6 +753,7 @@ if (NOT ENABLE_EXTERNAL_LIBRARIES OR (ENABLE_EXTERNAL_LIBRARIES STREQUAL "AUTO") find_package(AptDec) find_package(LibDAB) find_package(HIDAPI) + find_package(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE) # Devices if(ENABLE_AIRSPY) diff --git a/app/main.cpp b/app/main.cpp index 62d45943ce..9c8b0a7ad9 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -24,7 +24,9 @@ #include #include #ifdef __APPLE__ +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) #include +#endif #include #endif #ifdef ANDROID @@ -212,10 +214,12 @@ int main(int argc, char* argv[]) // will not work. Because of this, we have two versions of the shaders: // OpenGL 2 versions for compatiblity with older drivers and OpenGL 3.3 // versions for newer drivers +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) QGLFormat fmt; fmt.setVersion(3, 3); fmt.setProfile(QGLFormat::CoreProfile); QGLFormat::setDefaultFormat(fmt); +#endif QSurfaceFormat sfc; sfc.setVersion(3, 3); sfc.setProfile(QSurfaceFormat::CoreProfile); diff --git a/cmake/cpack/CMakeLists.txt b/cmake/cpack/CMakeLists.txt index 318e205526..e454d467a3 100644 --- a/cmake/cpack/CMakeLists.txt +++ b/cmake/cpack/CMakeLists.txt @@ -36,7 +36,7 @@ if(APPLE AND BUNDLE AND BUILD_GUI) set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/cmake/cpack/sdrangel_icon.icns") set(CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/Info.plist") set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/cpack/sdrangel_icon.icns") - set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}_${CPACK_MACOS_PACKAGE_ARCHITECTURE}_${CMAKE_SYSTEM_PROCESSOR}") + set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}_${CPACK_MACOS_PACKAGE_ARCHITECTURE}_${CMAKE_SYSTEM_PROCESSOR}" CACHE INTERNAL "") set(CPACK_PRE_BUILD_SCRIPTS "${PROJECT_BINARY_DIR}/deploy_mac.cmake") # copy SoapySDR Modules @@ -331,7 +331,7 @@ elseif(WIN32 OR MINGW) endforeach() " COMPONENT Runtime) - list(APPEND CPACK_GENERATOR "ZIP;NSIS") + list(APPEND CPACK_GENERATOR "NSIS") set(CPACK_MONOLITHIC_INSTALL ON) set(CPACK_NSIS_HELP_LINK ${CPACK_PACKAGE_CONTACT}) set(CPACK_NSIS_URL_INFO_ABOUT ${CPACK_PACKAGE_CONTACT}) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index e26f489229..e9b3b28cb9 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -1478,7 +1478,7 @@ if (WIN32 OR APPLE) endif () endif (ENABLE_BLADERF) - if (ENABLE_USRP AND Boost_FOUND AND NOT WIN32) + if (ENABLE_USRP AND Boost_FOUND AND NOT WIN32 AND ((NOT UHD_FOUND) OR (ENABLE_EXTERNAL_LIBRARIES STREQUAL "ON"))) ExternalProject_Add(uhd GIT_REPOSITORY https://github.com/EttusResearch/uhd.git GIT_TAG v4.2.0.0 @@ -1504,7 +1504,7 @@ if (WIN32 OR APPLE) set(UHD_LIBRARIES "${install_dir}/lib/libuhd${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${install_dir}/lib") endif () - endif (ENABLE_USRP AND Boost_FOUND AND NOT WIN32) + endif (ENABLE_USRP AND Boost_FOUND AND NOT WIN32 AND ((NOT UHD_FOUND) OR (ENABLE_EXTERNAL_LIBRARIES STREQUAL "ON"))) endif (WIN32 OR APPLE) diff --git a/sdrbase/util/psk31.cpp b/sdrbase/util/psk31.cpp index 731410711b..24efe6c47b 100644 --- a/sdrbase/util/psk31.cpp +++ b/sdrbase/util/psk31.cpp @@ -302,7 +302,7 @@ void PSK31Encoder::addCode(unsigned& bits, unsigned int& bitCount, const QString unsigned int codeLen = code.size(); for (unsigned int i = 0; i < codeLen; i++) { - codeBits |= (code[i] == "1" ? 1 : 0) << i; + codeBits |= (code[i] == '1' ? 1 : 0) << i; } addStartBits(bits, bitCount);