comparison deploy/osx/testrun.sh @ 722:5afb26b7575a

Further macOS build & test fixes
author Chris Cannam
date Thu, 13 Dec 2018 11:59:18 +0000
parents
children
comparison
equal deleted inserted replaced
721:744933aba33a 722:5afb26b7575a
1 #!/bin/bash
2
3 app="$1"
4 if [ -z "$app" ]; then
5 echo "Usage: $0 <appname>"
6 echo "Provide appname without the .app extension, please"
7 exit 2
8 fi
9
10 set -eu
11
12 qtdir=$(grep "Command:" Makefile | head -1 | awk '{ print $3; }' | sed s,/bin/.*,,)
13
14 if [ ! -d "$qtdir" ]; then
15 echo "Failed to discover Qt installation directory from Makefile, exiting"
16 exit 2
17 fi
18
19 pyqtdir=/Library/Python/2.7/site-packages/PyQt5
20
21 if [ ! -d "$pyqtdir" ]; then
22 echo "PyQt directory $pyqtdir not found - is it installed?"
23 fi
24
25 enumegg=/Library/Python/2.7/site-packages/enum34-1.1.6-py2.7.egg
26
27 if [ ! -f "$enumegg" ]; then
28 echo "Enum module egg $enumegg not found - check and maybe update the reference in this script"
29 fi
30
31 set -x
32
33 suffix=$$
34
35 move_aside() {
36 sudo mv "$qtdir" "$qtdir"_$suffix
37 sudo mv "$pyqtdir" "$pyqtdir"_$suffix
38 sudo mv "$enumegg" "$enumegg"_$suffix
39 }
40
41 restore() {
42 sudo mv "$qtdir"_$suffix "$qtdir"
43 sudo mv "$pyqtdir"_$suffix "$pyqtdir"
44 sudo mv "$enumegg"_$suffix "$enumegg"
45 }
46
47 move_aside
48 trap restore 0
49
50 "$app.app"/Contents/MacOS/$app
51