Skip to content

Commit fa07cf3

Browse files
authored
Merge pull request #1424 from gqrx-sdr/macos-conda
Move macOS builds to Conda
2 parents 9d78f53 + 66606ef commit fa07cf3

File tree

5 files changed

+58
-91
lines changed

5 files changed

+58
-91
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -85,71 +85,28 @@ jobs:
8585
else
8686
echo "available=false" >> $GITHUB_OUTPUT;
8787
fi
88-
- name: Install dependencies
89-
run: |
90-
uname -a
91-
# for https://github.com/actions/runner-images/issues/9272
92-
sudo chown -R runner:admin /usr/local/
93-
brew update
94-
brew install --HEAD librtlsdr
95-
brew install airspy airspyhf boost dylibbundler gnuradio hackrf libbladerf libserialport portaudio pybind11 six soapyremote uhd qt@6 || true
96-
97-
cd /tmp
98-
git clone https://github.com/analogdevicesinc/libiio.git
99-
cd libiio
100-
git checkout v0.26
101-
mkdir build
102-
cd build
103-
cmake -DCMAKE_BUILD_TYPE=Release ..
104-
make -j4
105-
sudo make install
106-
107-
cd /tmp
108-
git clone https://github.com/analogdevicesinc/libad9361-iio.git
109-
cd libad9361-iio
110-
mkdir build
111-
cd build
112-
cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release ..
113-
make -j4
114-
sudo make install
115-
116-
cd /tmp
117-
git clone https://github.com/pothosware/SoapyPlutoSDR.git
118-
cd SoapyPlutoSDR
119-
mkdir build
120-
cd build
121-
cmake -DCMAKE_BUILD_TYPE=Release ..
122-
make -j4
123-
sudo make install
124-
125-
cd /tmp
126-
sudo cp /Library/Frameworks/iio.framework/iio /usr/local/lib/libiio.dylib
127-
sudo install_name_tool -id "/usr/local/lib/libiio.dylib" /usr/local/lib/libiio.dylib
128-
sudo cp /Library/Frameworks/ad9361.framework/ad9361 /usr/local/lib/libad9361.dylib
129-
sudo install_name_tool -id "/usr/local/lib/libad9361.dylib" /usr/local/lib/libad9361.dylib
130-
sudo install_name_tool -delete_rpath /Library/Frameworks /usr/local/lib/libad9361.dylib
131-
sudo install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/libad9361.dylib
132-
sudo install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so
133-
sudo install_name_tool -change @rpath/ad9361.framework/Versions/0.2/ad9361 /usr/local/lib/libad9361.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so
134-
135-
cd /tmp
136-
git clone https://gitea.osmocom.org/sdr/gr-iqbal.git
137-
cd gr-iqbal
138-
git submodule update --init --recursive
139-
mkdir build
140-
cd build
141-
cmake -DCMAKE_BUILD_TYPE=Release ..
142-
make -j4
143-
sudo make install
144-
145-
cd /tmp
146-
git clone https://gitea.osmocom.org/sdr/gr-osmosdr.git
147-
cd gr-osmosdr
148-
mkdir build
149-
cd build
150-
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-Wno-register ..
151-
LIBRARY_PATH=/usr/local/opt/icu4c/lib make -j4
152-
sudo make install
88+
- name: Install conda dependencies
89+
id: setup-micromamba
90+
uses: mamba-org/setup-micromamba@v2
91+
with:
92+
environment-name: gqrx
93+
create-args: >-
94+
c-compiler
95+
cxx-compiler
96+
cmake
97+
make
98+
pkg-config
99+
gnuradio-core
100+
gnuradio-osmosdr
101+
libboost-devel
102+
qt6-main
103+
soapysdr
104+
soapysdr-module-audio
105+
soapysdr-module-lms7
106+
soapysdr-module-plutosdr
107+
soapysdr-module-remote
108+
soapysdr-module-volk-converters
109+
volk
153110
- name: Install Apple certificate
154111
if: ${{ steps.secret-check.outputs.available == 'true' }}
155112
env:
@@ -173,11 +130,14 @@ jobs:
173130
with:
174131
fetch-depth: 0
175132
- name: Configure
133+
shell: bash -el {0}
176134
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..
177135
- name: Compile
178136
working-directory: build
179137
run: make -j4
180138
- name: Build app bundle
139+
env:
140+
CONDA_PREFIX: ${{ steps.setup-micromamba.outputs.environment-path }}
181141
run: ./macos_bundle.sh ${{ steps.secret-check.outputs.available }}
182142
- name: Notarize app bundle
183143
if: ${{ steps.secret-check.outputs.available == 'true' }}

