Mercurial > hg > easyhg
comparison deploy/osx/copy-pyqt.sh @ 722:5afb26b7575a
Further macOS build & test fixes
| author | Chris Cannam |
|---|---|
| date | Thu, 13 Dec 2018 11:59:18 +0000 |
| parents | |
| children | c59c17665162 |
comparison
equal
deleted
inserted
replaced
| 721:744933aba33a | 722:5afb26b7575a |
|---|---|
| 1 #!/bin/bash | |
| 2 | |
| 3 set -eu | |
| 4 | |
| 5 app="$1" | |
| 6 if [ -z "$app" ]; then | |
| 7 echo "Usage: $0 <appname>" | |
| 8 echo "Provide appname without the .app extension, please" | |
| 9 exit 2 | |
| 10 fi | |
| 11 | |
| 12 PYQT_DIR=/Library/Python/2.7/site-packages/PyQt5 | |
| 13 | |
| 14 if [ ! -d "$PYQT_DIR" ]; then | |
| 15 echo "PyQt directory $PYQT_DIR not found - is it installed?" | |
| 16 exit 2 | |
| 17 fi | |
| 18 | |
| 19 if [ ! -f "$PYQT_DIR/sip.so" ]; then | |
| 20 echo "sip.so not found in $PYQT_DIR - did you remember --sip-module PyQt5.sip when building sip?" | |
| 21 exit 2 | |
| 22 fi | |
| 23 | |
| 24 ENUM_EGG=/Library/Python/2.7/site-packages/enum34-1.1.6-py2.7.egg | |
| 25 | |
| 26 if [ ! -f "$ENUM_EGG" ]; then | |
| 27 echo "Enum module egg $ENUM_EGG not found - install it or update the reference in this script" | |
| 28 exit 2 | |
| 29 fi | |
| 30 | |
| 31 pydir="$app.app/Contents/MacOS/Py2.7" | |
| 32 mkdir -p "$pydir/PyQt5" | |
| 33 mkdir -p "$pydir/enum" | |
| 34 | |
| 35 echo | |
| 36 echo "Copying PyQt libraries..." | |
| 37 for library in Qt QtCore QtGui QtWidgets sip; do | |
| 38 cp "$PYQT_DIR/$library.so" "$pydir/PyQt5/" | |
| 39 done | |
| 40 cp "$PYQT_DIR/__init__.py" "$pydir/PyQt5/" | |
| 41 | |
| 42 echo | |
| 43 echo "Copying enum library..." | |
| 44 ( cd "$pydir" ; mkdir -p tmp ; cd tmp ; unzip "$ENUM_EGG" ; cp enum/__init__.py ../enum/ ; cd .. ; rm -rf tmp ) | |
| 45 | |
| 46 echo "Done" | |
| 47 |
