Commit 7fa6d519 authored by Eike Ziller's avatar Eike Ziller

Fix deployment of qml2puppet

The move to LIBEXEC_PATH broke running the puppet from the packages on
Linux and OS X, because there it cannot find the platform plugin
anymore.
We need to add a qt.conf for it, and because Qt Creator.app/Contents/
Resources already contains the qt.conf for Qt Creator itself, the puppet
must also move to its own subdirectory on OS X.

Change-Id: I8e8cc48c49a01e10c7d7d3cc4c73020195cd5ca9
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 51ed0da5
[Paths]
Imports = ../../Imports/qtquick1
Qml2Imports = ../../Imports/qtquick2
Plugins = ../../PlugIns
...@@ -202,14 +202,15 @@ def copy_qt_libs(install_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, qt_qml_ ...@@ -202,14 +202,15 @@ def copy_qt_libs(install_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, qt_qml_
shutil.rmtree(target) shutil.rmtree(target)
shutil.copytree(qt_qml_dir, target, ignore=copy_ignore_func, symlinks=True) shutil.copytree(qt_qml_dir, target, ignore=copy_ignore_func, symlinks=True)
def add_qt_conf(install_dir): def add_qt_conf(target_dir, install_dir):
print "Creating qt.conf:" qtconf_filepath = os.path.join(target_dir, 'qt.conf')
f = open(install_dir + '/bin/qt.conf', 'w') print('Creating qt.conf in "{0}":'.format(qtconf_filepath))
f = open(qtconf_filepath, 'w')
f.write('[Paths]\n') f.write('[Paths]\n')
f.write('Libraries=../lib/qtcreator\n') f.write('Libraries={0}\n'.format(os.path.relpath(os.path.join(install_dir, 'lib', 'qtcreator'), target_dir).replace('\\', '/')))
f.write('Plugins=plugins\n') f.write('Plugins={0}\n'.format(os.path.relpath(os.path.join(install_dir, 'bin', 'plugins'), target_dir).replace('\\', '/')))
f.write('Imports=imports\n') f.write('Imports={0}\n'.format(os.path.relpath(os.path.join(install_dir, 'bin', 'imports'), target_dir).replace('\\', '/')))
f.write('Qml2Imports=qml\n') f.write('Qml2Imports={0}\n'.format(os.path.relpath(os.path.join(install_dir, 'bin', 'qml'), target_dir).replace('\\', '/')))
f.close() f.close()
def copy_translations(install_dir, qt_tr_dir): def copy_translations(install_dir, qt_tr_dir):
...@@ -330,7 +331,8 @@ def main(): ...@@ -330,7 +331,8 @@ def main():
if not sys.platform.startswith('win'): if not sys.platform.startswith('win'):
fix_rpaths(chrpath_bin, install_dir) fix_rpaths(chrpath_bin, install_dir)
add_qt_conf(install_dir) add_qt_conf(os.path.join(install_dir, 'libexec', 'qtcreator'), install_dir) # e.g. for qml2puppet
add_qt_conf(os.path.join(install_dir, 'bin'), install_dir)
if __name__ == "__main__": if __name__ == "__main__":
if sys.platform == 'darwin': if sys.platform == 'darwin':
......
...@@ -46,6 +46,12 @@ if [ ! -f "$1/Contents/Resources/ios/qt.conf" ]; then ...@@ -46,6 +46,12 @@ if [ ! -f "$1/Contents/Resources/ios/qt.conf" ]; then
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$1/Contents/Resources/ios/qt.conf" || exit 1 cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$1/Contents/Resources/ios/qt.conf" || exit 1
fi fi
# copy qml2puppet's qt.conf
if [ ! -f "$1/Contents/Resources/qmldesigner/qt.conf" ]; then
echo "- Copying qmldesigner/qt.conf"
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qmldesigner_qt.conf" "$1/Contents/Resources/qmldesigner/qt.conf" || exit 1
fi
# copy Qt translations # copy Qt translations
# check for known existing translation to avoid copying multiple times # check for known existing translation to avoid copying multiple times
if [ ! -f "$1/Contents/Resources/translations/qt_de.qm" ]; then if [ ! -f "$1/Contents/Resources/translations/qt_de.qm" ]; then
...@@ -82,7 +88,7 @@ fi ...@@ -82,7 +88,7 @@ fi
if [ ! -d "$1/Contents/Frameworks/QtCore.framework" ]; then if [ ! -d "$1/Contents/Frameworks/QtCore.framework" ]; then
qml2puppetapp="$1/Contents/Resources/qml2puppet" qml2puppetapp="$1/Contents/Resources/qmldesigner/qml2puppet"
if [ -f "$qml2puppetapp" ]; then if [ -f "$qml2puppetapp" ]; then
qml2puppetArgument="-executable=$qml2puppetapp" qml2puppetArgument="-executable=$qml2puppetapp"
fi fi
......
...@@ -291,7 +291,10 @@ QString PuppetCreator::qmlPuppetDirectory(PuppetType puppetType) const ...@@ -291,7 +291,10 @@ QString PuppetCreator::qmlPuppetDirectory(PuppetType puppetType) const
QString PuppetCreator::defaultPuppetFallbackDirectory() QString PuppetCreator::defaultPuppetFallbackDirectory()
{ {
return Core::ICore::libexecPath(); if (Utils::HostOsInfo::isMacHost())
return Core::ICore::libexecPath() + QLatin1String("/qmldesigner");
else
return Core::ICore::libexecPath();
} }
QString PuppetCreator::qmlPuppetFallbackDirectory() const QString PuppetCreator::qmlPuppetFallbackDirectory() const
......
...@@ -4,7 +4,8 @@ TEMPLATE = app ...@@ -4,7 +4,8 @@ TEMPLATE = app
include(../../../../qtcreator.pri) include(../../../../qtcreator.pri)
DESTDIR = $$IDE_LIBEXEC_PATH osx: DESTDIR = $$IDE_LIBEXEC_PATH/qmldesigner
else: DESTDIR = $$IDE_LIBEXEC_PATH
include(../../../rpath.pri) include(../../../rpath.pri)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment