]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Test with XZ Utils 5.6.3 on windows CI jobs (#2417)
authorMostyn Bramley-Moore <mostyn@antipode.se>
Sun, 1 Dec 2024 23:29:46 +0000 (00:29 +0100)
committerGitHub <noreply@github.com>
Sun, 1 Dec 2024 23:29:46 +0000 (00:29 +0100)
This change fixes the autotools build to work with xz-utils 5.6.3, which
changed library names on windows, and fixes a couple of tests that I
noticed had dependencies on liblzma.

build/ci/github_actions/ci.cmd
configure.ac
libarchive/test/test_read_format_7zip.c

index 515e6c732f836b8148652701c834477c69616233..ac3a7dd37d71ea191d7c9ac09f93b42eb190c0c6 100755 (executable)
@@ -1,7 +1,7 @@
 @ECHO OFF
 SET ZLIB_VERSION=1.3
 SET BZIP2_VERSION=1ea1ac188ad4b9cb662e3f8314673c63df95a589
-SET XZ_VERSION=5.4.4
+SET XZ_VERSION=5.6.3
 IF NOT "%BE%"=="mingw-gcc" (
   IF NOT "%BE%"=="msvc" (
     ECHO Environment variable BE must be mingw-gcc or msvc
index 0fdfaf06a508979f35ff914f6e7b45ad154bf1d3..6c7ed74efcfa47e8204646b193a48ff8174dccc1 100644 (file)
@@ -491,8 +491,16 @@ AC_ARG_WITH([lzma],
   AS_HELP_STRING([--without-lzma], [Don't build support for xz through lzma]))
 
 if test "x$with_lzma" != "xno"; then
+  PKG_PROG_PKG_CONFIG
+  PKG_CHECK_MODULES(LZMA_PC, [liblzma], [
+    CPPFLAGS="${CPPFLAGS} ${LZMA_PC_CFLAGS}"
+    LIBS="${LIBS} ${LZMA_PC_LIBS}"
+    AC_DEFINE(HAVE_LIBLZMA, [1], [Define to 1 if you have the `lzma' library.])
+  ], [
+    AC_CHECK_LIB(lzma,lzma_stream_decoder)
+  ])
   AC_CHECK_HEADERS([lzma.h])
-  AC_CHECK_LIB(lzma,lzma_stream_decoder)
+
   # Some pre-release (but widely distributed) versions of liblzma
   # included a disabled version of lzma_stream_encoder_mt that
   # fools a naive AC_CHECK_LIB or AC_CHECK_FUNC, so we need
index e2eaf48891ad493935286db876c2859c94965500..8f990e49e3c2aaf54a335dcc83e4f60e8f87645f 100644 (file)
@@ -929,6 +929,10 @@ DEFINE_TEST(test_read_format_7zip_zstd)
        if (ARCHIVE_OK != archive_read_support_filter_zstd(a)) {
                skipping(
                    "7zip:zstd decoding is not supported on this platform");
+       } else if (ARCHIVE_OK != archive_read_support_filter_xz(a)) {
+               // The directory header entries in the test file uses lzma.
+               skipping(
+                   "7zip:lzma decoding is not supported on this platform");
        } else {
                test_extract_all_files_zstd("test_read_format_7zip_zstd.7z");
        }
@@ -946,6 +950,10 @@ DEFINE_TEST(test_read_format_7zip_zstd_solid)
        if (ARCHIVE_OK != archive_read_support_filter_zstd(a)) {
                skipping(
                    "7zip:zstd decoding is not supported on this platform");
+       } else if (ARCHIVE_OK != archive_read_support_filter_xz(a)) {
+               // The directory header entries in the test file uses lzma.
+               skipping(
+                   "7zip:lzma decoding is not supported on this platform");
        } else {
                test_extract_all_files_zstd("test_read_format_7zip_solid_zstd.7z");
        }