Skip to content

Commit

Permalink
Merge pull request #1388 from yuzawa-san/macos-builds
Browse files Browse the repository at this point in the history
Build both x86_64 and arm64 macOS DMG's
  • Loading branch information
argilo authored Nov 9, 2024
2 parents 7a6444a + 02db5ff commit eb5476c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 34 deletions.
44 changes: 25 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ jobs:
path: Gqrx-*.AppImage
macos:
name: MacOS
runs-on: macos-13
strategy:
matrix:
arch: [x86_64, arm64]
# NOTE: in the free tier, `macos-13` is x86_64 only, while `macos-14` is arm64 only.
# when we increase the baseline to 14 eventually, we will be losing x86_64 support,
# so hopefully all of the macs will be arm64 by then.
# see https://github.com/actions/runner-images/issues/9741
runs-on: ${{ matrix.arch == 'x86_64' && 'macos-13' || 'macos-14' }}
steps:
- name: Check for Secret availability
id: secret-check
Expand All @@ -79,21 +86,20 @@ jobs:
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 uhd qt@6 || true
brew tap pothosware/homebrew-pothos
brew install soapyremote
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.23
mkdir build
cd build
cmake ..
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
Expand All @@ -102,7 +108,7 @@ jobs:
cd libad9361-iio
mkdir build
cd build
cmake ..
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
Expand All @@ -111,27 +117,27 @@ jobs:
cd SoapyPlutoSDR
mkdir build
cd build
cmake ..
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
cd /tmp
cp /Library/Frameworks/iio.framework/iio /usr/local/lib/libiio.dylib
install_name_tool -id "/usr/local/lib/libiio.dylib" /usr/local/lib/libiio.dylib
cp /Library/Frameworks/ad9361.framework/ad9361 /usr/local/lib/libad9361.dylib
install_name_tool -id "/usr/local/lib/libad9361.dylib" /usr/local/lib/libad9361.dylib
install_name_tool -delete_rpath /Library/Frameworks /usr/local/lib/libad9361.dylib
install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/libad9361.dylib
install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so
install_name_tool -change @rpath/ad9361.framework/Versions/0.2/ad9361 /usr/local/lib/libad9361.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so
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 ..
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
sudo make install
Expand All @@ -140,7 +146,7 @@ jobs:
cd gr-osmosdr
mkdir build
cd build
cmake -DCMAKE_CXX_FLAGS=-Wno-register ..
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-Wno-register ..
LIBRARY_PATH=/usr/local/opt/icu4c/lib make -j4
sudo make install
- name: Install Apple certificate
Expand All @@ -166,7 +172,7 @@ jobs:
with:
fetch-depth: 0
- name: Configure
run: mkdir build && cd build && cmake ..
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..
- name: Compile
working-directory: build
run: make -j4
Expand Down Expand Up @@ -206,7 +212,7 @@ jobs:
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: gqrx-macos-${{ github.run_id }}
name: gqrx-macos-${{ matrix.arch }}-${{ github.run_id }}
path: Gqrx-*.dmg
windows:
runs-on: windows-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
name: MacOS CI
strategy:
matrix:
os: [macos-13, macos-14]
os: [macos-13, macos-latest]
backend: [Portaudio, Gr-audio]
runs-on: ${{ matrix.os }}
steps:
Expand Down
25 changes: 12 additions & 13 deletions macos_bundle.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash -e

GQRX_VERSION=$(<build/version.txt)
GQRX_VERSION="$(<build/version.txt)"
IDENTITY=Y3GC27WZ4S
BREW_PREFIX="$(brew --prefix)"
MACDEPLOYQT6="${BREW_PREFIX}"/opt/qt@6/bin/macdeployqt

mkdir -p Gqrx.app/Contents/MacOS
mkdir -p Gqrx.app/Contents/Resources
Expand All @@ -14,8 +16,6 @@ mkdir -p Gqrx.app/Contents/soapy-modules
<dict>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>CFBundleGetInfoString</key>
<string>Gqrx</string>
<key>CFBundleExecutable</key>
<string>gqrx</string>
<key>CFBundleIdentifier</key>
Expand Down Expand Up @@ -51,25 +51,24 @@ EOM

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

dylibbundler -s /usr/local/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/
/usr/local/opt/qt@6/bin/macdeployqt Gqrx.app -no-strip -always-overwrite # TODO: Remove macdeployqt workaround
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/
"${MACDEPLOYQT6}" Gqrx.app -no-strip -always-overwrite # TODO: Remove macdeployqt workaround
if [ "$1" = "true" ]; then
/usr/local/opt/qt@6/bin/macdeployqt Gqrx.app -no-strip -always-overwrite -sign-for-notarization=$IDENTITY
"${MACDEPLOYQT6}" Gqrx.app -no-strip -always-overwrite -sign-for-notarization="${IDENTITY}"
else
/usr/local/opt/qt@6/bin/macdeployqt Gqrx.app -no-strip -always-overwrite
"${MACDEPLOYQT6}" Gqrx.app -no-strip -always-overwrite
fi
cp /usr/local/lib/libbrotlicommon.1.dylib Gqrx.app/Contents/Frameworks # TODO: Remove macdeployqt workaround
install_name_tool -change @loader_path/../../../../opt/libpng/lib/libpng16.16.dylib @executable_path/../Frameworks/libpng16.16.dylib Gqrx.app/Contents/Frameworks/libfreetype.6.dylib

for f in Gqrx.app/Contents/libs/*.dylib Gqrx.app/Contents/soapy-modules/*.so Gqrx.app/Contents/Frameworks/*.framework Gqrx.app/Contents/Frameworks/libbrotlicommon.1.dylib Gqrx.app/Contents/Frameworks/libsharpyuv.0.dylib Gqrx.app/Contents/Frameworks/libfreetype.6.dylib Gqrx.app/Contents/MacOS/gqrx
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
do
if [ "$1" = "true" ]; then
codesign --force --verify --verbose --timestamp --options runtime --entitlements /tmp/Entitlements.plist --sign $IDENTITY $f
codesign --force --verify --verbose --timestamp --options runtime --entitlements /tmp/Entitlements.plist --sign "${IDENTITY}" "$f"
else
codesign --remove-signature $f
codesign --remove-signature "$f"
fi
done
3 changes: 2 additions & 1 deletion resources/news.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
2.17.6: In progress...

NEW: Fetch RDS Program Service & RadioText via remote control.
NEW: DMG release for ARM-based Macs.
IMPROVED: Save I/Q recording format to settings.
IMPROVED: Reduced CPU utilization of plot and waterfall display.
IMPROVED: Display and formatting of RDS data.
FIXED: Decoding of RDS flags.
CHANGED: DMG release requires macOS 13.7 or later.
CHANGED: x86 DMG release requires macOS 13.7 or later.


2.17.5: Released April 18, 2024
Expand Down

0 comments on commit eb5476c

Please sign in to comment.