mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2025-06-08 14:15:07 +02:00
Closes: https://bugs.gentoo.org/942323 Closes: https://bugs.gentoo.org/955136 Co-authored-by: Andreas Sturmlechner <asturm@gentoo.org> Signed-off-by: James Le Cuirot <chewi@gentoo.org>
142 lines
5.2 KiB
Diff
142 lines
5.2 KiB
Diff
From 4917f764bbb9580d9ec312794c0d7ae71c6792e1 Mon Sep 17 00:00:00 2001
|
|
From: James Le Cuirot <chewi@gentoo.org>
|
|
Date: Thu, 07 Jul 2022 21:52:54 +0100
|
|
Subject: [PATCH] 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
|
|
---
|
|
|
|
diff --git a/docs/CREDITS b/docs/CREDITS
|
|
index 6f7c23f..3a6fcb8 100644
|
|
--- a/docs/CREDITS
|
|
+++ b/docs/CREDITS
|
|
@@ -710,6 +710,7 @@
|
|
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 41954cb..24e15ac 100644
|
|
--- a/utils/rbutilqt/CMakeLists.txt
|
|
+++ b/utils/rbutilqt/CMakeLists.txt
|
|
@@ -255,9 +255,44 @@
|
|
${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_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 e285446..877a861 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 73a87a8..ea32ca4 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
|
|
{
|