diff options
author | James Le Cuirot <chewi@gentoo.org> | 2022-07-07 21:52:54 +0100 |
---|---|---|
committer | Dominik Riebeling <dominik.riebeling@gmail.com> | 2022-07-11 15:00:07 -0400 |
commit | 4917f764bbb9580d9ec312794c0d7ae71c6792e1 (patch) | |
tree | 755c7c45cc253187146eac69e82a5c5442945c52 | |
parent | db2817eb1ab3d4634010a83db5c657fc8d27b5eb (diff) | |
download | rockbox-4917f764bb.tar.gz rockbox-4917f764bb.zip |
rbutil: Try to use system-wide QuaZIP in preference to building our own
QuaZIP is included in several major Linux distributions and packaging
policies strongly oppose bundling of libraries.
Change-Id: I8d454784dc4b244f4dd8aa18deb3350a29aaab77
-rw-r--r-- | docs/CREDITS | 1 | ||||
-rw-r--r-- | utils/rbutilqt/CMakeLists.txt | 66 | ||||
-rw-r--r-- | utils/rbutilqt/base/ziputil.cpp | 6 | ||||
-rw-r--r-- | utils/rbutilqt/base/ziputil.h | 6 |
4 files changed, 44 insertions, 35 deletions
diff --git a/docs/CREDITS b/docs/CREDITS index 6f7c23fc7e..3a6fcb83b9 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -710,6 +710,7 @@ Marc Aarts Fabrice Bellard Selami Dinçer Matej Golian +James Le Cuirot The libmad team The wavpack team diff --git a/utils/rbutilqt/CMakeLists.txt b/utils/rbutilqt/CMakeLists.txt index 41954cb9ee..24e15ac1b4 100644 --- a/utils/rbutilqt/CMakeLists.txt +++ b/utils/rbutilqt/CMakeLists.txt @@ -255,9 +255,44 @@ if(APPLE) ${CMAKE_CURRENT_LIST_DIR}/base/ttscarbon.h) endif() +find_package(QuaZip-Qt${QT_VERSION_MAJOR} QUIET) +if(QuaZip-Qt${QT_VERSION_MAJOR}_FOUND) + message("-- Found QuaZip") + set(QUAZIP_LIBRARY QuaZip::QuaZip) +else() + message("-- QuaZip not found, building our own") + # TODO: Upstream has cmake support, use that instead. + add_library(quazip + ${CMAKE_CURRENT_LIST_DIR}/quazip/ioapi.h + ${CMAKE_CURRENT_LIST_DIR}/quazip/minizip_crypt.h + ${CMAKE_CURRENT_LIST_DIR}/quazip/qioapi.cpp + ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip.cpp + ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfile.cpp + ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfile.h + ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfileinfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfileinfo.h + ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip_global.h + ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip.h + ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipnewinfo.cpp + ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipnewinfo.h + ${CMAKE_CURRENT_LIST_DIR}/quazip/unzip.c + ${CMAKE_CURRENT_LIST_DIR}/quazip/unzip.h + ${CMAKE_CURRENT_LIST_DIR}/quazip/zip.c + ${CMAKE_CURRENT_LIST_DIR}/quazip/zip.h + ) + target_include_directories(quazip PUBLIC ${CMAKE_CURRENT_LIST_DIR}/quazip) + target_link_libraries(quazip z Qt${QT_VERSION_MAJOR}::Core) + if(QT_VERSION_MAJOR EQUAL 6) + target_link_libraries(quazip Qt${QT_VERSION_MAJOR}::Core5Compat) + endif() + target_compile_definitions(quazip PUBLIC QUAZIP_STATIC) + set_property(TARGET quazip PROPERTY AUTOMOC ON) + set(QUAZIP_LIBRARY quazip) +endif() + target_link_libraries(rbbase - cutelogger quazip mspack bspatch rbspeex voicefont - sansapatcher ipodpatcher chinachippatcher + cutelogger ${QUAZIP_LIBRARY} mspack bspatch rbspeex + voicefont sansapatcher ipodpatcher chinachippatcher mkamsboot mkimxboot mkmpioboot mktccboot mks5lboot Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network) target_include_directories(rbbase PUBLIC ${CMAKE_CURRENT_LIST_DIR}/base) @@ -298,33 +333,6 @@ target_link_libraries(cutelogger PUBLIC Qt${QT_VERSION_MAJOR}::Core) target_compile_definitions(cutelogger PUBLIC CUTELOGGER_STATIC) set_property(TARGET cutelogger PROPERTY AUTOMOC ON) -# TODO: Upstream has cmake support, use that instead. -add_library(quazip - ${CMAKE_CURRENT_LIST_DIR}/quazip/ioapi.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/minizip_crypt.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/qioapi.cpp - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip.cpp - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfile.cpp - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfile.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfileinfo.cpp - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipfileinfo.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip_global.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazip.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipnewinfo.cpp - ${CMAKE_CURRENT_LIST_DIR}/quazip/quazipnewinfo.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/unzip.c - ${CMAKE_CURRENT_LIST_DIR}/quazip/unzip.h - ${CMAKE_CURRENT_LIST_DIR}/quazip/zip.c - ${CMAKE_CURRENT_LIST_DIR}/quazip/zip.h - ) -target_include_directories(quazip PUBLIC ${CMAKE_CURRENT_LIST_DIR}/quazip) -target_link_libraries(quazip z Qt${QT_VERSION_MAJOR}::Core) -if(QT_VERSION_MAJOR EQUAL 6) - target_link_libraries(quazip Qt${QT_VERSION_MAJOR}::Core5Compat) -endif() -target_compile_definitions(quazip PUBLIC QUAZIP_STATIC) -set_property(TARGET quazip PROPERTY AUTOMOC ON) - add_library(mspack #mspack/cabc.c mspack/cabd.c diff --git a/utils/rbutilqt/base/ziputil.cpp b/utils/rbutilqt/base/ziputil.cpp index e285446711..877a861253 100644 --- a/utils/rbutilqt/base/ziputil.cpp +++ b/utils/rbutilqt/base/ziputil.cpp @@ -22,9 +22,9 @@ #include "progressloglevels.h" #include "Logger.h" -#include "quazip/quazip.h" -#include "quazip/quazipfile.h" -#include "quazip/quazipfileinfo.h" +#include <quazip.h> +#include <quazipfile.h> +#include <quazipfileinfo.h> ZipUtil::ZipUtil(QObject* parent) : ArchiveUtil(parent) diff --git a/utils/rbutilqt/base/ziputil.h b/utils/rbutilqt/base/ziputil.h index 73a87a820a..ea32ca42c3 100644 --- a/utils/rbutilqt/base/ziputil.h +++ b/utils/rbutilqt/base/ziputil.h @@ -21,9 +21,9 @@ #include <QtCore> #include "archiveutil.h" -#include "quazip/quazip.h" -#include "quazip/quazipfile.h" -#include "quazip/quazipfileinfo.h" +#include <quazip.h> +#include <quazipfile.h> +#include <quazipfileinfo.h> class ZipUtil : public ArchiveUtil { |