gqrx/macos_bundle.sh

66 lines
2.5 KiB
Bash
Raw Normal View History

2021-10-04 19:16:49 +00:00
#!/bin/bash -e
2020-12-03 04:09:10 +00:00
GQRX_VERSION=$(<version.txt)
2021-10-06 03:11:14 +00:00
IDENTITY=Y3GC27WZ4S
2020-12-03 04:09:10 +00:00
mkdir -p Gqrx.app/Contents/MacOS
mkdir -p Gqrx.app/Contents/Resources
/bin/cat <<EOM >Gqrx.app/Contents/Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
2020-12-06 19:38:41 +00:00
<key>NSPrincipalClass</key>
<string>NSApplication</string>
2020-12-03 04:09:10 +00:00
<key>CFBundleGetInfoString</key>
<string>Gqrx</string>
<key>CFBundleExecutable</key>
<string>gqrx</string>
<key>CFBundleIdentifier</key>
2021-10-06 03:11:14 +00:00
<string>dk.gqrx.gqrx</string>
2020-12-03 04:09:10 +00:00
<key>CFBundleName</key>
2020-12-06 23:09:23 +00:00
<string>Gqrx</string>
2020-12-03 04:09:10 +00:00
<key>CFBundleIconFile</key>
<string>gqrx.icns</string>
<key>CFBundleShortVersionString</key>
<string>$GQRX_VERSION</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>IFMajorVersion</key>
<integer>1</integer>
<key>IFMinorVersion</key>
<integer>0</integer>
</dict>
</plist>
EOM
2022-01-27 18:19:07 +00:00
/bin/cat <<EOM >/tmp/Entitlements.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>
EOM
2020-12-03 04:09:10 +00:00
cp build/src/gqrx Gqrx.app/Contents/MacOS
cp resources/icons/gqrx.icns Gqrx.app/Contents/Resources
2021-01-04 01:09:32 +00:00
cp -r /usr/local/lib/SoapySDR/modules* Gqrx.app/Contents/soapy-modules
chmod 644 Gqrx.app/Contents/soapy-modules/*
2020-12-03 04:09:10 +00:00
2021-04-11 14:03:10 +00:00
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/
2021-10-04 19:16:49 +00:00
ln -sf /usr/local/opt/python@3.9/Frameworks/Python.framework /usr/local/opt/python@3.9/lib/Python.framework
2022-01-27 20:40:17 +00:00
/usr/local/opt/qt@6/bin/macdeployqt Gqrx.app -no-strip -always-overwrite
/usr/local/opt/qt@6/bin/macdeployqt Gqrx.app -no-strip -always-overwrite -sign-for-notarization=$IDENTITY
cp /usr/local/lib/libbrotlicommon.1.dylib Gqrx.app/Contents/Frameworks
2021-10-06 03:11:14 +00:00
2022-01-27 20:40:17 +00:00
for f in Gqrx.app/Contents/libs/*.dylib Gqrx.app/Contents/soapy-modules/*.so Gqrx.app/Contents/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python Gqrx.app/Contents/Frameworks/*.framework Gqrx.app/Contents/Frameworks/libbrotlicommon.1.dylib Gqrx.app/Contents/MacOS/gqrx
2021-10-06 03:11:14 +00:00
do
2022-01-27 18:19:07 +00:00
codesign --force --verify --verbose --timestamp --options runtime --entitlements /tmp/Entitlements.plist --sign $IDENTITY $f
2021-10-06 03:11:14 +00:00
done