-
Notifications
You must be signed in to change notification settings - Fork 55
/
deploy_macos.sh
executable file
·40 lines (32 loc) · 1.14 KB
/
deploy_macos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
cd "$(dirname $0)"
. env.cfg
if [ ! -e "$QT" ]; then
echo "please edit env.cfg and set \$QT"
exit 1
fi
QMAKE="$QT/bin/qmake"
autoreconf --install
./configure
make -j8
pushd libxavna/xavna_mock_ui
$QMAKE
make -j8
popd
pushd vna_qt
rm -rf *.app
$QMAKE
make -j8
"$QT"/bin/macdeployqt vna_qt.app -libpath=../libxavna/xavna_mock_ui
cp -a ../libxavna/.libs/libxavna.0.dylib vna_qt.app/Contents/Frameworks
pushd vna_qt.app/Contents
install_name_tool -add_rpath "@executable_path/../Frameworks" MacOS/vna_qt
install_name_tool -change libxavna_mock_ui.1.dylib @executable_path/../Frameworks/libxavna_mock_ui.1.dylib MacOS/vna_qt
install_name_tool -change /usr/local/lib/libxavna.0.dylib @executable_path/../Frameworks/libxavna.0.dylib MacOS/vna_qt
install_name_tool -change /usr/local/lib/libxavna.0.dylib @executable_path/../Frameworks/libxavna.0.dylib Frameworks/libxavna_mock_ui.1.dylib
popd
rm -rf dmg_contents ../NanoVNA_QT_MacOS.dmg tmp.dmg
mkdir dmg_contents
cp -a vna_qt.app dmg_contents/
hdiutil create tmp.dmg -ov -volname "NanoVNA QT GUI" -fs HFS+ -srcfolder dmg_contents
hdiutil convert tmp.dmg -format UDZO -o ../NanoVNA_QT_MacOS.dmg