def main(): args = get_args() if common.is_mac_platform(): deploy_mac(args) return (qt_install_info, qt_install) = get_qt_install_info(args.qmake_binary) qtcreator_binary_path = os.path.dirname(args.qtcreator_binary) install_dir = os.path.abspath(os.path.join(qtcreator_binary_path, '..')) if common.is_linux_platform(): qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt') else: qt_deploy_prefix = os.path.join(install_dir, 'bin') chrpath_bin = None if common.is_linux_platform(): chrpath_bin = which('chrpath') if chrpath_bin == None: print("Cannot find required binary 'chrpath'.") sys.exit(2) plugins = [ 'assetimporters', 'accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', 'platforminputcontexts', 'platforms', 'printsupport', 'qmltooling', 'sqldrivers', 'styles', 'xcbglintegrations', 'wayland-decoration-client', 'wayland-graphics-integration-client', 'wayland-shell-integration', 'tls' ] if common.is_windows_platform(): global debug_build debug_build = is_debug(args.qtcreator_binary) if common.is_windows_platform(): copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.bin, qt_install.plugins, qt_install.qml, plugins) else: copy_qt_libs(qt_deploy_prefix, qt_install.bin, qt_install.lib, qt_install.plugins, qt_install.qml, plugins) copy_translations(install_dir, qt_install.translations) if args.llvm_path: deploy_libclang(install_dir, args.llvm_path, chrpath_bin) if args.elfutils_path: deploy_elfutils(install_dir, chrpath_bin, args) if not common.is_windows_platform(): print("fixing rpaths...") 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)
def main(): try: opts, args = getopt.gnu_getopt(sys.argv[1:], 'hi', ['help', 'ignore-errors']) except getopt.GetoptError: usage() sys.exit(2) for o, _ in opts: if o in ('-h', '--help'): usage() sys.exit(0) if o in ('-i', '--ignore-errors'): global ignoreErrors ignoreErrors = True print "Note: Ignoring all errors" if len(args) < 1: usage() sys.exit(2) install_dir = args[0] if common.is_linux_platform(): qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt') else: qt_deploy_prefix = os.path.join(install_dir, 'bin') qmake_bin = 'qmake' if len(args) > 1: qmake_bin = args[1] qmake_bin = which(qmake_bin) if qmake_bin == None: print "Cannot find required binary 'qmake'." sys.exit(2) chrpath_bin = None if common.is_linux_platform(): chrpath_bin = which('chrpath') if chrpath_bin == None: print "Cannot find required binary 'chrpath'." sys.exit(2) qt_install_info = common.get_qt_install_info(qmake_bin) QT_INSTALL_LIBS = qt_install_info['QT_INSTALL_LIBS'] QT_INSTALL_BINS = qt_install_info['QT_INSTALL_BINS'] QT_INSTALL_PLUGINS = qt_install_info['QT_INSTALL_PLUGINS'] QT_INSTALL_IMPORTS = qt_install_info['QT_INSTALL_IMPORTS'] #OPENMV-DIFF# #QT_INSTALL_QML = qt_install_info['QT_INSTALL_QML'] #OPENMV-DIFF# QT_INSTALL_QML = "" #OPENMV-DIFF# QT_INSTALL_TRANSLATIONS = qt_install_info['QT_INSTALL_TRANSLATIONS'] #OPENMV-DIFF# #plugins = ['accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', 'platforminputcontexts', 'platforms', 'printsupport', 'sqldrivers', 'xcbglintegrations'] #OPENMV-DIFF# plugins = ['egldeviceintegrations', 'iconengines', 'imageformats', 'platforms', 'printsupport', 'sqldrivers', 'xcbglintegrations'] #OPENMV-DIFF# imports = ['Qt', 'QtWebKit'] if common.is_windows_platform(): global debug_build debug_build = is_debug_build(install_dir) if common.is_windows_platform(): copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) else: copy_qt_libs(qt_deploy_prefix, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) copy_translations(install_dir, QT_INSTALL_TRANSLATIONS) if "LLVM_INSTALL_DIR" in os.environ: deploy_libclang(install_dir, os.environ["LLVM_INSTALL_DIR"], chrpath_bin) if not common.is_windows_platform(): print "fixing rpaths..." common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin) #OPENMV-DIFF# #add_qt_conf(os.path.join(install_dir, 'libexec', 'qtcreator'), qt_deploy_prefix) # e.g. for qml2puppet #OPENMV-DIFF# add_qt_conf(os.path.join(install_dir, 'bin'), qt_deploy_prefix)
def main(): try: opts, args = getopt.gnu_getopt(sys.argv[1:], 'hi', ['help', 'ignore-errors']) except getopt.GetoptError: usage() sys.exit(2) for o, _ in opts: if o in ('-h', '--help'): usage() sys.exit(0) if o in ('-i', '--ignore-errors'): global ignoreErrors ignoreErrors = True print("Note: Ignoring all errors") slaq_binary = os.path.abspath(args[0]) if common.is_windows_platform( ) and not slaq_binary.lower().endswith(".exe"): slaq_binary = slaq_binary + ".exe" if len(args) < 1 or not os.path.isfile(slaq_binary): usage() sys.exit(2) slaq_binary_path = os.path.dirname(slaq_binary) install_dir = os.path.abspath(slaq_binary_path) qt_deploy_prefix = install_dir qmake_bin = 'qmake' if len(args) > 1: qmake_bin = args[1] qmake_bin = which(qmake_bin) if qmake_bin == None: print("Cannot find required binary 'qmake'.") sys.exit(2) chrpath_bin = None if common.is_linux_platform(): chrpath_bin = which('chrpath') if chrpath_bin == None: print("Cannot find required binary 'chrpath'.") sys.exit(2) qt_install_info = common.get_qt_install_info(qmake_bin) QT_INSTALL_LIBS = qt_install_info['QT_INSTALL_LIBS'] QT_INSTALL_BINS = qt_install_info['QT_INSTALL_BINS'] QT_INSTALL_PLUGINS = qt_install_info['QT_INSTALL_PLUGINS'] QT_INSTALL_IMPORTS = qt_install_info['QT_INSTALL_IMPORTS'] QT_INSTALL_QML = qt_install_info['QT_INSTALL_QML'] plugins = [ 'codecs', 'audio', 'imageformats', 'platformthemes', 'mediaservice', 'platforms', 'bearer', 'xcbglintegrations' ] imports = ['Qt'] qmlimports = [ 'Qt', 'QtQuick', 'QtQml', 'QtMultimedia', 'QtGraphicalEffects', 'QtQuick.2', 'QtWebEngine' ] extralibs = ['libstdc++.so'] if common.is_windows_platform(): libraries = [] copy_libs(qt_deploy_prefix, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports, qmlimports, libraries) else: lddlibs = common.ldd([slaq_binary]) libraries = [ lib for lib in lddlibs if QT_INSTALL_LIBS in lib or any(s in lib for s in extralibs) ] #add extra lib no included in ldd libraries.append(os.path.join(QT_INSTALL_LIBS, "libQt5XcbQpa.so.5")) libraries.append(os.path.join(QT_INSTALL_LIBS, "libQt5DBus.so.5")) copy_libs(qt_deploy_prefix, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports, qmlimports, libraries) if not common.is_windows_platform(): print("fixing rpaths...") common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin) add_qt_conf(install_dir, qt_deploy_prefix)
def main(): try: opts, args = getopt.gnu_getopt(sys.argv[1:], 'hi', ['help', 'ignore-errors']) except getopt.GetoptError: usage() sys.exit(2) for o, _ in opts: if o in ('-h', '--help'): usage() sys.exit(0) if o in ('-i', '--ignore-errors'): global ignoreErrors ignoreErrors = True print("Note: Ignoring all errors") qtcreator_binary = os.path.abspath(args[0]) if common.is_windows_platform() and not qtcreator_binary.lower().endswith(".exe"): qtcreator_binary = qtcreator_binary + ".exe" if len(args) < 1 or not os.path.isfile(qtcreator_binary): usage() sys.exit(2) qtcreator_binary_path = os.path.dirname(qtcreator_binary) install_dir = os.path.abspath(os.path.join(qtcreator_binary_path, '..')) if common.is_linux_platform(): qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt') else: qt_deploy_prefix = os.path.join(install_dir, 'bin') qmake_bin = 'qmake' if len(args) > 1: qmake_bin = args[1] qmake_bin = which(qmake_bin) if qmake_bin == None: print("Cannot find required binary 'qmake'.") sys.exit(2) chrpath_bin = None if common.is_linux_platform(): chrpath_bin = which('chrpath') if chrpath_bin == None: print("Cannot find required binary 'chrpath'.") sys.exit(2) qt_install_info = common.get_qt_install_info(qmake_bin) QT_INSTALL_LIBS = qt_install_info['QT_INSTALL_LIBS'] QT_INSTALL_BINS = qt_install_info['QT_INSTALL_BINS'] QT_INSTALL_PLUGINS = qt_install_info['QT_INSTALL_PLUGINS'] QT_INSTALL_IMPORTS = qt_install_info['QT_INSTALL_IMPORTS'] QT_INSTALL_QML = qt_install_info['QT_INSTALL_QML'] QT_INSTALL_TRANSLATIONS = qt_install_info['QT_INSTALL_TRANSLATIONS'] plugins = ['accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', 'platforminputcontexts', 'platforms', 'printsupport', 'qmltooling', 'sqldrivers', 'styles', 'xcbglintegrations', 'wayland-decoration-client', 'wayland-graphics-integration-client', 'wayland-shell-integration', ] imports = ['Qt', 'QtWebKit'] if common.is_windows_platform(): global debug_build debug_build = is_debug(qtcreator_binary) if common.is_windows_platform(): copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) else: copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) copy_translations(install_dir, QT_INSTALL_TRANSLATIONS) if "LLVM_INSTALL_DIR" in os.environ: deploy_libclang(install_dir, os.environ["LLVM_INSTALL_DIR"], chrpath_bin) if not common.is_windows_platform(): print("fixing rpaths...") 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)
def main(): try: opts, args = getopt.gnu_getopt(sys.argv[1:], 'hi', ['help', 'ignore-errors']) except getopt.GetoptError: usage() sys.exit(2) for o, _ in opts: if o in ('-h', '--help'): usage() sys.exit(0) if o in ('-i', '--ignore-errors'): global ignoreErrors ignoreErrors = True print "Note: Ignoring all errors" if len(args) < 1: usage() sys.exit(2) install_dir = args[0] if common.is_linux_platform(): qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt') else: qt_deploy_prefix = os.path.join(install_dir, 'bin') qmake_bin = 'qmake' if len(args) > 1: qmake_bin = args[1] qmake_bin = which(qmake_bin) if qmake_bin == None: print "Cannot find required binary 'qmake'." sys.exit(2) chrpath_bin = None if common.is_linux_platform(): chrpath_bin = which('chrpath') if chrpath_bin == None: print "Cannot find required binary 'chrpath'." sys.exit(2) qt_install_info = common.get_qt_install_info(qmake_bin) QT_INSTALL_LIBS = qt_install_info['QT_INSTALL_LIBS'] QT_INSTALL_BINS = qt_install_info['QT_INSTALL_BINS'] QT_INSTALL_PLUGINS = qt_install_info['QT_INSTALL_PLUGINS'] QT_INSTALL_IMPORTS = qt_install_info['QT_INSTALL_IMPORTS'] QT_INSTALL_QML = "" QT_INSTALL_TRANSLATIONS = qt_install_info['QT_INSTALL_TRANSLATIONS'] plugins = ['egldeviceintegrations', 'iconengines', 'imageformats', 'platforms', 'printsupport', 'sqldrivers', 'xcbglintegrations'] imports = ['Qt', 'QtWebKit'] if common.is_windows_platform(): global debug_build debug_build = is_debug_build(install_dir) if common.is_windows_platform(): copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) else: copy_qt_libs(qt_deploy_prefix, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) if "LLVM_INSTALL_DIR" in os.environ: deploy_libclang(install_dir, os.environ["LLVM_INSTALL_DIR"], chrpath_bin) if not common.is_windows_platform(): print "fixing rpaths..." 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, 'bin'), qt_deploy_prefix)
## ############################################################################# import argparse import os import subprocess import sys import common def parse_arguments(): parser = argparse.ArgumentParser(description="Deploy and 7z a directory of plugins.") parser.add_argument('--7z', help='path to 7z binary', default='7z.exe' if common.is_windows_platform() else '7z', metavar='<7z_binary>', dest='sevenzip') parser.add_argument('--qmake_binary', help='path to qmake binary which was used for compilation', required=common.is_linux_platform(), metavar='<qmake_binary>') parser.add_argument('source_directory', help='directory to deploy and 7z') parser.add_argument('target_file', help='target file path of the resulting 7z') return parser.parse_args() if __name__ == "__main__": arguments = parse_arguments() if common.is_linux_platform(): qt_install_info = common.get_qt_install_info(arguments.qmake_binary) common.fix_rpaths(arguments.source_directory, os.path.join(arguments.source_directory, 'lib', 'Qt', 'lib'), qt_install_info) subprocess.check_call([arguments.sevenzip, 'a', '-mx9', arguments.target_file, os.path.join(arguments.source_directory, '*')])
def main(): args = get_args() qtcreator_binary_path = os.path.dirname(args.qtcreator_binary) install_dir = os.path.abspath(os.path.join(qtcreator_binary_path, '..')) if common.is_linux_platform(): qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt') else: qt_deploy_prefix = os.path.join(install_dir, 'bin') chrpath_bin = None if common.is_linux_platform(): chrpath_bin = which('chrpath') if chrpath_bin == None: print("Cannot find required binary 'chrpath'.") sys.exit(2) qt_install_info = common.get_qt_install_info(args.qmake_binary) QT_INSTALL_LIBS = qt_install_info['QT_INSTALL_LIBS'] QT_INSTALL_BINS = qt_install_info['QT_INSTALL_BINS'] QT_INSTALL_PLUGINS = qt_install_info['QT_INSTALL_PLUGINS'] QT_INSTALL_IMPORTS = qt_install_info['QT_INSTALL_IMPORTS'] QT_INSTALL_QML = qt_install_info['QT_INSTALL_QML'] QT_INSTALL_TRANSLATIONS = qt_install_info['QT_INSTALL_TRANSLATIONS'] plugins = [ 'assetimporters', 'accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', 'platforminputcontexts', 'platforms', 'printsupport', 'qmltooling', 'sqldrivers', 'styles', 'xcbglintegrations', 'wayland-decoration-client', 'wayland-graphics-integration-client', 'wayland-shell-integration', ] imports = ['Qt', 'QtWebKit'] if common.is_windows_platform(): global debug_build debug_build = is_debug(args.qtcreator_binary) if common.is_windows_platform(): copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) else: copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) copy_translations(install_dir, QT_INSTALL_TRANSLATIONS) if "LLVM_INSTALL_DIR" in os.environ: deploy_libclang(install_dir, os.environ["LLVM_INSTALL_DIR"], chrpath_bin) if args.elfutils_path: deploy_elfutils(install_dir, chrpath_bin, args) if not common.is_windows_platform(): print("fixing rpaths...") 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)
description="Deploy and 7z a directory of plugins.") parser.add_argument( '--7z', help='path to 7z binary', default='7z.exe' if common.is_windows_platform() else '7z', metavar='<7z_binary>', dest='sevenzip') parser.add_argument( '--qmake_binary', help='path to qmake binary which was used for compilation', required=common.is_linux_platform(), metavar='<qmake_binary>') parser.add_argument('source_directory', help='directory to deploy and 7z') parser.add_argument('target_file', help='target file path of the resulting 7z') return parser.parse_args() if __name__ == "__main__": arguments = parse_arguments() if common.is_linux_platform(): qt_install_info = common.get_qt_install_info(arguments.qmake_binary) common.fix_rpaths( arguments.source_directory, os.path.join(arguments.source_directory, 'lib', 'qtcreator'), qt_install_info) subprocess.check_call([ arguments.sevenzip, 'a', '-mx9', arguments.target_file, os.path.join(arguments.source_directory, '*') ])
def main(): try: opts, args = getopt.gnu_getopt(sys.argv[1:], 'hi', ['help', 'ignore-errors']) except getopt.GetoptError: usage() sys.exit(2) for o, _ in opts: if o in ('-h', '--help'): usage() sys.exit(0) if o in ('-i', '--ignore-errors'): global ignoreErrors ignoreErrors = True print("Note: Ignoring all errors") qtcreator_binary = os.path.abspath(args[0]) if common.is_windows_platform( ) and not qtcreator_binary.lower().endswith(".exe"): qtcreator_binary = qtcreator_binary + ".exe" if len(args) < 1 or not os.path.isfile(qtcreator_binary): usage() sys.exit(2) qtcreator_binary_path = os.path.dirname(qtcreator_binary) install_dir = os.path.abspath(os.path.join(qtcreator_binary_path, '..')) if common.is_linux_platform(): qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt') else: qt_deploy_prefix = os.path.join(install_dir, 'bin') qmake_bin = 'qmake' if len(args) > 1: qmake_bin = args[1] qmake_bin = which(qmake_bin) if qmake_bin == None: print("Cannot find required binary 'qmake'.") sys.exit(2) chrpath_bin = None if common.is_linux_platform(): chrpath_bin = which('chrpath') if chrpath_bin == None: print("Cannot find required binary 'chrpath'.") sys.exit(2) qt_install_info = common.get_qt_install_info(qmake_bin) QT_INSTALL_LIBS = qt_install_info['QT_INSTALL_LIBS'] QT_INSTALL_BINS = qt_install_info['QT_INSTALL_BINS'] QT_INSTALL_PLUGINS = qt_install_info['QT_INSTALL_PLUGINS'] QT_INSTALL_IMPORTS = qt_install_info['QT_INSTALL_IMPORTS'] QT_INSTALL_QML = qt_install_info['QT_INSTALL_QML'] QT_INSTALL_TRANSLATIONS = qt_install_info['QT_INSTALL_TRANSLATIONS'] plugins = [ 'accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', 'platforminputcontexts', 'platforms', 'printsupport', 'qmltooling', 'sqldrivers', 'styles', 'xcbglintegrations', 'wayland-decoration-client', 'wayland-graphics-integration-client', 'wayland-shell-integration', ] imports = ['Qt', 'QtWebKit'] if common.is_windows_platform(): global debug_build debug_build = is_debug(qtcreator_binary) if common.is_windows_platform(): copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) else: copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) copy_translations(install_dir, QT_INSTALL_TRANSLATIONS) if "LLVM_INSTALL_DIR" in os.environ: deploy_libclang(install_dir, os.environ["LLVM_INSTALL_DIR"], chrpath_bin) if not common.is_windows_platform(): print("fixing rpaths...") 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)