From efa414c442a77735a5f972b7103e8ce866a6bdd1 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Thu, 20 Jan 2022 20:40:56 +0100 Subject: refactor: initial migration to QuaZip 1.2 Let's move off our custom QuaZip. In the olden times we needed the custom version of QuaZip, as it was basically unmaintained and on SourceForge (eww). But nowadays it's maintained and on GitHub. See new GitHub page: https://github.com/stachenov/quazip --- launcher/modplatform/atlauncher/ATLPackInstallTask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'launcher/modplatform/atlauncher/ATLPackInstallTask.cpp') diff --git a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp index e5db512e..30a61026 100644 --- a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp +++ b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp @@ -19,7 +19,7 @@ #include -#include +#include #include "MMCZip.h" #include "minecraft/OneSixVersionFormat.h" -- cgit From 3aa809b8c0de48ca241ec567acda31ed1a728540 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 24 Jan 2022 22:55:57 +0100 Subject: refactor: add in-tree QuaZip --- .gitmodules | 4 +++ CMakeLists.txt | 32 ++++++++++++++++------ launcher/CMakeLists.txt | 3 +- launcher/InstanceImportTask.cpp | 5 ++++ launcher/MMCZip.cpp | 7 ++++- launcher/MMCZip.h | 11 ++++---- launcher/minecraft/MinecraftLoadAndCheck.h | 5 ++++ launcher/minecraft/MinecraftUpdate.h | 5 ++++ launcher/minecraft/World.cpp | 7 +++++ launcher/minecraft/launch/ExtractNatives.cpp | 6 ++++ launcher/minecraft/mod/LocalModParseTask.cpp | 7 +++++ .../modplatform/atlauncher/ATLPackInstallTask.cpp | 4 +++ launcher/modplatform/legacy_ftb/PackInstallTask.h | 7 +++++ .../modplatform/technic/SingleZipPackInstallTask.h | 4 +++ .../modplatform/technic/TechnicPackProcessor.cpp | 8 ++++++ libraries/classparser/CMakeLists.txt | 2 +- libraries/classparser/src/classparser.cpp | 6 ++++ libraries/quazip | 1 + 18 files changed, 107 insertions(+), 17 deletions(-) create mode 160000 libraries/quazip (limited to 'launcher/modplatform/atlauncher/ATLPackInstallTask.cpp') diff --git a/.gitmodules b/.gitmodules index cff26810..10575207 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,7 @@ path = libraries/libnbtplusplus url = https://github.com/MultiMC/libnbtplusplus.git pushurl = git@github.com:MultiMC/libnbtplusplus.git + +[submodule "libraries/quazip"] + path = libraries/quazip + url = https://github.com/stachenov/quazip.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 35deff04..2ebc0dfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,11 @@ set(Launcher_DISCORD_URL "https://discord.gg/Z52pwxWCHP" CACHE STRING "URL for t # Subreddit URL set(Launcher_SUBREDDIT_URL "" CACHE STRING "URL for the subreddit.") +# Builds +set(Launcher_FORCE_BUNDLED_LIBS OFF CACHE BOOL "Prevent using system libraries, if they are available as submodules") +set(Launcher_QT_VERSION_MAJOR "5" CACHE STRING "Major Qt version to build against") + + #### Check the current Git commit and branch include(GetGitRevisionDescription) get_git_head_revision(Launcher_GIT_REFSPEC Launcher_GIT_COMMIT) @@ -96,14 +101,19 @@ add_custom_target(tcversion echo "\\#\\#teamcity[setParameter name=\\'env.LAUNCH ################################ 3rd Party Libs ################################ # Find the required Qt parts -find_package(Qt5Core REQUIRED) -find_package(Qt5Widgets REQUIRED) -find_package(Qt5Concurrent REQUIRED) -find_package(Qt5Network REQUIRED) -find_package(Qt5Test REQUIRED) -find_package(Qt5Xml REQUIRED) - -find_package(QuaZip-Qt5 REQUIRED) +set(QT_VERSION_MAJOR ${Launcher_QT_VERSION_MAJOR}) +find_package(Qt${QT_VERSION_MAJOR}Core REQUIRED) +find_package(Qt${QT_VERSION_MAJOR}Widgets REQUIRED) +find_package(Qt${QT_VERSION_MAJOR}Concurrent REQUIRED) +find_package(Qt${QT_VERSION_MAJOR}Network REQUIRED) +find_package(Qt${QT_VERSION_MAJOR}Test REQUIRED) +find_package(Qt${QT_VERSION_MAJOR}Xml REQUIRED) + +if (NOT Launcher_FORCE_BUNDLED_LIBS) + find_package(QuaZip-Qt${QT_VERSION_MAJOR} REQUIRED) +else() + MESSAGE(STATUS "Not looking for QuaZip via find_package") +endif() # The Qt5 cmake files don't provide its install paths, so ask qmake. include(QMakeQuery) @@ -251,6 +261,12 @@ add_subdirectory(libraries/hoedown) # markdown parser add_subdirectory(libraries/launcher) # java based launcher part for Minecraft add_subdirectory(libraries/javacheck) # java compatibility checker add_subdirectory(libraries/xz-embedded) # xz compression +if (NOT QuaZip-Qt${QT_VERSION_MAJOR}_FOUND) + set(QUAZIP_QT_MAJOR_VERSION ${QT_VERSION_MAJOR}) + add_compile_definitions(QUAZIP_USE_SUBMODULE) + MESSAGE(STATUS "Adding QuaZip submodule, with QT_VERSION_MAJOR ${QUAZIP_QT_MAJOR_VERSION}") + add_subdirectory(libraries/quazip) # zip manipulation library +endif() add_subdirectory(libraries/rainbow) # Qt extension for colors add_subdirectory(libraries/iconfix) # fork of Qt's QIcon loader add_subdirectory(libraries/LocalPeer) # fork of a library from Qt solutions diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 0ef27f6b..c704563b 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -899,7 +899,6 @@ endif() add_library(Launcher_logic STATIC ${LOGIC_SOURCES} ${LAUNCHER_SOURCES} ${LAUNCHER_UI} ${LAUNCHER_RESOURCES}) target_link_libraries(Launcher_logic systeminfo - Launcher_quazip Launcher_classparser ${NBT_NAME} ${ZLIB_LIBRARIES} @@ -917,7 +916,7 @@ target_link_libraries(Launcher_logic ) target_link_libraries(Launcher_logic Launcher_iconfix - ${QUAZIP_LIBRARIES} + QuaZip::QuaZip hoedown Launcher_rainbow LocalPeer diff --git a/launcher/InstanceImportTask.cpp b/launcher/InstanceImportTask.cpp index 6e2dd912..8aab91c5 100644 --- a/launcher/InstanceImportTask.cpp +++ b/launcher/InstanceImportTask.cpp @@ -29,7 +29,12 @@ #include "modplatform/flame/FileResolvingTask.h" #include "modplatform/flame/PackManifest.h" #include "Json.h" + +#ifdef QUAZIP_USE_SUBMODULE +#include +#else #include +#endif #include "modplatform/technic/TechnicPackProcessor.h" #include "icons/IconList.h" diff --git a/launcher/MMCZip.cpp b/launcher/MMCZip.cpp index e1906a0c..74c9b388 100644 --- a/launcher/MMCZip.cpp +++ b/launcher/MMCZip.cpp @@ -12,10 +12,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +#ifdef QUAZIP_USE_SUBMODULE +#include +#include +#include +#else #include #include #include +#endif #include "MMCZip.h" #include "FileSystem.h" diff --git a/launcher/MMCZip.h b/launcher/MMCZip.h index 5260f856..5983aa37 100644 --- a/launcher/MMCZip.h +++ b/launcher/MMCZip.h @@ -19,13 +19,14 @@ #include #include #include "minecraft/mod/Mod.h" +#include "nonstd/optional" #include -//#include -// TODO: Blocked by https://github.com/stachenov/quazip/pull/141 -// For now, checkout https://github.com/Scrumplex/quazip/tree/expose-jlcompress-fns at ../../quazip -#include <../../quazip/quazip/JlCompress.h> -#include +#ifdef QUAZIP_USE_SUBMODULE +#include +#else +#include +#endif namespace MMCZip { diff --git a/launcher/minecraft/MinecraftLoadAndCheck.h b/launcher/minecraft/MinecraftLoadAndCheck.h index 4e673a4b..1aeb79f8 100644 --- a/launcher/minecraft/MinecraftLoadAndCheck.h +++ b/launcher/minecraft/MinecraftLoadAndCheck.h @@ -20,7 +20,12 @@ #include #include "tasks/Task.h" + +#ifdef QUAZIP_USE_SUBMODULE +#include +#else #include +#endif #include "QObjectPtr.h" diff --git a/launcher/minecraft/MinecraftUpdate.h b/launcher/minecraft/MinecraftUpdate.h index a1df4b3f..36c4310b 100644 --- a/launcher/minecraft/MinecraftUpdate.h +++ b/launcher/minecraft/MinecraftUpdate.h @@ -22,7 +22,12 @@ #include "net/NetJob.h" #include "tasks/Task.h" #include "minecraft/VersionFilterData.h" + +#ifdef QUAZIP_USE_SUBMODULE +#include +#else #include +#endif class MinecraftVersion; class MinecraftInstance; diff --git a/launcher/minecraft/World.cpp b/launcher/minecraft/World.cpp index 95892d43..8fd77919 100644 --- a/launcher/minecraft/World.cpp +++ b/launcher/minecraft/World.cpp @@ -26,9 +26,16 @@ #include #include #include + +#ifdef QUAZIP_USE_SUBMODULE +#include +#include +#include +#else #include #include #include +#endif #include diff --git a/launcher/minecraft/launch/ExtractNatives.cpp b/launcher/minecraft/launch/ExtractNatives.cpp index 744e7ac6..5f13f730 100644 --- a/launcher/minecraft/launch/ExtractNatives.cpp +++ b/launcher/minecraft/launch/ExtractNatives.cpp @@ -17,8 +17,14 @@ #include #include +#ifdef QUAZIP_USE_SUBMODULE +#include +#include +#else #include #include +#endif + #include "MMCZip.h" #include "FileSystem.h" #include diff --git a/launcher/minecraft/mod/LocalModParseTask.cpp b/launcher/minecraft/mod/LocalModParseTask.cpp index fa3a4538..651b96ac 100644 --- a/launcher/minecraft/mod/LocalModParseTask.cpp +++ b/launcher/minecraft/mod/LocalModParseTask.cpp @@ -4,8 +4,15 @@ #include #include #include + +#ifdef QUAZIP_USE_SUBMODULE +#include +#include +#else #include #include +#endif + #include #include "settings/INIFile.h" diff --git a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp index 30a61026..c4f4b96f 100644 --- a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp +++ b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp @@ -19,7 +19,11 @@ #include +#ifdef QUAZIP_USE_SUBMODULE +#include +#else #include +#endif #include "MMCZip.h" #include "minecraft/OneSixVersionFormat.h" diff --git a/launcher/modplatform/legacy_ftb/PackInstallTask.h b/launcher/modplatform/legacy_ftb/PackInstallTask.h index 6797971c..2cdfee7a 100644 --- a/launcher/modplatform/legacy_ftb/PackInstallTask.h +++ b/launcher/modplatform/legacy_ftb/PackInstallTask.h @@ -1,8 +1,15 @@ #pragma once #include "InstanceTask.h" #include "net/NetJob.h" + +#ifdef QUAZIP_USE_SUBMODULE +#include +#include +#else #include "QuaZip-Qt5-1.2/quazip/quazip.h" #include "QuaZip-Qt5-1.2/quazip/quazipdir.h" +#endif + #include "meta/Index.h" #include "meta/Version.h" #include "meta/VersionList.h" diff --git a/launcher/modplatform/technic/SingleZipPackInstallTask.h b/launcher/modplatform/technic/SingleZipPackInstallTask.h index 58594136..d3bdc00b 100644 --- a/launcher/modplatform/technic/SingleZipPackInstallTask.h +++ b/launcher/modplatform/technic/SingleZipPackInstallTask.h @@ -18,7 +18,11 @@ #include "InstanceTask.h" #include "net/NetJob.h" +#ifdef QUAZIP_USE_SUBMODULE +#include +#else #include "QuaZip-Qt5-1.2/quazip/quazip.h" +#endif #include #include diff --git a/launcher/modplatform/technic/TechnicPackProcessor.cpp b/launcher/modplatform/technic/TechnicPackProcessor.cpp index f5c011f5..a8b4d05b 100644 --- a/launcher/modplatform/technic/TechnicPackProcessor.cpp +++ b/launcher/modplatform/technic/TechnicPackProcessor.cpp @@ -19,9 +19,17 @@ #include #include #include + +#ifdef QUAZIP_USE_SUBMODULE +#include +#include +#include +#else #include #include #include +#endif + #include #include diff --git a/libraries/classparser/CMakeLists.txt b/libraries/classparser/CMakeLists.txt index c07e871c..fc510e68 100644 --- a/libraries/classparser/CMakeLists.txt +++ b/libraries/classparser/CMakeLists.txt @@ -38,4 +38,4 @@ add_definitions(-DCLASSPARSER_LIBRARY) add_library(Launcher_classparser STATIC ${CLASSPARSER_SOURCES} ${CLASSPARSER_HEADERS}) target_include_directories(Launcher_classparser PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(Launcher_classparser Launcher_quazip Qt5::Core) +target_link_libraries(Launcher_classparser QuaZip::QuaZip Qt5::Core) diff --git a/libraries/classparser/src/classparser.cpp b/libraries/classparser/src/classparser.cpp index a47d1aad..b7612a41 100644 --- a/libraries/classparser/src/classparser.cpp +++ b/libraries/classparser/src/classparser.cpp @@ -18,7 +18,13 @@ #include "classparser.h" #include + +#ifdef QUAZIP_USE_SUBMODULE +#include +#else #include +#endif + #include namespace classparser diff --git a/libraries/quazip b/libraries/quazip new file mode 160000 index 00000000..09ec1d10 --- /dev/null +++ b/libraries/quazip @@ -0,0 +1 @@ +Subproject commit 09ec1d10c6d627f895109b21728dda000cbfa7d1 -- cgit From 0442b80a2c0a7d99fa8b7df5d64c1ddfc676f251 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Tue, 25 Jan 2022 12:53:33 +0100 Subject: refactor: simpler includes for quazip --- CMakeLists.txt | 1 - launcher/InstanceImportTask.cpp | 5 ----- launcher/MMCZip.cpp | 7 +------ launcher/MMCZip.h | 6 +----- launcher/minecraft/MinecraftLoadAndCheck.h | 5 ----- launcher/minecraft/MinecraftUpdate.h | 5 ----- launcher/minecraft/World.cpp | 7 ------- launcher/minecraft/launch/ExtractNatives.cpp | 6 ------ launcher/minecraft/mod/LocalModParseTask.cpp | 7 ------- launcher/modplatform/atlauncher/ATLPackInstallTask.cpp | 4 ---- launcher/modplatform/legacy_ftb/PackInstallTask.h | 7 ------- launcher/modplatform/technic/SingleZipPackInstallTask.h | 4 ---- launcher/modplatform/technic/TechnicPackProcessor.cpp | 8 -------- libraries/classparser/src/classparser.cpp | 6 ------ 14 files changed, 2 insertions(+), 76 deletions(-) (limited to 'launcher/modplatform/atlauncher/ATLPackInstallTask.cpp') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ebc0dfd..ab39e83c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -263,7 +263,6 @@ add_subdirectory(libraries/javacheck) # java compatibility checker add_subdirectory(libraries/xz-embedded) # xz compression if (NOT QuaZip-Qt${QT_VERSION_MAJOR}_FOUND) set(QUAZIP_QT_MAJOR_VERSION ${QT_VERSION_MAJOR}) - add_compile_definitions(QUAZIP_USE_SUBMODULE) MESSAGE(STATUS "Adding QuaZip submodule, with QT_VERSION_MAJOR ${QUAZIP_QT_MAJOR_VERSION}") add_subdirectory(libraries/quazip) # zip manipulation library endif() diff --git a/launcher/InstanceImportTask.cpp b/launcher/InstanceImportTask.cpp index 8aab91c5..ec378538 100644 --- a/launcher/InstanceImportTask.cpp +++ b/launcher/InstanceImportTask.cpp @@ -29,12 +29,7 @@ #include "modplatform/flame/FileResolvingTask.h" #include "modplatform/flame/PackManifest.h" #include "Json.h" - -#ifdef QUAZIP_USE_SUBMODULE #include -#else -#include -#endif #include "modplatform/technic/TechnicPackProcessor.h" #include "icons/IconList.h" diff --git a/launcher/MMCZip.cpp b/launcher/MMCZip.cpp index 36562b06..9b8b7908 100644 --- a/launcher/MMCZip.cpp +++ b/launcher/MMCZip.cpp @@ -12,15 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifdef QUAZIP_USE_SUBMODULE + #include #include #include -#else -#include -#include -#include -#endif #include "MMCZip.h" #include "FileSystem.h" diff --git a/launcher/MMCZip.h b/launcher/MMCZip.h index 5983aa37..c8e830ab 100644 --- a/launcher/MMCZip.h +++ b/launcher/MMCZip.h @@ -19,14 +19,10 @@ #include #include #include "minecraft/mod/Mod.h" -#include "nonstd/optional" #include -#ifdef QUAZIP_USE_SUBMODULE #include -#else -#include -#endif +#include namespace MMCZip { diff --git a/launcher/minecraft/MinecraftLoadAndCheck.h b/launcher/minecraft/MinecraftLoadAndCheck.h index 1aeb79f8..d9af3ace 100644 --- a/launcher/minecraft/MinecraftLoadAndCheck.h +++ b/launcher/minecraft/MinecraftLoadAndCheck.h @@ -20,12 +20,7 @@ #include #include "tasks/Task.h" - -#ifdef QUAZIP_USE_SUBMODULE #include -#else -#include -#endif #include "QObjectPtr.h" diff --git a/launcher/minecraft/MinecraftUpdate.h b/launcher/minecraft/MinecraftUpdate.h index 36c4310b..9ebef656 100644 --- a/launcher/minecraft/MinecraftUpdate.h +++ b/launcher/minecraft/MinecraftUpdate.h @@ -22,12 +22,7 @@ #include "net/NetJob.h" #include "tasks/Task.h" #include "minecraft/VersionFilterData.h" - -#ifdef QUAZIP_USE_SUBMODULE #include -#else -#include -#endif class MinecraftVersion; class MinecraftInstance; diff --git a/launcher/minecraft/World.cpp b/launcher/minecraft/World.cpp index 8fd77919..2937c116 100644 --- a/launcher/minecraft/World.cpp +++ b/launcher/minecraft/World.cpp @@ -26,16 +26,9 @@ #include #include #include - -#ifdef QUAZIP_USE_SUBMODULE #include #include #include -#else -#include -#include -#include -#endif #include diff --git a/launcher/minecraft/launch/ExtractNatives.cpp b/launcher/minecraft/launch/ExtractNatives.cpp index 5f13f730..7d5f4179 100644 --- a/launcher/minecraft/launch/ExtractNatives.cpp +++ b/launcher/minecraft/launch/ExtractNatives.cpp @@ -17,14 +17,8 @@ #include #include -#ifdef QUAZIP_USE_SUBMODULE #include #include -#else -#include -#include -#endif - #include "MMCZip.h" #include "FileSystem.h" #include diff --git a/launcher/minecraft/mod/LocalModParseTask.cpp b/launcher/minecraft/mod/LocalModParseTask.cpp index 651b96ac..757a2187 100644 --- a/launcher/minecraft/mod/LocalModParseTask.cpp +++ b/launcher/minecraft/mod/LocalModParseTask.cpp @@ -4,15 +4,8 @@ #include #include #include - -#ifdef QUAZIP_USE_SUBMODULE #include #include -#else -#include -#include -#endif - #include #include "settings/INIFile.h" diff --git a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp index c4f4b96f..8de5fc9f 100644 --- a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp +++ b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp @@ -19,11 +19,7 @@ #include -#ifdef QUAZIP_USE_SUBMODULE #include -#else -#include -#endif #include "MMCZip.h" #include "minecraft/OneSixVersionFormat.h" diff --git a/launcher/modplatform/legacy_ftb/PackInstallTask.h b/launcher/modplatform/legacy_ftb/PackInstallTask.h index 2cdfee7a..a7395220 100644 --- a/launcher/modplatform/legacy_ftb/PackInstallTask.h +++ b/launcher/modplatform/legacy_ftb/PackInstallTask.h @@ -1,15 +1,8 @@ #pragma once #include "InstanceTask.h" #include "net/NetJob.h" - -#ifdef QUAZIP_USE_SUBMODULE #include #include -#else -#include "QuaZip-Qt5-1.2/quazip/quazip.h" -#include "QuaZip-Qt5-1.2/quazip/quazipdir.h" -#endif - #include "meta/Index.h" #include "meta/Version.h" #include "meta/VersionList.h" diff --git a/launcher/modplatform/technic/SingleZipPackInstallTask.h b/launcher/modplatform/technic/SingleZipPackInstallTask.h index d3bdc00b..4d1fcbff 100644 --- a/launcher/modplatform/technic/SingleZipPackInstallTask.h +++ b/launcher/modplatform/technic/SingleZipPackInstallTask.h @@ -18,11 +18,7 @@ #include "InstanceTask.h" #include "net/NetJob.h" -#ifdef QUAZIP_USE_SUBMODULE #include -#else -#include "QuaZip-Qt5-1.2/quazip/quazip.h" -#endif #include #include diff --git a/launcher/modplatform/technic/TechnicPackProcessor.cpp b/launcher/modplatform/technic/TechnicPackProcessor.cpp index a8b4d05b..c45061ac 100644 --- a/launcher/modplatform/technic/TechnicPackProcessor.cpp +++ b/launcher/modplatform/technic/TechnicPackProcessor.cpp @@ -19,17 +19,9 @@ #include #include #include - -#ifdef QUAZIP_USE_SUBMODULE #include #include #include -#else -#include -#include -#include -#endif - #include #include diff --git a/libraries/classparser/src/classparser.cpp b/libraries/classparser/src/classparser.cpp index b7612a41..601521f6 100644 --- a/libraries/classparser/src/classparser.cpp +++ b/libraries/classparser/src/classparser.cpp @@ -18,13 +18,7 @@ #include "classparser.h" #include - -#ifdef QUAZIP_USE_SUBMODULE #include -#else -#include -#endif - #include namespace classparser -- cgit