Install Blink Qt locally
------------------------

# Install Xcode from Apple
# Install MacPorts from https://www.macports.org
# Install python from https://www.python.org

To install blink-qt and its dependencies:

chmod +x ./macos/install_blink.sh
./macos/install_blink.sh

Everything is installed into a dedicated virtualenv:

~/work/sipsimple-python-<version>-<arch>-env

This is the same environment used by the python3-sipsimple build scripts, so a
SIP SIMPLE SDK that was already built there is reused instead of being
recompiled. On subsequent runs the (slow) PJSIP build is skipped whenever an
importable sipsimple of a sufficient version is already present.

The SIP SIMPLE SDK and its dependencies are installed from pinned, tagged
GitHub releases (see macos/python-requirements.txt and
macos/sipsimple-requirements.txt) rather than cloned via darcs.

To run Blink in place:

./run

To run Blink from the virtualenv, activate it and run blink:

source ./macos/activate_venv.sh
blink


Making Blink Qt app
-------------------

Activate the virtualenv first so pyinstaller can find PyQt6, the SIP SIMPLE
SDK and blink:

source ./macos/activate_venv.sh

Generate a spec file used by pyinstaller using make_spec.sh script. The
resulting file must be tweaked, see the modified blink.specs file.

Copy blink.spec in the main source directory, edit it and set
codesign_identity to your Developer id.

pyinstaller blink.spec -y

The generated app can then be found in dist/ folder (Blink-Qt.app). Note that
dist/Blink.app, if present, is the separate Cocoa version of Blink.

sudo port install create-dmg

To generate a .dmg run:

./macos/create_dmg.sh 

Note. The resulting DMG has a very large size due to bundling of all system
installed Qt6 frameworks and Python packages.  This can be optimized by
removing unused libraries during building the app stage.


Local storage
-------------

Blink Qt configuration and data is stored inside the folder:

~/Library/Application\ Support/Blink-Qt/


Qt6 notes
---------

Running on MacOS

https://stackoverflow.com/questions/33090346/is-there-any-way-to-use-qtwebengine-without-opengl

export QMLSCENE_DEVICE=softwarecontext


install_name_tool -add_rpath /Users/adigeo/.venv/blinqt5-windows/lib/python3.9/site-packages/PyQt5/Qt/lib  /Users/adigeo/.venv/blinqt5-windows/lib/python3.9/site-packages/PyQt5/QtWebKit.so
install_name_tool -add_rpath /Users/adigeo/.venv/blinqt5-windows/lib/python3.9/site-packages/PyQt5/Qt/lib  /Users/adigeo/.venv/blinqt5-windows/lib/python3.9/site-packages/PyQt5/QtWebKitWidgets.so
