From 43e93009a3fa3126cdf5c73be32d935d30a6cdd2 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 23 Jun 2015 13:29:31 +0200 Subject: [PATCH] Linux: Fix deployment of libclang We need the versioned name of the library now, so copy all libclang.so* while keeping symlinks as symlinks. Change-Id: Ia2cc5e82be0848a3c9b0cb3055e150e6b1a151c9 Reviewed-by: Christian Stenger --- scripts/deployqt.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/scripts/deployqt.py b/scripts/deployqt.py index da122efc34f..f7bf539f2f1 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -216,20 +216,31 @@ def copy_translations(install_dir, qt_tr_dir): print translation, '->', tr_dir shutil.copy(translation, tr_dir) +def copyPreservingLinks(source, destination): + if os.path.islink(source): + linkto = os.readlink(source) + destFilePath = destination + if os.path.isdir(destination): + destFilePath = os.path.join(destination, os.path.basename(source)) + os.symlink(linkto, destFilePath) + else: + shutil.copy(source, destination) + def copy_libclang(install_dir, llvm_install_dir): - libsource = "" + libsources = [] libtarget = "" if sys.platform.startswith("win"): - libsource = os.path.join(llvm_install_dir, 'bin', 'libclang.dll') + libsources = [os.path.join(llvm_install_dir, 'bin', 'libclang.dll')] libtarget = os.path.join(install_dir, 'bin') else: - libsource = os.path.join(llvm_install_dir, 'lib', 'libclang.so') + libsources = glob(os.path.join(llvm_install_dir, 'lib', 'libclang.so*')) libtarget = os.path.join(install_dir, 'lib', 'qtcreator') resourcesource = os.path.join(llvm_install_dir, 'lib', 'clang') resourcetarget = os.path.join(install_dir, 'share', 'qtcreator', 'cplusplus', 'clang') print "copying libclang..." - print libsource, '->', libtarget - shutil.copy(libsource, libtarget) + for libsource in libsources: + print libsource, '->', libtarget + copyPreservingLinks(libsource, libtarget) print resourcesource, '->', resourcetarget if (os.path.exists(resourcetarget)): shutil.rmtree(resourcetarget)