Chris@722: #!/bin/bash Chris@722: Chris@722: set -eu Chris@722: Chris@722: app="$1" Chris@722: if [ -z "$app" ]; then Chris@722: echo "Usage: $0 " Chris@722: echo "Provide appname without the .app extension, please" Chris@722: exit 2 Chris@722: fi Chris@722: Chris@722: PYQT_DIR=/Library/Python/2.7/site-packages/PyQt5 Chris@722: Chris@722: if [ ! -d "$PYQT_DIR" ]; then Chris@722: echo "PyQt directory $PYQT_DIR not found - is it installed?" Chris@722: exit 2 Chris@722: fi Chris@722: Chris@722: if [ ! -f "$PYQT_DIR/sip.so" ]; then Chris@722: echo "sip.so not found in $PYQT_DIR - did you remember --sip-module PyQt5.sip when building sip?" Chris@722: exit 2 Chris@722: fi Chris@722: Chris@722: ENUM_EGG=/Library/Python/2.7/site-packages/enum34-1.1.6-py2.7.egg Chris@722: Chris@722: if [ ! -f "$ENUM_EGG" ]; then Chris@722: echo "Enum module egg $ENUM_EGG not found - install it or update the reference in this script" Chris@722: exit 2 Chris@722: fi Chris@722: Chris@722: pydir="$app.app/Contents/MacOS/Py2.7" Chris@722: mkdir -p "$pydir/PyQt5" Chris@722: mkdir -p "$pydir/enum" Chris@722: Chris@722: echo Chris@722: echo "Copying PyQt libraries..." Chris@722: for library in Qt QtCore QtGui QtWidgets sip; do Chris@722: cp "$PYQT_DIR/$library.so" "$pydir/PyQt5/" Chris@722: done Chris@722: cp "$PYQT_DIR/__init__.py" "$pydir/PyQt5/" Chris@722: Chris@722: echo Chris@722: echo "Copying enum library..." Chris@722: ( cd "$pydir" ; mkdir -p tmp ; cd tmp ; unzip "$ENUM_EGG" ; cp enum/__init__.py ../enum/ ; cd .. ; rm -rf tmp ) Chris@722: Chris@722: echo "Done" Chris@722: