forked from fwbuilder/fwbuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_mac.sh
executable file
·94 lines (83 loc) · 1.83 KB
/
build_mac.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
export QMAKE_MAC_SDK="macosx"
export QMAKESPEC="macx-clang"
export QMAKE_MACOSX_DEPLOYMENT_TARGET=10.9
main()
{
if [ $# -eq 0 ]; then
usage
exit
fi
while [ "$1" != "" ]; do
case $1 in
-h | --help | help | usage )
usage
exit
;;
all )
configure
compile
bundle
exit
;;
configure )
configure
;;
compile )
compile
;;
bundle )
bundle
;;
* )
usage
exit 1
;;
esac
shift
done
}
usage()
{
echo "Usage: $0 [ all | configure | compile | bundle ]"
}
configure()
{
echo "==> Configuring"
qbs setup-toolchains --detect
qbs setup-qt $(which qmake) qt
if [ $? -eq 0 ]; then
echo "==> Done configuring"
else
exit 1
fi
}
compile()
{
echo "==> Compiling"
qbs config:release profile:qt
if [ $? -eq 0 ]; then
echo "==> Done compiling"
else
exit 1
fi
}
bundle()
{
BUNDLE=fwbuilder.app
BIN=${BUNDLE}/Contents/MacOS
echo "==> Bundling"
qbs install --install-root . config:release profile:qt
echo "==> Stripping binaries"
strip ${BIN}/*
echo "==> Running macdeployqt"
macdeployqt ${BUNDLE} -executable=${BIN}/fwbedit -executable=${BIN}/fwb_ipt -executable=${BIN}/fwb_pf -executable=${BIN}/fwb_ipf -executable=${BIN}/fwb_ipfw -executable=${BIN}/fwb_iosacl -executable=${BIN}/fwb_nxosacl -executable=${BIN}/fwb_pix -executable=${BIN}/fwb_procurve_acl -executable=${BIN}/fwb_junosacl
if [ $? -eq 0 ]; then
echo "==> Done bundling"
echo " To open bundle:"
echo " # open ${BUNDLE}/"
else
exit 1
fi
}
main "$@"