.github/workflows/ci.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,26 @@ jobs:
7272
backend: [Portaudio, Gr-audio]
7373
runs-on: ${{ matrix.os }}
7474
steps:
75-
- name: Install dependencies
76-
run: |
77-
# for https://github.com/actions/runner-images/issues/9272
78-
sudo chown -R runner:admin /usr/local/
79-
brew update
80-
brew install airspy boost gnuradio hackrf libbladerf librtlsdr pybind11 six uhd qt@6 || true
81-
82-
cd /tmp
83-
git clone https://gitea.osmocom.org/sdr/gr-osmosdr.git
84-
cd gr-osmosdr
85-
mkdir build
86-
cd build
87-
cmake -DCMAKE_CXX_FLAGS=-Wno-register ..
88-
LIBRARY_PATH=/usr/local/opt/icu4c/lib make -j4
89-
sudo make install
75+
- name: Install conda dependencies
76+
id: setup-micromamba
77+
uses: mamba-org/setup-micromamba@v2
78+
with:
79+
environment-name: gqrx
80+
create-args: >-
81+
c-compiler
82+
cxx-compiler
83+
cmake
84+
make
85+
pkg-config
86+
gnuradio-core
87+
gnuradio-osmosdr
88+
libboost-devel
89+
qt6-main
90+
volk
9091
- name: Checkout code
9192
uses: actions/checkout@v4
9293
- name: Configure
94+
shell: bash -el {0}
9395
run: mkdir build && cd build && cmake -DOSX_AUDIO_BACKEND:STRING=${{ matrix.backend }} ..
9496
- name: Compile
9597
working-directory: build

macos_bundle.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22

33
GQRX_VERSION="$(<build/version.txt)"
44
IDENTITY=Y3GC27WZ4S
5-
BREW_PREFIX="$(brew --prefix)"
6-
MACDEPLOYQT6="${BREW_PREFIX}"/opt/qt@6/bin/macdeployqt
5+
6+
echo "CONDA_PREFIX: " $CONDA_PREFIX
7+
8+
MACDEPLOYQT6=${CONDA_PREFIX}/bin/macdeployqt6
9+
echo "macdeployqt6: " ${MACDEPLOYQT6}
10+
11+
# cleanup and setup
12+
if [ -e Gqrx.app ] ;
13+
then rm -r Gqrx.app
14+
fi
715

816
mkdir -p Gqrx.app/Contents/MacOS
917
mkdir -p Gqrx.app/Contents/Resources
@@ -51,20 +59,15 @@ EOM
5159

5260
cp build/src/gqrx Gqrx.app/Contents/MacOS
5361
cp resources/icons/gqrx.icns Gqrx.app/Contents/Resources
54-
# NOTE: PlutoSDR is built locally, so it will not in the brew path
55-
cp /usr/local/lib/SoapySDR/modules*/libPlutoSDRSupport.so Gqrx.app/Contents/soapy-modules
56-
cp "${BREW_PREFIX}"/lib/SoapySDR/modules*/libremoteSupport.so Gqrx.app/Contents/soapy-modules
57-
chmod 644 Gqrx.app/Contents/soapy-modules/*
62+
cp "$CONDA_PREFIX"/lib/SoapySDR/modules*/* Gqrx.app/Contents/soapy-modules
5863

59-
dylibbundler -s "${BREW_PREFIX}"/opt/icu4c/lib/ -od -b -x Gqrx.app/Contents/MacOS/gqrx -x Gqrx.app/Contents/soapy-modules/libPlutoSDRSupport.so -x Gqrx.app/Contents/soapy-modules/libremoteSupport.so -d Gqrx.app/Contents/libs/
60-
"${MACDEPLOYQT6}" Gqrx.app -no-strip -always-overwrite # TODO: Remove macdeployqt workaround
6164
if [ "$1" = "true" ]; then
62-
"${MACDEPLOYQT6}" Gqrx.app -no-strip -always-overwrite -sign-for-notarization="${IDENTITY}"
65+
"${MACDEPLOYQT6}" Gqrx.app -verbose=1 -no-strip -always-overwrite -sign-for-notarization="${IDENTITY}" -libpath=Gqrx.app/Contents/Frameworks
6366
else
64-
"${MACDEPLOYQT6}" Gqrx.app -no-strip -always-overwrite
67+
"${MACDEPLOYQT6}" Gqrx.app -verbose=1 -no-strip -always-overwrite -libpath=Gqrx.app/Contents/Frameworks
6568
fi
6669

67-
for f in Gqrx.app/Contents/libs/*.dylib Gqrx.app/Contents/soapy-modules/*.so Gqrx.app/Contents/Frameworks/*.framework Gqrx.app/Contents/Frameworks/*.dylib Gqrx.app/Contents/MacOS/gqrx
70+
for f in Gqrx.app/Contents/Frameworks/*.dylib Gqrx.app/Contents/soapy-modules/* Gqrx.app/Contents/MacOS/gqrx
6871
do
6972
if [ "$1" = "true" ]; then
7073
codesign --force --verify --verbose --timestamp --options runtime --entitlements /tmp/Entitlements.plist --sign "${IDENTITY}" "$f"

resources/news.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
NEW: Start/stop I/Q recording via remote control.
55
IMPROVED: Allow multiple simultaneous remote control connections.
6+
FIXED: DMG release for ARM-based Macs fails to start.
67
FIXED: Compilation error affecting MSVC.
78

89

src/applications/gqrx/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ int main(int argc, char *argv[])
6767
{
6868
qputenv("SOAPY_SDR_PLUGIN_PATH", plugin_path.toUtf8());
6969
qputenv("SOAPY_SDR_ROOT", "/invalid");
70+
qputenv("CONDA_PREFIX", "/invalid");
7071
}
7172

7273
// setup controlport via environment variables

0 commit comments

Comments
 (0)