About me

I'm a web and software developer from Kaohsiung, Taiwan.
I design and implement user interfaces, also contribute to open source projects.

2013年12月24日 星期二

How to Pack a Qt Web Browser on Mac OSX

Copy QtWebProcess into app bundle (in our case, SlateKit.app):

mkdir -p SlateKit.app/Contents/libexec
cp ~/Qt5.2.0/5.2.0/clang_64/libexec/QtWebProcess SlateKit.app/Contents/libexec/

Set QPA and plugin path:

cat > SlateKit.app/Contents/libexec/qt.conf << EOF
Plugins = ../../PlugIns
Imports = ../../Resources/qml
Qml2Imports = ../../Resources/qml

Make the app bundle self-contained:

~/Qt5.2.0/5.2.0/clang_64/bin/macdeployqt SlateKit.app -qmldir=qml/ -executable=SlateKit.app/Contents/libexec/QtWebProcess -verbose=3 -dmg

Note there's a known bug of macdeployqt before Qt 5.1, here is a patched one.