From 361b6555ed8a2153813bc75d5c45300c524bcc4c Mon Sep 17 00:00:00 2001 From: Clayton Smith Date: Sun, 25 May 2025 12:56:28 -0400 Subject: [PATCH] Move macOS builds to Conda Co-authored-by: kgarrels Co-authored-by: Clayton Smith --- .github/workflows/build.yml | 90 ++++++++++------------------------ .github/workflows/ci.yml | 32 ++++++------ macos_bundle.sh | 25 +++++----- src/applications/gqrx/main.cpp | 1 + 4 files changed, 57 insertions(+), 91 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c509e90..5b14ea44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,71 +85,28 @@ jobs: else echo "available=false" >> $GITHUB_OUTPUT; fi - - name: Install dependencies - run: | - uname -a - # for https://github.com/actions/runner-images/issues/9272 - sudo chown -R runner:admin /usr/local/ - brew update - brew install --HEAD librtlsdr - brew install airspy airspyhf boost dylibbundler gnuradio hackrf libbladerf libserialport portaudio pybind11 six soapyremote uhd qt@6 || true - - cd /tmp - git clone https://github.com/analogdevicesinc/libiio.git - cd libiio - git checkout v0.26 - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j4 - sudo make install - - cd /tmp - git clone https://github.com/analogdevicesinc/libad9361-iio.git - cd libad9361-iio - mkdir build - cd build - cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release .. - make -j4 - sudo make install - - cd /tmp - git clone https://github.com/pothosware/SoapyPlutoSDR.git - cd SoapyPlutoSDR - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j4 - sudo make install - - cd /tmp - sudo cp /Library/Frameworks/iio.framework/iio /usr/local/lib/libiio.dylib - sudo install_name_tool -id "/usr/local/lib/libiio.dylib" /usr/local/lib/libiio.dylib - sudo cp /Library/Frameworks/ad9361.framework/ad9361 /usr/local/lib/libad9361.dylib - sudo install_name_tool -id "/usr/local/lib/libad9361.dylib" /usr/local/lib/libad9361.dylib - sudo install_name_tool -delete_rpath /Library/Frameworks /usr/local/lib/libad9361.dylib - sudo install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/libad9361.dylib - sudo install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so - sudo install_name_tool -change @rpath/ad9361.framework/Versions/0.2/ad9361 /usr/local/lib/libad9361.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so - - cd /tmp - git clone https://gitea.osmocom.org/sdr/gr-iqbal.git - cd gr-iqbal - git submodule update --init --recursive - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j4 - sudo make install - - cd /tmp - git clone https://gitea.osmocom.org/sdr/gr-osmosdr.git - cd gr-osmosdr - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-Wno-register .. - LIBRARY_PATH=/usr/local/opt/icu4c/lib make -j4 - sudo make install + - name: Install conda dependencies + id: setup-micromamba + uses: mamba-org/setup-micromamba@v2 + with: + environment-name: gqrx + create-args: >- + c-compiler + cxx-compiler + cmake + make + pkg-config + gnuradio-core + gnuradio-osmosdr + libboost-devel + qt6-main + soapysdr + soapysdr-module-audio + soapysdr-module-lms7 + soapysdr-module-plutosdr + soapysdr-module-remote + soapysdr-module-volk-converters + volk - name: Install Apple certificate if: ${{ steps.secret-check.outputs.available == 'true' }} env: @@ -173,11 +130,14 @@ jobs: with: fetch-depth: 0 - name: Configure + shell: bash -el {0} run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. - name: Compile working-directory: build run: make -j4 - name: Build app bundle + env: + CONDA_PREFIX: ${{ steps.setup-micromamba.outputs.environment-path }} run: ./macos_bundle.sh ${{ steps.secret-check.outputs.available }} - name: Notarize app bundle if: ${{ steps.secret-check.outputs.available == 'true' }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab24e68e..9b15831b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,24 +72,26 @@ jobs: backend: [Portaudio, Gr-audio] runs-on: ${{ matrix.os }} steps: - - name: Install dependencies - run: | - # for https://github.com/actions/runner-images/issues/9272 - sudo chown -R runner:admin /usr/local/ - brew update - brew install airspy boost gnuradio hackrf libbladerf librtlsdr pybind11 six uhd qt@6 || true - - cd /tmp - git clone https://gitea.osmocom.org/sdr/gr-osmosdr.git - cd gr-osmosdr - mkdir build - cd build - cmake -DCMAKE_CXX_FLAGS=-Wno-register .. - LIBRARY_PATH=/usr/local/opt/icu4c/lib make -j4 - sudo make install + - name: Install conda dependencies + id: setup-micromamba + uses: mamba-org/setup-micromamba@v2 + with: + environment-name: gqrx + create-args: >- + c-compiler + cxx-compiler + cmake + make + pkg-config + gnuradio-core + gnuradio-osmosdr + libboost-devel + qt6-main + volk - name: Checkout code uses: actions/checkout@v4 - name: Configure + shell: bash -el {0} run: mkdir build && cd build && cmake -DOSX_AUDIO_BACKEND:STRING=${{ matrix.backend }} .. - name: Compile working-directory: build diff --git a/macos_bundle.sh b/macos_bundle.sh index e7968b69..3e157c7e 100755 --- a/macos_bundle.sh +++ b/macos_bundle.sh @@ -2,8 +2,16 @@ GQRX_VERSION="$(