File 0001-Support-building-against-libarchive-3.3.2-again.patch of Package ark

From 441355f3865516f4bc415350da5c7f928799758e Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Fri, 22 Nov 2019 13:09:34 +0100
Subject: [PATCH] Support building against libarchive 3.3.2 again

No zstd support though.
---
 CMakeLists.txt                                   | 2 +-
 plugins/libarchive/readwritelibarchiveplugin.cpp | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 29828b44..335ffc27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,7 +59,7 @@ if(NOT Qt5Test_FOUND)
     set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
 endif()
 
-find_package(LibArchive 3.3.3 REQUIRED)
+find_package(LibArchive 3.3.2 REQUIRED)
 set_package_properties(LibArchive PROPERTIES
                        URL "https://www.libarchive.org/"
                        DESCRIPTION "A library for dealing with a wide variety of archive file formats"
diff --git a/plugins/libarchive/readwritelibarchiveplugin.cpp b/plugins/libarchive/readwritelibarchiveplugin.cpp
index 37025947..ab580e2a 100644
--- a/plugins/libarchive/readwritelibarchiveplugin.cpp
+++ b/plugins/libarchive/readwritelibarchiveplugin.cpp
@@ -290,9 +290,11 @@ bool ReadWriteLibarchivePlugin::initializeWriterFilters()
     case ARCHIVE_FILTER_LZ4:
         ret = archive_write_add_filter_lz4(m_archiveWriter.data());
         break;
+#if ARCHIVE_VERSION_NUMBER >= 3003003
     case ARCHIVE_FILTER_ZSTD:
         ret = archive_write_add_filter_zstd(m_archiveWriter.data());
         break;
+#endif
     case ARCHIVE_FILTER_NONE:
         ret = archive_write_add_filter_none(m_archiveWriter.data());
         break;
@@ -345,9 +347,11 @@ bool ReadWriteLibarchivePlugin::initializeNewFileWriterFilters(const Compression
     } else if (filename().right(3).toUpper() == QLatin1String("LZ4")) {
         qCDebug(ARK) << "Detected lz4 compression for new file";
         ret = archive_write_add_filter_lz4(m_archiveWriter.data());
+#if ARCHIVE_VERSION_NUMBER >= 3003003
     } else if (filename().right(3).toUpper() == QLatin1String("ZST")) {
         qCDebug(ARK) << "Detected zstd compression for new file";
         ret = archive_write_add_filter_zstd(m_archiveWriter.data());
+#endif
     } else if (filename().right(3).toUpper() == QLatin1String("TAR")) {
         qCDebug(ARK) << "Detected no compression for new file (pure tar)";
         ret = archive_write_add_filter_none(m_archiveWriter.data());
-- 
2.23.0