Skip to content

Commit

Permalink
Merge pull request #794 from QuasarApp/update_quasarapp_lib
Browse files Browse the repository at this point in the history
Update quasarapp lib
  • Loading branch information
EndrII authored Feb 5, 2024
2 parents 1e49c03 + f199926 commit 002aa6b
Show file tree
Hide file tree
Showing 231 changed files with 451 additions and 338 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2020-2023 QuasarApp.
# Copyright (C) 2020-2024 QuasarApp.
# Distributed under the GPLv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion md/en/CustomScripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ CQT_RUN_COMMAND
```


Or you can get last version of this scripts from the github [repository](https://github.com/QuasarApp/CQtDeployer/tree/main/Deploy/ScriptsTemplates).
Or you can get last version of this scripts from the github [repository](https://github.com/QuasarApp/CQtDeployer/tree/main/src/Deploy/src/ScriptsTemplates).
2 changes: 1 addition & 1 deletion md/ru/CustomScripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ CQT_RUN_COMMAND
```


Или вы можете получить последнюю версию этих скриптов из github [репозитория](https://github.com/QuasarApp/CQtDeployer/tree/main/Deploy/ScriptsTemplates).
Или вы можете получить последнюю версию этих скриптов из github [репозитория](https://github.com/QuasarApp/CQtDeployer/tree/main/src/Deploy/src/ScriptsTemplates).
2 changes: 1 addition & 1 deletion md/ru/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ cqtdeployer -option1 value1 -option2 list,of,values flag1 flag2 flag3
|-----------------------------|-----------------------------------------------------------|
| -bin [list,params] | Развертываемый файл или папка. пример -bin ~/my/project/bin/,~/my/project/bin.exe. Для файлов: эти файлы будут безоговорочно скопированы в целевой каталог, независимо от их формата или суффикса. Для папок: CQtDeployer войдет в эти папки и нерекурсивно скопирует все развертываемые файлы в целевой каталог. Затем CQtDeployer извлечет все зависимости скопированных файлов. CQtDeployer будет искать зависимости в системной среде и в путях libDir. **Примечание**. Если CQtDeployer не может найти требуемый файл, CQtDeployer попытается найти требуемый файл в системной среде PATH. |
| -binPrefix [prefixPath] | Устанавливает путь префикса для опции bin. Пример: **-bin path/MyExecutable** - это тоже что и **-bin MyExecutable -binPrefix path** |
| -confFile [params] | Путь к файлу json со всеми конфигурациями развертывания. С помощью этого файла можно добавить нужные опции, тем самым упрастить вызов комманды в консоле. Однако пораметры в кансоле имеют больший приоритет чем в файле. Для получения дополнительной информации об этом флаге см. [Вики](DeployConfigFile) |
| -confFile [params] | Путь к файлу json со всеми конфигурациями развертывания. С помощью этого файла можно добавить нужные опции, тем самым упрастить вызов комманды в консоли. Однако пораметры в консоли имеют больший приоритет чем в файле. Для получения дополнительной информации об этом флаге см. [Вики](DeployConfigFile) |
| -qmlDir [params] | Папка qml. пример -qmlDir ~/my/project/qml |
| -qmake [params] | Путь к qmake. пример |
| | -qmake ~/Qt/5.14.0/gcc_64/bin/qmake |
Expand Down
4 changes: 2 additions & 2 deletions src/CQtDeployer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2021-2023 QuasarApp.
# Copyright (C) 2021-2024 QuasarApp.
# Distributed under the GPLv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
Expand Down Expand Up @@ -122,5 +122,5 @@ if (UNIX)
add_dependencies(snapcraft${CURRENT_PROJECT} "deploy${CURRENT_PROJECT}Single")
endif()

addReleaseSnap(${CURRENT_PROJECT})
addReleaseSnap(${CURRENT_PROJECT} latest/edge)
endif()
2 changes: 1 addition & 1 deletion src/CQtDeployer/Deploy/snapcraft.yaml.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2018-2023 QuasarApp.
# Copyright (C) 2018-2024 QuasarApp.
# Distributed under the lgplv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion src/CQtDeployer/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 QuasarApp.
* Copyright (C) 2018-2024 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2020-2023 QuasarApp.
# Copyright (C) 2020-2024 QuasarApp.
# Distributed under the GPLv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
Expand Down
4 changes: 2 additions & 2 deletions src/Deploy/src/Distributions/deb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ QProcessEnvironment Deb::processEnvirement() const {

QList<SystemCommandData> Deb::runCmd() {
QList<SystemCommandData> res;
for (const auto& inout: qAsConst(inouts)) {
for (const auto& inout: std::as_const(inouts)) {
res.push_back({"dpkg-deb", QStringList{"--build", "--verbose"} << inout.input << inout.output});
}

Expand All @@ -125,7 +125,7 @@ QList<SystemCommandData> Deb::runCmd() {

QStringList Deb::outPutFiles() const {
QStringList result;
for (const auto& inout: qAsConst(inouts)) {
for (const auto& inout: std::as_const(inouts)) {
result.push_back(inout.output);
}
return result;
Expand Down
42 changes: 23 additions & 19 deletions src/Deploy/src/configparser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2023 QuasarApp.
//# Copyright (C) 2018-2024 QuasarApp.
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
Expand All @@ -23,6 +23,7 @@
#include <Distributions/defaultdistro.h>
#include <Distributions/qif.h>
#include <Distributions/ziparhive.h>
#include <qaplatformutils.h>


/**
Expand Down Expand Up @@ -740,7 +741,7 @@ bool ConfigParser::parseDeployMode(bool checkBin) {

if (!initQmake()) {

if (DeployCore::isSnap()) {
if (QuasarAppUtils::PlatformUtils::isSnap()) {
QuasarAppUtils::Params::log("If you are using qmake from the system repository,"
" then you must use the classic version of CQtDeployer instead of the snap version."
" This is due to the fact that the snap version"
Expand Down Expand Up @@ -966,7 +967,7 @@ bool ConfigParser::setTargetsInDir(const QString &dir, bool recursive) {
}

bool result = false;
for (const auto &file : qAsConst(list)) {
for (const auto &file : std::as_const(list)) {

if (file.isDir()) {
result |= setTargetsInDir(file.absoluteFilePath(), recursive);
Expand Down Expand Up @@ -1024,9 +1025,11 @@ void ConfigParser::initIgnoreList()
envUnix.addEnv(Envirement::recursiveInvairement("/lib", 3));
envUnix.addEnv(Envirement::recursiveInvairement("/usr/lib", 3));

if (DeployCore::isSnap()) {
envUnix.addEnv(Envirement::recursiveInvairement(DeployCore::transportPathToSnapRoot("/lib"), 3));
envUnix.addEnv(Envirement::recursiveInvairement(DeployCore::transportPathToSnapRoot("/usr/lib"), 3));
if (QuasarAppUtils::PlatformUtils::isSnap()) {
envUnix.addEnv(Envirement::recursiveInvairement(
QuasarAppUtils::PlatformUtils::transportPathToSnapRoot("/lib"), 3));
envUnix.addEnv(Envirement::recursiveInvairement(
QuasarAppUtils::PlatformUtils::transportPathToSnapRoot("/usr/lib"), 3));
}

ruleUnix.prority = SystemLib;
Expand Down Expand Up @@ -1113,7 +1116,7 @@ void ConfigParser::initIgnoreEnvList() {
}

// forbid pathes of the snap container
if (DeployCore::isSnap()) {
if (QuasarAppUtils::PlatformUtils::isSnap()) {
ignoreEnvList.push_back("/lib");
ignoreEnvList.push_back("/usr/lib");
}
Expand All @@ -1134,7 +1137,7 @@ QString ConfigParser::getPathFrmoQmakeLine(const QString &in) const {
auto list = in.split(':');
if (list.size() > 1) {
list.removeAt(0);
return DeployCore::transportPathToSnapRoot(
return QuasarAppUtils::PlatformUtils::transportPathToSnapRoot(
QFileInfo(list.join(':')).absoluteFilePath().remove('\r'));
}

Expand All @@ -1151,7 +1154,7 @@ bool ConfigParser::initQmakePrivate(const QString &qmake) {

// Invoke qmake executable only when qmake paths exclude snapRootFS path.
// Because files in snapRootFS is not executable ...
if (!qmake.contains(DeployCore::snapRootFS()) && setQmake(qmake)) {
if (!qmake.contains(QuasarAppUtils::PlatformUtils::snapRootFS()) && setQmake(qmake)) {
return true;
}

Expand All @@ -1167,8 +1170,8 @@ bool ConfigParser::initQmakePrivate(const QString &qmake) {
QString debianQtRoot = QString("/usr/lib/%0/qt%1").
arg(neededPlatform).arg(qtVersion);

if (DeployCore::isSnap()) {
debianQtRoot = DeployCore::snapRootFS() + debianQtRoot;
if (QuasarAppUtils::PlatformUtils::isSnap()) {
debianQtRoot = QuasarAppUtils::PlatformUtils::snapRootFS() + debianQtRoot;
}

if (!setQtDir(debianQtRoot)) {
Expand All @@ -1189,7 +1192,7 @@ bool ConfigParser::initQmakePrivate(const QString &qmake) {
}

// For snap package of cqtdeplyer it is normal behavior
if (!DeployCore::isSnap()) {
if (!QuasarAppUtils::PlatformUtils::isSnap()) {
QuasarAppUtils::Params::log("Failed to execute the qmake process!"
" Trying to initialize Qt directories from path: " + dir.absolutePath(),
QuasarAppUtils::Warning);
Expand All @@ -1214,7 +1217,8 @@ bool ConfigParser::initQmake() {
return true;
}

auto qmake = DeployCore::transportPathToSnapRoot(QuasarAppUtils::Params::getArg("qmake"));
auto qmake = QuasarAppUtils::PlatformUtils::transportPathToSnapRoot(
QuasarAppUtils::Params::getArg("qmake"));

QFileInfo info(qmake);

Expand Down Expand Up @@ -1409,7 +1413,7 @@ bool ConfigParser::initExtraPath() {
QDir dir;

for (const auto &i : listLibDir) {
QFileInfo info(DeployCore::transportPathToSnapRoot(i));
QFileInfo info(QuasarAppUtils::PlatformUtils::transportPathToSnapRoot(i));
if (info.isDir()) {
if (_config.targets().contains(info.absoluteFilePath())) {
QuasarAppUtils::Params::log("Skip the extra library path because it is target!",
Expand Down Expand Up @@ -1563,7 +1567,7 @@ void ConfigParser::initEnvirement() {
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
auto path = env.value("PATH");

if (!DeployCore::isSnap()) {
if (!QuasarAppUtils::PlatformUtils::isSnap()) {

_config.envirement.addEnv(env.value("LD_LIBRARY_PATH"));
_config.envirement.addEnv(path);
Expand All @@ -1572,8 +1576,8 @@ void ConfigParser::initEnvirement() {
QStringList dirs;
#ifdef Q_OS_LINUX

dirs.append(getDirsRecursive(DeployCore::transportPathToSnapRoot("/lib"), 5));
dirs.append(getDirsRecursive(DeployCore::transportPathToSnapRoot("/usr/lib"), 5));
dirs.append(getDirsRecursive(QuasarAppUtils::PlatformUtils::transportPathToSnapRoot("/lib"), 5));
dirs.append(getDirsRecursive(QuasarAppUtils::PlatformUtils::transportPathToSnapRoot("/usr/lib"), 5));

#else
auto winPath = findWindowsPath(path);
Expand All @@ -1592,14 +1596,14 @@ void ConfigParser::initEnvirement() {

bool ConfigParser::checkSnapPermisions() {

if (!DeployCore::isSnap())
if (!QuasarAppUtils::PlatformUtils::isSnap())
return true;


bool system = QuasarAppUtils::Params::isEndable("deploySystem") ||
QuasarAppUtils::Params::isEndable("extraLibs");

if (system && !DeployCore::checkSystemBakupSnapInterface()) {
if (system && !QuasarAppUtils::PlatformUtils::checkSystemBakupSnapInterface()) {

QuasarAppUtils::Params::log("You use a deploySystem or extraLibs options,"
" but not added permision system-backup for cqtdeployer."
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/configparser.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2023 QuasarApp.
//# Copyright (C) 2018-2024 QuasarApp.
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/defines.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 QuasarApp.
* Copyright (C) 2018-2024 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
Expand Down
4 changes: 2 additions & 2 deletions src/Deploy/src/dependenciesscanner.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 QuasarApp.
* Copyright (C) 2018-2024 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
Expand Down Expand Up @@ -125,7 +125,7 @@ void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res, QSet<QS

libStack.insert(lib.fullPath());

for (const auto &i : qAsConst(lib._dependncies)) {
for (const auto &i : std::as_const(lib._dependncies)) {

auto libs = getLibsFromEnvirement(i);

Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/dependenciesscanner.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 QuasarApp.
* Copyright (C) 2018-2024 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/dependencymap.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2023 QuasarApp.
//# Copyright (C) 2018-2024 QuasarApp.
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/dependencymap.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//#
//# Copyright (C) 2018-2023 QuasarApp.
//# Copyright (C) 2018-2024 QuasarApp.
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/deploy.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 QuasarApp.
* Copyright (C) 2018-2024 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/deploy.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 QuasarApp.
* Copyright (C) 2018-2024 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/deploy_global.h.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 QuasarApp.
* Copyright (C) 2018-2024 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/deployconfig.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 QuasarApp.
* Copyright (C) 2018-2024 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
Expand Down
2 changes: 1 addition & 1 deletion src/Deploy/src/deployconfig.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 QuasarApp.
* Copyright (C) 2018-2024 QuasarApp.
* Distributed under the lgplv3 software license, see the accompanying
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
Expand Down
Loading

0 comments on commit 002aa6b

Please sign in to comment.