mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-05-07 06:59:35 +00:00
fix #396 "move system libs into lib/systemLibs folder"
This commit is contained in:
parent
40f0a9233b
commit
ff1fb00c6a
@ -708,6 +708,10 @@ bool DeployCore::checkSystemBakupSnapInterface() {
|
||||
return QDir(DeployCore::snapRootFS()).entryList(QDir::AllEntries | QDir::NoDotAndDotDot).size();
|
||||
}
|
||||
|
||||
QString DeployCore::systemLibsFolderName() {
|
||||
return "systemLibs";
|
||||
}
|
||||
|
||||
uint qHash(WinAPI i) {
|
||||
return static_cast<uint>(i);
|
||||
}
|
||||
|
@ -251,6 +251,13 @@ public:
|
||||
static QString snapRootFS();
|
||||
static QString transportPathToSnapRoot(const QString &path);
|
||||
static bool checkSystemBakupSnapInterface();
|
||||
|
||||
/**
|
||||
* @brief systemLibsFolderName This method return name of the systems librares.
|
||||
* @return Name of folder with system libraryes.
|
||||
* @note see https://github.com/QuasarApp/CQtDeployer/issues/396
|
||||
*/
|
||||
static QString systemLibsFolderName();
|
||||
};
|
||||
|
||||
|
||||
|
@ -63,13 +63,13 @@ bool Extra::contains(const QString &path) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (auto i: extraPathsMasks) {
|
||||
for (const auto &i: extraPathsMasks) {
|
||||
if (PathUtils::fixPath(info.absoluteFilePath()).contains(i)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto i: extraNamesMasks) {
|
||||
for (const auto &i: extraNamesMasks) {
|
||||
if (PathUtils::fixPath(info.fileName()).contains(i)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -112,7 +112,8 @@ void Extracter::extractExtraDataTargets() {
|
||||
for (auto i = cfg->packages().cbegin(); i != cfg->packages().cend(); ++i) {
|
||||
auto &dep = _packageDependencyes[i.key()];
|
||||
|
||||
for (const auto &target : i.value().extraData()) {
|
||||
const auto extraDataList = i.value().extraData();
|
||||
for (const auto &target : extraDataList) {
|
||||
dep.addExtraData(target);
|
||||
}
|
||||
}
|
||||
@ -137,7 +138,8 @@ void Extracter::copyExtraPlugins(const QString& package) {
|
||||
auto targetPath = cnf->getTargetDir() + "/" + package;
|
||||
auto distro = cnf->getDistroFromPackage(package);
|
||||
|
||||
for (auto extraPlugin : distro.extraPlugins()) {
|
||||
auto extraPlugins = distro.extraPlugins();
|
||||
for (const auto &extraPlugin : extraPlugins) {
|
||||
|
||||
info.setFile(extraPlugin);
|
||||
|
||||
@ -166,7 +168,7 @@ void Extracter::copyExtraPlugins(const QString& package) {
|
||||
QuasarAppUtils::Warning);
|
||||
}
|
||||
|
||||
for (const auto& plugin : plugins) {
|
||||
for (const auto& plugin : qAsConst(plugins)) {
|
||||
extractPluginLib(plugin, package);
|
||||
}
|
||||
}
|
||||
@ -190,7 +192,7 @@ void Extracter::extractPlugins() {
|
||||
_fileManager->copyFiles(plugins, targetPath + distro.getPluginsOutDir(), 1,
|
||||
DeployCore::debugExtensions(), &listItems);
|
||||
|
||||
for (const auto &item : listItems) {
|
||||
for (const auto &item : qAsConst(listItems)) {
|
||||
extractPluginLib(item, i.key());
|
||||
}
|
||||
|
||||
@ -199,13 +201,18 @@ void Extracter::extractPlugins() {
|
||||
|
||||
}
|
||||
|
||||
void Extracter::copyLibs(const QSet<QString> &files, const QString& package) {
|
||||
void Extracter::copyLibs(const QSet<QString> &files, const QString& package, bool system) {
|
||||
auto cnf = DeployCore::_config;
|
||||
auto targetPath = cnf->getTargetDir() + "/" + package;
|
||||
auto distro = cnf->getDistroFromPackage(package);
|
||||
|
||||
auto libOutpath = targetPath + distro.getLibOutDir();
|
||||
if (system) {
|
||||
libOutpath += "/" + DeployCore::systemLibsFolderName();
|
||||
}
|
||||
|
||||
for (const auto &file : files) {
|
||||
if (!_fileManager->smartCopyFile(file, targetPath + distro.getLibOutDir())) {
|
||||
if (!_fileManager->smartCopyFile(file, libOutpath)) {
|
||||
QuasarAppUtils::Params::log(file + " not copied");
|
||||
}
|
||||
}
|
||||
@ -229,10 +236,10 @@ void Extracter::copyFiles() {
|
||||
|
||||
for (auto i = cnf->packages().cbegin(); i != cnf->packages().cend(); ++i) {
|
||||
|
||||
copyLibs(_packageDependencyes[i.key()].neadedLibs(), i.key());
|
||||
copyLibs(_packageDependencyes[i.key()].neadedLibs(), i.key(), false);
|
||||
|
||||
if (QuasarAppUtils::Params::isEndable("deploySystem")) {
|
||||
copyLibs(_packageDependencyes[i.key()].systemLibs(), i.key());
|
||||
copyLibs(_packageDependencyes[i.key()].systemLibs(), i.key(), true);
|
||||
}
|
||||
|
||||
|
||||
@ -399,7 +406,9 @@ bool Extracter::extractQml() {
|
||||
QStringList plugins;
|
||||
QStringList listItems;
|
||||
|
||||
for (const auto &qmlInput: distro.qmlInput()) {
|
||||
const auto qmlImports = distro.qmlInput();
|
||||
|
||||
for (const auto &qmlInput: qmlImports) {
|
||||
QFileInfo info(qmlInput);
|
||||
|
||||
if (!info.isDir()) {
|
||||
@ -431,7 +440,7 @@ bool Extracter::extractQml() {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const auto &item : listItems) {
|
||||
for (const auto &item : qAsConst(listItems)) {
|
||||
extractPluginLib(item, i.key());
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,14 @@ private:
|
||||
|
||||
void copyFiles();
|
||||
void copyTr();
|
||||
void copyLibs(const QSet<QString> &files, const QString &package);
|
||||
|
||||
/**
|
||||
* @brief copyLibs This method copy input libraryes into libOut dir.
|
||||
* @param files This is set of input libs
|
||||
* @param package This is package id of deployement pacakge.
|
||||
* @param system This option set for systems libraryes. If This option will be set to true then libOut dir will be changed to libOut/systemLibs. see https://github.com/QuasarApp/CQtDeployer/issues/396.
|
||||
*/
|
||||
void copyLibs(const QSet<QString> &files, const QString &package, bool system);
|
||||
void copyExtraData(const QSet<QString> &files, const QString &package);
|
||||
|
||||
bool isWebEngine(const QString& package) const;
|
||||
|
@ -37,10 +37,12 @@ bool MetaFileManager::createRunScriptWindows(const QString &target) {
|
||||
script.close();
|
||||
|
||||
} else {
|
||||
auto systemLibsDir = distro.getLibOutDir() + DeployCore::systemLibsFolderName();
|
||||
|
||||
content =
|
||||
"@echo off \n"
|
||||
"SET BASE_DIR=%~dp0\n"
|
||||
"SET PATH=%BASE_DIR%" + distro.getLibOutDir() + ";%PATH%\n"
|
||||
"SET PATH=%BASE_DIR%" + distro.getLibOutDir() + ";%PATH%;" + systemLibsDir + "\n"
|
||||
"%2\n"
|
||||
"call \"%BASE_DIR%" + distro.getBinOutDir() + "%0\" %1 \n";
|
||||
|
||||
@ -91,11 +93,14 @@ bool MetaFileManager::createRunScriptLinux(const QString &target) {
|
||||
script.close();
|
||||
|
||||
} else {
|
||||
|
||||
auto systemLibsDir = distro.getLibOutDir() + DeployCore::systemLibsFolderName();
|
||||
|
||||
content =
|
||||
"#!/bin/sh\n"
|
||||
"BASE_DIR=$(dirname \"$(readlink -f \"$0\")\")\n"
|
||||
"export "
|
||||
"LD_LIBRARY_PATH=\"$BASE_DIR\"" + distro.getLibOutDir() + ":\"$BASE_DIR\":$LD_LIBRARY_PATH\n"
|
||||
"LD_LIBRARY_PATH=\"$BASE_DIR\"" + distro.getLibOutDir() + ":\"$BASE_DIR\":$LD_LIBRARY_PATH:" + systemLibsDir + "\n"
|
||||
"export QML_IMPORT_PATH=\"$BASE_DIR\"" + distro.getQmlOutDir() + ":$QML_IMPORT_PATH\n"
|
||||
"export QML2_IMPORT_PATH=\"$BASE_DIR\"" + distro.getQmlOutDir() + ":$QML2_IMPORT_PATH\n"
|
||||
"export QT_PLUGIN_PATH=\"$BASE_DIR\"" + distro.getPluginsOutDir() + ":$QT_PLUGIN_PATH\n"
|
||||
|
@ -46,7 +46,7 @@ bool Packing::create() {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto package : _pakages) {
|
||||
for (auto package : qAsConst(_pakages)) {
|
||||
|
||||
if (!package)
|
||||
return false;
|
||||
@ -90,7 +90,6 @@ bool Packing::create() {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto exit = QString("exit code = %0").arg(_proc->exitCode());
|
||||
QString stdoutLog = _proc->readAllStandardOutput();
|
||||
QString erroutLog = _proc->readAllStandardError();
|
||||
auto message = QString("message = %0").arg(stdoutLog + " " + erroutLog);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
BASE_DIR=$(dirname "$(readlink -f "$0")")
|
||||
export LD_LIBRARY_PATH="$BASE_DIR"/lib/:"$BASE_DIR":$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH="$BASE_DIR"/lib/:"$BASE_DIR":$LD_LIBRARY_PATH:/lib/systemLibs
|
||||
export QML_IMPORT_PATH="$BASE_DIR"/q/and/q/:$QML_IMPORT_PATH
|
||||
export QML2_IMPORT_PATH="$BASE_DIR"/q/and/q/:$QML2_IMPORT_PATH
|
||||
export QT_PLUGIN_PATH="$BASE_DIR"/plugins/:$QT_PLUGIN_PATH
|
||||
|
@ -2387,8 +2387,8 @@ void deploytest::testSystemLib() {
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.sh",
|
||||
"./" + DISTRO_DIR + "/bin/qt.conf",
|
||||
"./" + DISTRO_DIR + "/bin/TestOnlyC",
|
||||
"./" + DISTRO_DIR + "/lib/libgcc_s.so",
|
||||
"./" + DISTRO_DIR + "/lib/libstdc++.so"
|
||||
"./" + DISTRO_DIR + "/lib/systemLibs/libgcc_s.so",
|
||||
"./" + DISTRO_DIR + "/lib/systemLibs/libstdc++.so"
|
||||
});
|
||||
|
||||
#else
|
||||
@ -2397,10 +2397,10 @@ void deploytest::testSystemLib() {
|
||||
{
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.exe",
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.bat",
|
||||
"./" + DISTRO_DIR + "/libgcc_s_seh-1.dll",
|
||||
"./" + DISTRO_DIR + "/libstdc++-6.dll",
|
||||
"./" + DISTRO_DIR + "/libwinpthread-1.dll",
|
||||
"./" + DISTRO_DIR + "/msvcrt.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/libgcc_s_seh-1.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/libstdc++-6.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/libwinpthread-1.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/msvcrt.dll",
|
||||
"./" + DISTRO_DIR + "/qt.conf"
|
||||
});
|
||||
|
||||
@ -2426,12 +2426,12 @@ void deploytest::testSystemLib() {
|
||||
"./" + DISTRO_DIR + "/TestOnlyC.sh",
|
||||
"./" + DISTRO_DIR + "/bin/qt.conf",
|
||||
"./" + DISTRO_DIR + "/bin/TestOnlyC",
|
||||
"./" + DISTRO_DIR + "/lib/libgcc_s.so",
|
||||
"./" + DISTRO_DIR + "/lib/ld-linux-x86-64.so",
|
||||
"./" + DISTRO_DIR + "/lib/libc.so",
|
||||
"./" + DISTRO_DIR + "/lib/libm.so",
|
||||
"./" + DISTRO_DIR + "/lib/systemLibs/libgcc_s.so",
|
||||
"./" + DISTRO_DIR + "/lib/systemLibs/ld-linux-x86-64.so",
|
||||
"./" + DISTRO_DIR + "/lib/systemLibs/libc.so",
|
||||
"./" + DISTRO_DIR + "/lib/systemLibs/libm.so",
|
||||
|
||||
"./" + DISTRO_DIR + "/lib/libstdc++.so"
|
||||
"./" + DISTRO_DIR + "/lib/systemLibs/libstdc++.so"
|
||||
});
|
||||
|
||||
runTestParams({"-bin", bin, "clear" ,
|
||||
@ -2462,24 +2462,24 @@ void deploytest::testSystemLib() {
|
||||
|
||||
comapareTree += utils.createTree(
|
||||
{
|
||||
"./" + DISTRO_DIR + "/libgcc_s_seh-1.dll",
|
||||
"./" + DISTRO_DIR + "/libstdc++-6.dll",
|
||||
"./" + DISTRO_DIR + "/libwinpthread-1.dll",
|
||||
"./" + DISTRO_DIR + "/msvcrt.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/libgcc_s_seh-1.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/libstdc++-6.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/libwinpthread-1.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/msvcrt.dll",
|
||||
"./" + DISTRO_DIR + "/qt.conf",
|
||||
"./" + DISTRO_DIR + "/mpr.dll",
|
||||
"./" + DISTRO_DIR + "/profapi.dll",
|
||||
"./" + DISTRO_DIR + "/rpcrt4.dll",
|
||||
"./" + DISTRO_DIR + "/shell32.dll",
|
||||
"./" + DISTRO_DIR + "/userenv.dll",
|
||||
"./" + DISTRO_DIR + "/uxtheme.dll",
|
||||
"./" + DISTRO_DIR + "/version.dll",
|
||||
"./" + DISTRO_DIR + "/ucrtbase.dll",
|
||||
"./" + DISTRO_DIR + "/oleaut32.dll",
|
||||
"./" + DISTRO_DIR + "/bcryptprimitives.dll",
|
||||
"./" + DISTRO_DIR + "/msvcp_win.dll",
|
||||
"./" + DISTRO_DIR + "/wtsapi32.dll",
|
||||
"./" + DISTRO_DIR + "/combase.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/mpr.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/profapi.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/rpcrt4.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/shell32.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/userenv.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/uxtheme.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/version.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/ucrtbase.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/oleaut32.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/bcryptprimitives.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/msvcp_win.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/wtsapi32.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/combase.dll",
|
||||
|
||||
});
|
||||
|
||||
@ -2487,9 +2487,9 @@ void deploytest::testSystemLib() {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
comapareTree += utils.createTree(
|
||||
{
|
||||
"./" + DISTRO_DIR + "/d3d11.dll",
|
||||
"./" + DISTRO_DIR + "/dxgi.dll",
|
||||
"./" + DISTRO_DIR + "/win32u.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/d3d11.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/dxgi.dll",
|
||||
"./" + DISTRO_DIR + "/systemLibs/win32u.dll",
|
||||
});
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user