#!/usr/bin/env bash

PYTHON="/opt/local/bin/python3.7"
QTROOT='/opt/local/libexec/qt5'

${PYTHON} app.py

APPBUNDLE=dist/test.app

rm ${APPBUNDLE}/Contents/Resources/qt.conf
mkdir -p ${APPBUNDLE}/Contents/PlugIns/platforms
cp ${QTROOT}/plugins/platforms/libqcocoa.dylib ${APPBUNDLE}/Contents/PlugIns/platforms/

${QTROOT}/bin/macdeployqt ${APPBUNDLE}

ln -s Versions/5/Helpers ${APPBUNDLE}/Contents/Frameworks/QtWebEngineCore.framework/Helpers
ln -s Versions/5/QtWebEngineCore ${APPBUNDLE}/Contents/Frameworks/QtWebEngineCore.framework/QtWebEngineCore
ln -s Versions/5/Resources ${APPBUNDLE}/Contents/Frameworks/QtWebEngineCore.framework/Resources
