From 55be2a85eebf9e202e7499f4e3e4c880db08b77d Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 26 Jun 2024 00:44:39 +0300 Subject: [PATCH 1/9] first komit for karchive migration Signed-off-by: Trial97 --- CMakeLists.txt | 2 + launcher/CMakeLists.txt | 1 + launcher/LaunchController.cpp | 2 +- launcher/MMCZip.h | 161 ++++++++++++++++++ .../java/download/ArchiveDownloadTask.cpp | 93 ++++------ 5 files changed, 198 insertions(+), 61 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cec384b33d..a86a18f238 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,6 +351,8 @@ if(NOT Launcher_FORCE_BUNDLED_LIBS) # Find cmark find_package(cmark QUIET) + + find_package(KF6Archive) endif() include(ECMQtDeclareLoggingCategory) diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 486aaff3ee..6cbf17c1a8 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -1281,6 +1281,7 @@ target_link_libraries(Launcher_logic BuildConfig Qt${QT_VERSION_MAJOR}::Widgets ghcFilesystem::ghc_filesystem + KF6::Archive ) if (UNIX AND NOT CYGWIN AND NOT APPLE) diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index 0aded4a95c..cc594ccf12 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -199,7 +199,7 @@ void LaunchController::login() if ((m_accountToUse->accountType() != AccountType::Offline && m_accountToUse->accountState() == AccountState::Offline) || m_accountToUse->shouldRefresh()) { // Force account refresh on the account used to launch the instance updating the AccountState - // only on first try and if it is not meant to be offline + // only on first try and if it is not meant to be offline auto accounts = APPLICATION->accounts(); accounts->requestRefresh(m_accountToUse->internalId()); } diff --git a/launcher/MMCZip.h b/launcher/MMCZip.h index d81df9d818..c68da231dd 100644 --- a/launcher/MMCZip.h +++ b/launcher/MMCZip.h @@ -54,6 +54,11 @@ #endif #include "tasks/Task.h" +#include +#include +#include +#include +#include namespace MMCZip { using FilterFunction = std::function; @@ -235,5 +240,161 @@ class ExtractZipTask : public Task { QFuture m_zip_future; QFutureWatcher m_zip_watcher; }; + +class ExtractKArchive : public Task { + public: + ExtractKArchive(QString fileName, QDir outputDir, QString subdirectory = "") + : ExtractKArchive(newArchive(fileName), outputDir, subdirectory) + {} + ExtractKArchive(KArchive* a, QDir outputDir, QString subdirectory = "") + : m_archive(a), m_output_dir(outputDir), m_subdirectory(subdirectory) + { + setAbortable(true); + } + ~ExtractKArchive() + { + if (m_archive) { + if (m_archive->isOpen()) { + m_archive->close(); + } + delete m_archive; + } + } + + static KArchive* newArchive(QString filename) + { + if (filename.endsWith(".zip") || filename.endsWith(".jar")) { + return new KZip(filename); + } + return new KTar(filename); + } + + protected: + static bool sortByPosition(const KArchiveFile* file1, const KArchiveFile* file2) { return file1->position() < file2->position(); } + virtual void executeTask() override + { + m_needs_abort = false; +#define CAN_CONTINUE \ + if (m_needs_abort) { \ + emitAborted(); \ + return; \ + } + if (!m_archive->isOpen()) { + if (!m_archive->open(QIODevice::ReadOnly)) { + emitFailed(tr("unable to open file")); + return; + } + } + CAN_CONTINUE; + setStatus(tr("collect files")); + QDir root; + const QString destDir(m_output_dir.absolutePath()); // get directory path without any "." or ".." + + QList fileList; + QMap fileToDir; + + // placeholders for iterated items + QStack dirStack; + QStack dirNameStack; + + auto kdir = m_archive->directory(); + if (!m_subdirectory.isEmpty()) { + auto subDir = kdir->entry(m_subdirectory); + kdir = nullptr; + if (subDir && subDir->isDirectory()) { + kdir = dynamic_cast(subDir); + } + if (!kdir) { + emitFailed(tr("unable to find subdirecotry")); + return; + } + } + CAN_CONTINUE; + + dirStack.push(kdir); // init stack at current directory + dirNameStack.push(destDir); // ... with given path + do { + CAN_CONTINUE; + const KArchiveDirectory* curDir = dirStack.pop(); + + // extract only to specified folder if it is located within archive's extraction folder + // otherwise put file under root position in extraction folder + QString curDirName = dirNameStack.pop(); + if (!QDir(curDirName).absolutePath().startsWith(destDir)) { + qWarning() << "Attempted export into folder" << curDirName << "which is outside of the extraction root folder" << destDir + << "." + << "Changing export of contained files to extraction root folder."; + curDirName = destDir; + } + + if (!root.mkpath(curDirName)) { + emitFailed(tr("unable to create directory:%1").arg(curDirName)); + return; + } + + const QStringList dirEntries = curDir->entries(); + for (QStringList::const_iterator it = dirEntries.begin(); it != dirEntries.end(); ++it) { + CAN_CONTINUE; + const KArchiveEntry* curEntry = curDir->entry(*it); + if (!curEntry->symLinkTarget().isEmpty()) { + QString linkName = curDirName + QLatin1Char('/') + curEntry->name(); + // To create a valid link on Windows, linkName must have a .lnk file extension. +#ifdef Q_OS_WIN + if (!linkName.endsWith(QLatin1String(".lnk"))) { + linkName += QLatin1String(".lnk"); + } +#endif + QFile symLinkTarget(curEntry->symLinkTarget()); + if (!symLinkTarget.link(linkName)) { + qWarning() << "symlink(" << curEntry->symLinkTarget() << ',' << linkName << ") failed"; + } + } else { + if (curEntry->isFile()) { + const KArchiveFile* curFile = dynamic_cast(curEntry); + if (curFile) { + fileList.append(curFile); + fileToDir.insert(curFile->position(), curDirName); + } + } + + if (curEntry->isDirectory()) { + const KArchiveDirectory* ad = dynamic_cast(curEntry); + if (ad) { + dirStack.push(ad); + dirNameStack.push(curDirName + QLatin1Char('/') + curEntry->name()); + } + } + } + } + } while (!dirStack.isEmpty()); + + std::sort(fileList.begin(), fileList.end(), sortByPosition); // sort on d->pos, so we have a linear access + setStatus(tr("extract files")); + + setProgress(0, fileList.size()); + for (auto f : fileList) { + CAN_CONTINUE; + setProgress(m_progress + 1, m_progressTotal); + qint64 pos = f->position(); + if (!f->copyTo(fileToDir[pos])) { + emitFailed(tr("failed to create file:%1").arg(fileToDir[pos])); + return; + } + } + emitSucceeded(); + }; + bool abort() override + { + m_needs_abort = true; + return true; + } + + private: + KArchive* m_archive; + QDir m_output_dir; + QString m_subdirectory; + + bool m_needs_abort = false; +}; #endif } // namespace MMCZip diff --git a/launcher/java/download/ArchiveDownloadTask.cpp b/launcher/java/download/ArchiveDownloadTask.cpp index bb7cc568d9..4d9710685b 100644 --- a/launcher/java/download/ArchiveDownloadTask.cpp +++ b/launcher/java/download/ArchiveDownloadTask.cpp @@ -16,12 +16,10 @@ * along with this program. If not, see . */ #include "java/download/ArchiveDownloadTask.h" -#include #include #include "MMCZip.h" #include "Application.h" -#include "Untar.h" #include "net/ChecksumValidator.h" #include "net/NetJob.h" #include "tasks/Task.h" @@ -65,69 +63,44 @@ void ArchiveDownloadTask::executeTask() void ArchiveDownloadTask::extractJava(QString input) { - setStatus(tr("Extracting Java")); - if (input.endsWith("tar")) { - setStatus(tr("Extracting Java (Progress is not reported for tar archives)")); - QFile in(input); - if (!in.open(QFile::ReadOnly)) { - emitFailed(tr("Unable to open supplied tar file.")); - return; - } - if (!Tar::extract(&in, QDir(m_final_path).absolutePath())) { - emitFailed(tr("Unable to extract supplied tar file.")); - return; - } - emitSucceeded(); + setStatus(tr("Extracting java")); + + auto archive = MMCZip::ExtractKArchive::newArchive(input); + if (!archive->open(QIODevice::ReadOnly)) { + emitFailed(tr("Unable to open supplied archive file.")); return; - } else if (input.endsWith("tar.gz") || input.endsWith("taz") || input.endsWith("tgz")) { - setStatus(tr("Extracting Java (Progress is not reported for tar archives)")); - if (!GZTar::extract(input, QDir(m_final_path).absolutePath())) { - emitFailed(tr("Unable to extract supplied tar file.")); - return; - } - emitSucceeded(); + } + auto files = archive->directory()->entries(); + if (files.isEmpty()) { + emitFailed(tr("No files were found in the supplied zip file,")); return; - } else if (input.endsWith("zip")) { - auto zip = std::make_shared(input); - if (!zip->open(QuaZip::mdUnzip)) { - emitFailed(tr("Unable to open supplied zip file.")); - return; - } - auto files = zip->getFileNameList(); - if (files.isEmpty()) { - emitFailed(tr("No files were found in the supplied zip file.")); - return; - } - m_task = makeShared(zip, m_final_path, files[0]); - - auto progressStep = std::make_shared(); - connect(m_task.get(), &Task::finished, this, [this, progressStep] { - progressStep->state = TaskStepState::Succeeded; - stepProgress(*progressStep); - }); + } + m_task = makeShared(archive, m_final_path, files[0]); - connect(m_task.get(), &Task::succeeded, this, &ArchiveDownloadTask::emitSucceeded); - connect(m_task.get(), &Task::aborted, this, &ArchiveDownloadTask::emitAborted); - connect(m_task.get(), &Task::failed, this, [this, progressStep](QString reason) { - progressStep->state = TaskStepState::Failed; - stepProgress(*progressStep); - emitFailed(reason); - }); - connect(m_task.get(), &Task::stepProgress, this, &ArchiveDownloadTask::propagateStepProgress); + auto progressStep = std::make_shared(); + connect(m_task.get(), &Task::finished, this, [this, progressStep] { + progressStep->state = TaskStepState::Succeeded; + stepProgress(*progressStep); + }); - connect(m_task.get(), &Task::progress, this, [this, progressStep](qint64 current, qint64 total) { - progressStep->update(current, total); - stepProgress(*progressStep); - }); - connect(m_task.get(), &Task::status, this, [this, progressStep](QString status) { - progressStep->status = status; - stepProgress(*progressStep); - }); - m_task->start(); - return; - } + connect(m_task.get(), &Task::succeeded, this, &ArchiveDownloadTask::emitSucceeded); + connect(m_task.get(), &Task::aborted, this, &ArchiveDownloadTask::emitAborted); + connect(m_task.get(), &Task::failed, this, [this, progressStep](QString reason) { + progressStep->state = TaskStepState::Failed; + stepProgress(*progressStep); + emitFailed(reason); + }); + connect(m_task.get(), &Task::stepProgress, this, &ArchiveDownloadTask::propagateStepProgress); - emitFailed(tr("Could not determine archive type!")); + connect(m_task.get(), &Task::progress, this, [this, progressStep](qint64 current, qint64 total) { + progressStep->update(current, total); + stepProgress(*progressStep); + }); + connect(m_task.get(), &Task::status, this, [this, progressStep](QString status) { + progressStep->status = status; + stepProgress(*progressStep); + }); + m_task->start(); } bool ArchiveDownloadTask::abort() From 5b1c10d85aae99b0b266b2f66b46b6e565e053ca Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 26 Jun 2024 11:37:05 +0300 Subject: [PATCH 2/9] Add bundled karchive Signed-off-by: Trial97 --- .gitmodules | 3 +++ CMakeLists.txt | 7 +++++++ libraries/karchive | 1 + 3 files changed, 11 insertions(+) create mode 160000 libraries/karchive diff --git a/.gitmodules b/.gitmodules index 0f437d2778..c097967464 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,3 +22,6 @@ [submodule "flatpak/shared-modules"] path = flatpak/shared-modules url = https://github.com/flathub/shared-modules.git +[submodule "libraries/karchive"] + path = libraries/karchive + url = https://invent.kde.org/frameworks/karchive.git diff --git a/CMakeLists.txt b/CMakeLists.txt index a86a18f238..136c7c86f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -553,6 +553,13 @@ else() endif() add_subdirectory(libraries/qdcss) # css parser +if(NOT KF6Archive_FOUND) + message(STATUS "Using bundled karchive") + add_subdirectory(libraries/karchive) +else() + message(STATUS "Using system karchive") +endif() + ############################### Built Artifacts ############################### add_subdirectory(buildconfig) diff --git a/libraries/karchive b/libraries/karchive new file mode 160000 index 0000000000..952e1ead92 --- /dev/null +++ b/libraries/karchive @@ -0,0 +1 @@ +Subproject commit 952e1ead926dcc686d9a05d9769bd03f0fae705d From b3aceb9ad09b9d2bdaefa2beb9388034c6cf16d0 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 26 Jun 2024 11:52:38 +0300 Subject: [PATCH 3/9] get karchive from apt Signed-off-by: Trial97 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2cefa81006..3291a1e7ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -206,7 +206,7 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get -y update - sudo apt-get -y install ninja-build extra-cmake-modules scdoc appstream libxcb-cursor-dev + sudo apt-get -y install ninja-build extra-cmake-modules scdoc appstream libxcb-cursor-dev libkf6archive-dev - name: Install Dependencies (macOS) if: runner.os == 'macOS' From e99ae8b1f07b5a841caba2c79d71f0ab89e44eb5 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 26 Jun 2024 12:14:36 +0300 Subject: [PATCH 4/9] do you even work this way? --- .github/workflows/build.yml | 2 +- CMakeLists.txt | 21 ++++++++++++++++++++- libraries/extra-cmake-modules | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3291a1e7ba..2cefa81006 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -206,7 +206,7 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get -y update - sudo apt-get -y install ninja-build extra-cmake-modules scdoc appstream libxcb-cursor-dev libkf6archive-dev + sudo apt-get -y install ninja-build extra-cmake-modules scdoc appstream libxcb-cursor-dev - name: Install Dependencies (macOS) if: runner.os == 'macOS' diff --git a/CMakeLists.txt b/CMakeLists.txt index 136c7c86f8..9a804b08e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,6 +152,10 @@ option(BUILD_TESTING "Build the testing tree." ON) find_package(ECM QUIET NO_MODULE) if(NOT ECM_FOUND) + if(Launcher_QT_VERSION_MAJOR EQUAL 5) + COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/extra-cmake-modules checkout kf5 + elseif(Launcher_QT_VERSION_MAJOR EQUAL 6) + else() if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/CMakeLists.txt") message(STATUS "Using bundled ECM") set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/modules;${CMAKE_MODULE_PATH}") @@ -352,7 +356,12 @@ if(NOT Launcher_FORCE_BUNDLED_LIBS) # Find cmark find_package(cmark QUIET) - find_package(KF6Archive) + if(Launcher_QT_VERSION_MAJOR EQUAL 5) + find_package(KF5Archive) + elseif(Launcher_QT_VERSION_MAJOR EQUAL 6) + find_package(KF6Archive) + else() + endif() include(ECMQtDeclareLoggingCategory) @@ -553,12 +562,22 @@ else() endif() add_subdirectory(libraries/qdcss) # css parser +if(Launcher_QT_VERSION_MAJOR EQUAL 5) +if(NOT KF5Archive_FOUND) + COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/karchive checkout kf5 + message(STATUS "Using bundled karchive") + add_subdirectory(libraries/karchive) +else() + message(STATUS "Using system karchive") +endif() +elseif(Launcher_QT_VERSION_MAJOR EQUAL 6) if(NOT KF6Archive_FOUND) message(STATUS "Using bundled karchive") add_subdirectory(libraries/karchive) else() message(STATUS "Using system karchive") endif() +else() ############################### Built Artifacts ############################### diff --git a/libraries/extra-cmake-modules b/libraries/extra-cmake-modules index bbcbaff782..0eb01b5d11 160000 --- a/libraries/extra-cmake-modules +++ b/libraries/extra-cmake-modules @@ -1 +1 @@ -Subproject commit bbcbaff78283270c2beee69afd8d5b91da854af8 +Subproject commit 0eb01b5d116290340cd0d71c3bf731caa87a2393 From f6ff7a745e89afa612ca42aec87c48defed317c4 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 26 Jun 2024 12:22:14 +0300 Subject: [PATCH 5/9] take2 --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a804b08e1..5bfa494f07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,7 +153,11 @@ option(BUILD_TESTING "Build the testing tree." ON) find_package(ECM QUIET NO_MODULE) if(NOT ECM_FOUND) if(Launcher_QT_VERSION_MAJOR EQUAL 5) - COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/extra-cmake-modules checkout kf5 + execute_process( + COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/extra-cmake-modules checkout kf5 + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + RESULT_VARIABLE result + ) elseif(Launcher_QT_VERSION_MAJOR EQUAL 6) else() if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/CMakeLists.txt") @@ -564,7 +568,11 @@ add_subdirectory(libraries/qdcss) # css parser if(Launcher_QT_VERSION_MAJOR EQUAL 5) if(NOT KF5Archive_FOUND) - COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/karchive checkout kf5 + execute_process( + COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/karchive checkout kf5 + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + RESULT_VARIABLE result + ) message(STATUS "Using bundled karchive") add_subdirectory(libraries/karchive) else() From 6ff3a1d7765dc3a27ee87c5d46650201ad5b0f9a Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 26 Jun 2024 12:26:18 +0300 Subject: [PATCH 6/9] take 3 --- CMakeLists.txt | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bfa494f07..b2553dbb20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,8 +158,7 @@ if(NOT ECM_FOUND) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} RESULT_VARIABLE result ) - elseif(Launcher_QT_VERSION_MAJOR EQUAL 6) - else() + endif() if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/CMakeLists.txt") message(STATUS "Using bundled ECM") set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/modules;${CMAKE_MODULE_PATH}") @@ -364,7 +363,7 @@ if(NOT Launcher_FORCE_BUNDLED_LIBS) find_package(KF5Archive) elseif(Launcher_QT_VERSION_MAJOR EQUAL 6) find_package(KF6Archive) - else() + endif() endif() @@ -567,25 +566,25 @@ endif() add_subdirectory(libraries/qdcss) # css parser if(Launcher_QT_VERSION_MAJOR EQUAL 5) -if(NOT KF5Archive_FOUND) - execute_process( - COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/karchive checkout kf5 - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - RESULT_VARIABLE result - ) - message(STATUS "Using bundled karchive") - add_subdirectory(libraries/karchive) -else() - message(STATUS "Using system karchive") -endif() + if(NOT KF5Archive_FOUND) + execute_process( + COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/karchive checkout kf5 + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + RESULT_VARIABLE result + ) + message(STATUS "Using bundled karchive") + add_subdirectory(libraries/karchive) + else() + message(STATUS "Using system karchive") + endif() elseif(Launcher_QT_VERSION_MAJOR EQUAL 6) -if(NOT KF6Archive_FOUND) - message(STATUS "Using bundled karchive") - add_subdirectory(libraries/karchive) -else() - message(STATUS "Using system karchive") + if(NOT KF6Archive_FOUND) + message(STATUS "Using bundled karchive") + add_subdirectory(libraries/karchive) + else() + message(STATUS "Using system karchive") + endif() endif() -else() ############################### Built Artifacts ############################### From 0ea0e9cbb2a9dbbf71ef8711f0ee4c2415e200d1 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 26 Jun 2024 12:30:59 +0300 Subject: [PATCH 7/9] take 4 --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2553dbb20..e61b582a33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -580,6 +580,15 @@ if(Launcher_QT_VERSION_MAJOR EQUAL 5) elseif(Launcher_QT_VERSION_MAJOR EQUAL 6) if(NOT KF6Archive_FOUND) message(STATUS "Using bundled karchive") + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/CMakeLists.txt") + message(STATUS "Using bundled ECM") + set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/modules;${CMAKE_MODULE_PATH}") + else() + message(FATAL_ERROR + " Could not find ECM\n \n" + " Either install ECM using the system package manager or clone submodules\n" + " Submodules can be cloned with 'git submodule update --init --recursive'") + endif() add_subdirectory(libraries/karchive) else() message(STATUS "Using system karchive") From e6887d3ae188255ae6d6c3bf42f0d257baca88ef Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 26 Jun 2024 12:37:45 +0300 Subject: [PATCH 8/9] take 5 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e61b582a33..16878558a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -583,6 +583,7 @@ elseif(Launcher_QT_VERSION_MAJOR EQUAL 6) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/CMakeLists.txt") message(STATUS "Using bundled ECM") set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/extra-cmake-modules/modules;${CMAKE_MODULE_PATH}") + find_package(ECM 6.3.0 REQUIRED NO_MODULE) else() message(FATAL_ERROR " Could not find ECM\n \n" From cbf294ad98fb863eb56cba815ec41bbbae54543d Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 26 Jun 2024 12:45:57 +0300 Subject: [PATCH 9/9] take 6 --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16878558a1..8f954c2022 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,11 +150,11 @@ endif() option(BUILD_TESTING "Build the testing tree." ON) -find_package(ECM QUIET NO_MODULE) +# find_package(ECM QUIET NO_MODULE) if(NOT ECM_FOUND) if(Launcher_QT_VERSION_MAJOR EQUAL 5) execute_process( - COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/extra-cmake-modules checkout kf5 + COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/extra-cmake-modules checkout bbcbaff78283270c2beee69afd8d5b91da854af8 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} RESULT_VARIABLE result ) @@ -568,7 +568,7 @@ add_subdirectory(libraries/qdcss) # css parser if(Launcher_QT_VERSION_MAJOR EQUAL 5) if(NOT KF5Archive_FOUND) execute_process( - COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/karchive checkout kf5 + COMMAND git -C ${CMAKE_SOURCE_DIR}/libraries/karchive checkout eba2cb37f128733561c9a03f0230e7836c76a045 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} RESULT_VARIABLE result )