Blame SOURCES/0001-unpacker-Build-with-older-libarchive-without-zstd.patch

6ccdcf
From 11ee20c1cdcc7a76d9e1047e8063b8349a6c6da6 Mon Sep 17 00:00:00 2001
6ccdcf
From: Colin Walters <walters@verbum.org>
6ccdcf
Date: Tue, 15 Oct 2019 15:16:06 +0000
6ccdcf
Subject: [PATCH] unpacker: Build with older libarchive without zstd
6ccdcf
6ccdcf
It's not in RHEL8.1, and I'm trying to rebase rpm-ostree.
6ccdcf
---
6ccdcf
 configure.ac                          | 4 ++++
6ccdcf
 src/libpriv/rpmostree-unpacker-core.c | 2 ++
6ccdcf
 2 files changed, 6 insertions(+)
6ccdcf
6ccdcf
diff --git a/configure.ac b/configure.ac
6ccdcf
index 873dc6b9..a0c5cce4 100644
6ccdcf
--- a/configure.ac
6ccdcf
+++ b/configure.ac
6ccdcf
@@ -122,6 +122,10 @@ dnl bundled libdnf
6ccdcf
 PKGDEP_RPMOSTREE_CFLAGS="-I $(pwd)/libdnf -I $(pwd)/libdnf-build $PKGDEP_RPMOSTREE_CFLAGS"
6ccdcf
 PKGDEP_RPMOSTREE_LIBS="-L$(pwd)/libdnf-build/libdnf -ldnf $PKGDEP_RPMOSTREE_LIBS"
6ccdcf
 
6ccdcf
+dnl RHEL8.1 has old libarchive
6ccdcf
+AS_IF([pkg-config --atleast-version=3.3.3 libarchive],
6ccdcf
+  [AC_DEFINE([HAVE_LIBARCHIVE_ZSTD], 1, [Define if we have libarchive with zstd])])
6ccdcf
+
6ccdcf
 dnl This is the current version in Fedora 25.
6ccdcf
 AS_IF([pkg-config --atleast-version=4.14.2 rpm], [], [AC_MSG_ERROR([librpm 4.14.2 required])])
6ccdcf
 
6ccdcf
diff --git a/src/libpriv/rpmostree-unpacker-core.c b/src/libpriv/rpmostree-unpacker-core.c
6ccdcf
index 3bd574a4..2d741b1e 100644
6ccdcf
--- a/src/libpriv/rpmostree-unpacker-core.c
6ccdcf
+++ b/src/libpriv/rpmostree-unpacker-core.c
6ccdcf
@@ -74,7 +74,9 @@ rpmostree_unpack_rpm2cpio (int fd, GError **error)
6ccdcf
         archive_read_support_filter_gzip,
6ccdcf
         archive_read_support_filter_xz,
6ccdcf
         archive_read_support_filter_bzip2,
6ccdcf
+#ifdef HAVE_LIBARCHIVE_ZSTD
6ccdcf
         archive_read_support_filter_zstd,
6ccdcf
+#endif
6ccdcf
         archive_read_support_format_cpio };
6ccdcf
 
6ccdcf
     for (i = 0; i < G_N_ELEMENTS (archive_setup_funcs); i++)
6ccdcf
-- 
6ccdcf
2.21.0
6ccdcf