forked from qt-creator/qt-creator
Build/deploy: Move qt.conf creation to deploy.py
Moving things away from deployqtHelper_mac.sh Change-Id: I41810ac060bde63f3b11af852bb2e2f37d822bf4 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
2
dist/installer/mac/ios_qt.conf
vendored
2
dist/installer/mac/ios_qt.conf
vendored
@@ -1,2 +0,0 @@
|
|||||||
[Paths]
|
|
||||||
Plugins = ../../../PlugIns
|
|
||||||
5
dist/installer/mac/libexec_qt.conf
vendored
5
dist/installer/mac/libexec_qt.conf
vendored
@@ -1,5 +0,0 @@
|
|||||||
[Paths]
|
|
||||||
Prefix = ../..
|
|
||||||
Imports = Imports/qtquick1
|
|
||||||
Qml2Imports = Imports/qtquick2
|
|
||||||
Plugins = PlugIns
|
|
||||||
4
dist/installer/mac/qt.conf
vendored
4
dist/installer/mac/qt.conf
vendored
@@ -1,4 +0,0 @@
|
|||||||
[Paths]
|
|
||||||
Binaries = MacOS
|
|
||||||
Qml2Imports = Imports/qtquick2
|
|
||||||
Plugins = PlugIns
|
|
||||||
@@ -197,19 +197,59 @@ def deploy_imports(qtc_binary_path, qt_install):
|
|||||||
common.copytree(qt_install.qml, destdir, ignore=ignored_qt_lib_files, symlinks=True)
|
common.copytree(qt_install.qml, destdir, ignore=ignored_qt_lib_files, symlinks=True)
|
||||||
|
|
||||||
|
|
||||||
|
def qt_conf_contents():
|
||||||
|
if common.is_linux_platform():
|
||||||
|
return '''[Paths]
|
||||||
|
Prefix={0}
|
||||||
|
Binaries=bin
|
||||||
|
Libraries=lib
|
||||||
|
Plugins=plugins
|
||||||
|
Qml2Imports=qml
|
||||||
|
'''
|
||||||
|
if common.is_windows_platform():
|
||||||
|
return '''[Paths]
|
||||||
|
Prefix={0}
|
||||||
|
Binaries=.
|
||||||
|
Libraries=.
|
||||||
|
Plugins=plugins
|
||||||
|
Qml2Imports=qml
|
||||||
|
'''
|
||||||
|
return '''[Paths]
|
||||||
|
Prefix={0}
|
||||||
|
Binaries=MacOS
|
||||||
|
Libraries=Frameworks
|
||||||
|
Plugins=PlugIns
|
||||||
|
Qml2Imports=Imports/qtquick2
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
def add_qt_conf(target_path, qt_prefix_path):
|
def add_qt_conf(target_path, qt_prefix_path):
|
||||||
qtconf_filepath = os.path.join(target_path, 'qt.conf')
|
qtconf_filepath = os.path.join(target_path, 'qt.conf')
|
||||||
prefix_path = os.path.relpath(qt_prefix_path, target_path).replace('\\', '/')
|
prefix_path = os.path.relpath(qt_prefix_path, target_path).replace('\\', '/')
|
||||||
print('Creating qt.conf in "{0}":'.format(qtconf_filepath))
|
print('Creating qt.conf in "{0}":'.format(qtconf_filepath))
|
||||||
f = open(qtconf_filepath, 'w')
|
f = open(qtconf_filepath, 'w')
|
||||||
f.write('[Paths]\n')
|
f.write(qt_conf_contents().format(prefix_path))
|
||||||
f.write('Prefix={0}\n'.format(prefix_path))
|
|
||||||
f.write('Binaries={0}\n'.format('bin' if common.is_linux_platform() else '.'))
|
|
||||||
f.write('Libraries={0}\n'.format('lib' if common.is_linux_platform() else '.'))
|
|
||||||
f.write('Plugins=plugins\n')
|
|
||||||
f.write('Qml2Imports=qml\n')
|
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
|
||||||
|
def deploy_qt_conf_files(qtc_binary_path):
|
||||||
|
if common.is_linux_platform():
|
||||||
|
qt_prefix_path = os.path.join(qtc_binary_path, '..', 'lib', 'Qt')
|
||||||
|
add_qt_conf(os.path.join(qtc_binary_path, '..', 'libexec', 'qtcreator'), qt_prefix_path)
|
||||||
|
add_qt_conf(os.path.join(qtc_binary_path, '..', 'lib', 'Qt', 'bin'), qt_prefix_path) # qtdiag
|
||||||
|
add_qt_conf(qtc_binary_path, qt_prefix_path) # QtC itself
|
||||||
|
if common.is_windows_platform():
|
||||||
|
add_qt_conf(qtc_binary_path, qtc_binary_path) # QtC itself, libexec, and qtdiag etc
|
||||||
|
if common.is_mac_platform():
|
||||||
|
qt_prefix_path = os.path.join(qtc_binary_path, 'Contents')
|
||||||
|
qtc_resources_path = os.path.join(qtc_binary_path, 'Contents', 'Resources')
|
||||||
|
add_qt_conf(os.path.join(qtc_resources_path, 'libexec'), qt_prefix_path)
|
||||||
|
add_qt_conf(os.path.join(qtc_resources_path, 'libexec', 'ios'), qt_prefix_path)
|
||||||
|
# The Prefix path for a qt.conf in Contents/Resources/ is handled specially/funny by Qt,
|
||||||
|
# relative paths are resolved relative to Contents/, so we must enforces Prefix=.
|
||||||
|
add_qt_conf(qtc_resources_path, qtc_resources_path) # QtC itself
|
||||||
|
|
||||||
|
|
||||||
def deploy_translations(qtc_binary_path, qt_install):
|
def deploy_translations(qtc_binary_path, qt_install):
|
||||||
print("Copying translations...")
|
print("Copying translations...")
|
||||||
translations = glob(os.path.join(qt_install.translations, '*.qm'))
|
translations = glob(os.path.join(qt_install.translations, '*.qm'))
|
||||||
@@ -387,6 +427,7 @@ def main():
|
|||||||
deploy_plugins(qtcreator_binary_path, qt_install)
|
deploy_plugins(qtcreator_binary_path, qt_install)
|
||||||
deploy_imports(qtcreator_binary_path, qt_install)
|
deploy_imports(qtcreator_binary_path, qt_install)
|
||||||
deploy_translations(qtcreator_binary_path, qt_install)
|
deploy_translations(qtcreator_binary_path, qt_install)
|
||||||
|
deploy_qt_conf_files(qtcreator_binary_path)
|
||||||
|
|
||||||
if common.is_mac_platform():
|
if common.is_mac_platform():
|
||||||
deploy_mac(args)
|
deploy_mac(args)
|
||||||
@@ -411,9 +452,6 @@ def main():
|
|||||||
if not common.is_windows_platform():
|
if not common.is_windows_platform():
|
||||||
print("fixing rpaths...")
|
print("fixing rpaths...")
|
||||||
common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin)
|
common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin)
|
||||||
add_qt_conf(os.path.join(install_dir, 'libexec', 'qtcreator'), qt_deploy_prefix) # e.g. for qml2puppet
|
|
||||||
add_qt_conf(os.path.join(qt_deploy_prefix, 'bin'), qt_deploy_prefix) # e.g. qtdiag
|
|
||||||
add_qt_conf(os.path.join(install_dir, 'bin'), qt_deploy_prefix)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -13,24 +13,6 @@ bin_src="$2"
|
|||||||
|
|
||||||
echo "Deploying Qt"
|
echo "Deploying Qt"
|
||||||
|
|
||||||
# copy qt creator qt.conf
|
|
||||||
if [ ! -f "$resource_path/qt.conf" ]; then
|
|
||||||
echo "- Copying qt.conf"
|
|
||||||
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qt.conf" "$resource_path/qt.conf" || exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# copy libexec tools' qt.conf
|
|
||||||
if [ ! -f "$libexec_path/qt.conf" ]; then
|
|
||||||
echo "- Copying libexec/qt.conf"
|
|
||||||
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/libexec_qt.conf" "$libexec_path/qt.conf" || exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# copy ios tools' qt.conf
|
|
||||||
if [ ! -f "$libexec_path/ios/qt.conf" ]; then
|
|
||||||
echo "- Copying libexec/ios/qt.conf"
|
|
||||||
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$libexec_path/ios/qt.conf" || exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# copy clang if needed
|
# copy clang if needed
|
||||||
if [ $LLVM_INSTALL_DIR ]; then
|
if [ $LLVM_INSTALL_DIR ]; then
|
||||||
if [ "$LLVM_INSTALL_DIR"/bin/clangd -nt "$libexec_path"/clang/bin/clangd ]; then
|
if [ "$LLVM_INSTALL_DIR"/bin/clangd -nt "$libexec_path"/clang/bin/clangd ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user