From 73e45b0ce2b4132a24708a0359c76927ed418e15 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 7 Feb 2018 19:00:11 -0800 Subject: [PATCH] [qt5-base][qtdeploy] Deploy plugin dependencies to the executable's folder. --- ports/qt5-base/CONTROL | 2 +- ports/qt5-base/qtdeploy.ps1 | 1 + scripts/buildsystems/msbuild/applocal.ps1 | 17 +++++++++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ports/qt5-base/CONTROL b/ports/qt5-base/CONTROL index 1a1aec15db..1e10239b31 100644 --- a/ports/qt5-base/CONTROL +++ b/ports/qt5-base/CONTROL @@ -1,4 +1,4 @@ Source: qt5-base -Version: 5.9.2-4 +Version: 5.9.2-5 Description: Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components. Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre2, harfbuzz, sqlite3, libpq, double-conversion, openssl diff --git a/ports/qt5-base/qtdeploy.ps1 b/ports/qt5-base/qtdeploy.ps1 index b25a46e7a9..26bd102572 100644 --- a/ports/qt5-base/qtdeploy.ps1 +++ b/ports/qt5-base/qtdeploy.ps1 @@ -19,6 +19,7 @@ function deployPluginsIfQt([string]$targetBinaryDir, [string]$QtPluginsDir, [str New-Item "$targetBinaryDir\$pluginSubdirName" -ItemType Directory -ErrorAction SilentlyContinue | Out-Null Get-ChildItem "$QtPluginsDir\$pluginSubdirName\*.dll" | % { deployBinary "$targetBinaryDir\$pluginSubdirName" "$QtPluginsDir\$pluginSubdirName" $_.Name + resolve $_ } } else { Write-Verbose " Skipping plugins directory '$pluginSubdirName': doesn't exist" diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index 0b56356a01..3f0f2ef377 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -24,6 +24,19 @@ function deployBinary([string]$targetBinaryDir, [string]$SourceDir, [string]$tar if ($tlogFile) { Add-Content $tlogFile "$targetBinaryDir\$targetBinaryName" } } + +Write-Verbose "Resolving base path $targetBinary..." +try +{ + $baseBinaryPath = Resolve-Path $targetBinary -erroraction stop + $baseTargetBinaryDir = Split-Path $baseBinaryPath -parent +} +catch [System.Management.Automation.ItemNotFoundException] +{ + return +} + +# Note: this function signature is depended upon by the qtdeploy.ps1 script function resolve([string]$targetBinary) { Write-Verbose "Resolving $targetBinary..." try @@ -47,10 +60,10 @@ function resolve([string]$targetBinary) { } $g_searched.Set_Item($_, $true) if (Test-Path "$installedDir\$_") { - deployBinary $targetBinaryDir $installedDir "$_" + deployBinary $baseTargetBinaryDir $installedDir "$_" if (Test-Path function:\deployPluginsIfQt) { deployPluginsIfQt $targetBinaryDir "$g_install_root\plugins" "$_" } if (Test-Path function:\deployOpenNI2) { deployOpenNI2 $targetBinaryDir "$g_install_root" "$_" } - resolve "$targetBinaryDir\$_" + resolve "$baseTargetBinaryDir\$_" } elseif (Test-Path "$targetBinaryDir\$_") { Write-Verbose " ${_}: $_ not found in vcpkg; locally deployed" resolve "$targetBinaryDir\$_"