diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-07-10 14:08:29 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2015-07-10 14:08:29 +0200 |
commit | d6da70916d566bec517aedeeae3f224b8d0489a1 (patch) | |
tree | 55c20439f5c65a81647eb7999a25c472d20c7fc5 /scripts | |
parent | c69d3ded6b67b5501b9caf0d6f29148f389007ad (diff) | |
parent | a32a9b3d2a82d38edde1b4b55cbdececd7f5333d (diff) |
Merge remote-tracking branch 'origin/3.5'
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/deployqt.py | 33 | ||||
-rwxr-xr-x | scripts/deployqtHelper_mac.sh | 6 | ||||
-rwxr-xr-x | scripts/unixdeployqt.sh | 100 |
3 files changed, 30 insertions, 109 deletions
diff --git a/scripts/deployqt.py b/scripts/deployqt.py index 23d20747851..00b70d1af46 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -191,7 +191,9 @@ def copy_qt_libs(install_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, qt_qml_ target = os.path.join(install_dir, 'bin', 'imports', qtimport) if (os.path.exists(target)): shutil.rmtree(target) - shutil.copytree(os.path.join(qt_import_dir, qtimport), target, ignore=copy_ignore_func, symlinks=True) + import_path = os.path.join(qt_import_dir, qtimport) + if os.path.exists(import_path): + shutil.copytree(import_path, target, ignore=copy_ignore_func, symlinks=True) if (os.path.exists(qt_qml_dir)): print "Copying qt quick 2 imports" @@ -230,20 +232,33 @@ def copyPreservingLinks(source, destination): shutil.copy(source, destination) def copy_libclang(install_dir, llvm_install_dir): - libsources = [] - libtarget = "" + # contains pairs of (source, target directory) + deployinfo = [] if sys.platform.startswith("win"): - libsources = [os.path.join(llvm_install_dir, 'bin', 'libclang.dll')] - libtarget = os.path.join(install_dir, 'bin') + deployinfo.append((os.path.join(llvm_install_dir, 'bin', 'libclang.dll'), + os.path.join(install_dir, 'bin'))) + deployinfo.append((os.path.join(llvm_install_dir, 'bin', 'clang-cl.exe'), + os.path.join(install_dir, 'bin'))) else: libsources = glob(os.path.join(llvm_install_dir, 'lib', 'libclang.so*')) - libtarget = os.path.join(install_dir, 'lib', 'qtcreator') + for libsource in libsources: + deployinfo.append((libsource, os.path.join(install_dir, 'lib', 'qtcreator'))) + clangbinary = os.path.join(llvm_install_dir, 'bin', 'clang') + clangbinary_targetdir = os.path.join(install_dir, 'bin') + deployinfo.append((clangbinary, clangbinary_targetdir)) + # copy link target if clang is actually a symlink + if os.path.islink(clangbinary): + linktarget = os.readlink(clangbinary) + deployinfo.append((os.path.join(os.path.dirname(clangbinary), linktarget), + os.path.join(clangbinary_targetdir, linktarget))) + resourcesource = os.path.join(llvm_install_dir, 'lib', 'clang') resourcetarget = os.path.join(install_dir, 'share', 'qtcreator', 'cplusplus', 'clang') + print "copying libclang..." - for libsource in libsources: - print libsource, '->', libtarget - copyPreservingLinks(libsource, libtarget) + for source, target in deployinfo: + print source, '->', target + copyPreservingLinks(source, target) print resourcesource, '->', resourcetarget if (os.path.exists(resourcetarget)): shutil.rmtree(resourcetarget) diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index 120a4d030a9..be7929a5ff8 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -61,6 +61,12 @@ if [ $LLVM_INSTALL_DIR ]; then # use recursive copy to make it copy symlinks as symlinks cp -Rf "$LLVM_INSTALL_DIR"/lib/libclang.*dylib "$1/Contents/Frameworks/" || exit 1 cp -Rf "$LLVM_INSTALL_DIR"/lib/clang "$1/Contents/Resources/cplusplus/" || exit 1 + clangsource="$LLVM_INSTALL_DIR"/bin/clang + clanglinktarget="$(readlink "$clangsource")" + cp -Rf "$clangsource" "$1/Contents/Resources/" || exit 1 + if [ $clanglinktarget ]; then + cp -Rf "$(dirname "$clangsource")/$clanglinktarget" "$1/Contents/Resources/$clanglinktarget" || exit 1 + fi fi _CLANG_CODEMODEL_LIB="$1/Contents/PlugIns/libClangCodeModel_debug.dylib" if [ ! -f "$_CLANG_CODEMODEL_LIB" ]; then diff --git a/scripts/unixdeployqt.sh b/scripts/unixdeployqt.sh deleted file mode 100755 index be843f3e303..00000000000 --- a/scripts/unixdeployqt.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/bash -################################################################################ -# Copyright (C) 2015 The Qt Company Ltd -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of The Qt Company Ltd, nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -################################################################################ - -if [ $# -lt 1 ]; then - echo "Usage: $(basename $1) <creator_install_dir> [qmake_path]" - exit 1 -fi - -INSTALL_DIR="$1" -QMAKE_BIN="${2:-$(which qmake)}" - -if [ ! -e "$QMAKE_BIN" ]; then - echo "Could not detetermine location of 'qmake'!" - exit 1; -fi - -CHRPATH=$(which chrpath) -if [ ! -e "$CHRPATH" ]; then - echo "Cannot find required binary 'chrpath'." - exit 1 -fi - -QT_INSTALL_LIBS="$($QMAKE_BIN -query QT_INSTALL_LIBS)" -QT_INSTALL_PLUGINS="$($QMAKE_BIN -query QT_INSTALL_PLUGINS)" -QT_INSTALL_IMPORTS="$($QMAKE_BIN -query QT_INSTALL_IMPORTS)" -QT_INSTALL_TRANSLATIONS="$($QMAKE_BIN -query QT_INSTALL_TRANSLATIONS)" - -plugins="accessible designer iconengines imageformats sqldrivers" -imports="Qt QtWebKit" -tr_catalogs="assistant designer qt qt_help" -tr_languages="$(cd $INSTALL_DIR/share/qtcreator/translations; echo qtcreator_* | sed -e 's,[^_]*_\([^.]*\)\.,\1 ,g')" - -function fix_rpaths() -{ - pushd $INSTALL_DIR/lib - find qtcreator/ -maxdepth 1 -name "*.so*" -type f -exec $CHRPATH -r \$ORIGIN {} \; - cd $INSTALL_DIR/lib/qtcreator - find plugins/ -maxdepth 2 -name "*.so" -type f -exec $CHRPATH -r \$ORIGIN/../.. {} \; - - cd $INSTALL_DIR/bin - # all executable files in bin - find -maxdepth 1 -type f -executable -exec $CHRPATH -r \$ORIGIN/../lib/qtcreator {} \; - # all lib of imports and plugins one level underneath bin - find -mindepth 2 -maxdepth 2 -type f -name "*.so" -exec $CHRPATH -r \$ORIGIN/../../lib/qtcreator {} \; - find -mindepth 3 -maxdepth 3 -type f -name "*.so" -exec $CHRPATH -r \$ORIGIN/../../../lib/qtcreator {} \; - find -mindepth 4 -maxdepth 4 -type f -name "*.so" -exec $CHRPATH -r \$ORIGIN/../../../../lib/qtcreator {} \; -} - -function copy_binaries() -{ - cp -a $QT_INSTALL_LIBS/*.so* $INSTALL_DIR/lib/qtcreator - - for plugin in $plugins; do - cp -a $QT_INSTALL_PLUGINS/$plugin $INSTALL_DIR/bin - done - - for import in $imports; do - cp -a $QT_INSTALL_IMPORTS/$import $INSTALL_DIR/bin - done -} - -function copy_translations() -{ - for language in $tr_languages; do - for catalog in $tr_catalogs; do - cp -a $QT_INSTALL_TRANSLATIONS/${catalog}_${language}.qm $INSTALL_DIR/share/qtcreator/translations - done - done -} - -copy_binaries -copy_translations -fix_rpaths - |