Decrease versions of some required libraries
Decrease required version of poppler to 22.01.0. Change doc path. Revert removal of unarr as libarchive 3.6.0 is not in Fedora 36.
This commit is contained in:
parent
999d0edef5
commit
f3c88284b9
256
0001-comics-Use-libarchive-for-RAR-support.patch
Normal file
256
0001-comics-Use-libarchive-for-RAR-support.patch
Normal file
@ -0,0 +1,256 @@
|
||||
From e25912b3a2fa91d8d05d0a683303a8d0a39541b5 Mon Sep 17 00:00:00 2001
|
||||
From: Bastien Nocera <hadess@hadess.net>
|
||||
Date: Wed, 12 Jan 2022 16:18:00 +0100
|
||||
Subject: [PATCH 1/2] comics: Use libarchive for RAR support
|
||||
|
||||
As new in version 3.6.0:
|
||||
https://github.com/libarchive/libarchive/releases/tag/v3.6.0
|
||||
|
||||
This also removes the internal distinction between RARv5 and older RAR
|
||||
formats as we don't have any code left to detect it.
|
||||
|
||||
Closes: #1725
|
||||
---
|
||||
backend/comics/ev-archive.c | 68 ++++---------------------------------
|
||||
backend/comics/ev-archive.h | 1 -
|
||||
backend/comics/meson.build | 1 -
|
||||
meson.build | 2 +-
|
||||
4 files changed, 7 insertions(+), 65 deletions(-)
|
||||
|
||||
diff --git a/backend/comics/ev-archive.c b/backend/comics/ev-archive.c
|
||||
index 0ee31a61..d1a693d2 100644
|
||||
--- a/backend/comics/ev-archive.c
|
||||
+++ b/backend/comics/ev-archive.c
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include <archive.h>
|
||||
#include <archive_entry.h>
|
||||
-#include <unarr/unarr.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
#define BUFFER_SIZE (64 * 1024)
|
||||
@@ -34,10 +33,6 @@ struct _EvArchive {
|
||||
/* libarchive */
|
||||
struct archive *libar;
|
||||
struct archive_entry *libar_entry;
|
||||
-
|
||||
- /* unarr */
|
||||
- ar_stream *unarr_stream;
|
||||
- ar_archive *unarr;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(EvArchive, ev_archive, G_TYPE_OBJECT);
|
||||
@@ -49,13 +44,9 @@ ev_archive_finalize (GObject *object)
|
||||
|
||||
switch (archive->type) {
|
||||
case EV_ARCHIVE_TYPE_RAR:
|
||||
- g_clear_pointer (&archive->unarr, ar_close_archive);
|
||||
- g_clear_pointer (&archive->unarr_stream, ar_close);
|
||||
- break;
|
||||
case EV_ARCHIVE_TYPE_ZIP:
|
||||
case EV_ARCHIVE_TYPE_7Z:
|
||||
case EV_ARCHIVE_TYPE_TAR:
|
||||
- case EV_ARCHIVE_TYPE_RAR5:
|
||||
g_clear_pointer (&archive->libar, archive_free);
|
||||
break;
|
||||
default:
|
||||
@@ -92,9 +83,10 @@ libarchive_set_archive_type (EvArchive *archive,
|
||||
archive_read_support_format_7zip (archive->libar);
|
||||
else if (archive_type == EV_ARCHIVE_TYPE_TAR)
|
||||
archive_read_support_format_tar (archive->libar);
|
||||
- else if (archive_type == EV_ARCHIVE_TYPE_RAR5)
|
||||
+ else if (archive_type == EV_ARCHIVE_TYPE_RAR) {
|
||||
+ archive_read_support_format_rar (archive->libar);
|
||||
archive_read_support_format_rar5 (archive->libar);
|
||||
- else
|
||||
+ } else
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
@@ -115,12 +107,9 @@ ev_archive_set_archive_type (EvArchive *archive,
|
||||
|
||||
switch (archive_type) {
|
||||
case EV_ARCHIVE_TYPE_RAR:
|
||||
- archive->type = archive_type;
|
||||
- break;
|
||||
case EV_ARCHIVE_TYPE_ZIP:
|
||||
case EV_ARCHIVE_TYPE_7Z:
|
||||
case EV_ARCHIVE_TYPE_TAR:
|
||||
- case EV_ARCHIVE_TYPE_RAR5:
|
||||
libarchive_set_archive_type (archive, archive_type);
|
||||
break;
|
||||
default:
|
||||
@@ -136,7 +125,6 @@ ev_archive_open_filename (EvArchive *archive,
|
||||
GError **error)
|
||||
{
|
||||
int r;
|
||||
- ArArchiveError code;
|
||||
|
||||
g_return_val_if_fail (EV_IS_ARCHIVE (archive), FALSE);
|
||||
g_return_val_if_fail (archive->type != EV_ARCHIVE_TYPE_NONE, FALSE);
|
||||
@@ -146,28 +134,9 @@ ev_archive_open_filename (EvArchive *archive,
|
||||
case EV_ARCHIVE_TYPE_NONE:
|
||||
g_assert_not_reached ();
|
||||
case EV_ARCHIVE_TYPE_RAR:
|
||||
- archive->unarr_stream = ar_open_file (path);
|
||||
- if (archive->unarr_stream == NULL) {
|
||||
- g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
- "Error opening archive");
|
||||
- return FALSE;
|
||||
- }
|
||||
- archive->unarr = ar_open_rar_archive_with_error (archive->unarr_stream, &code);
|
||||
- if (archive->unarr == NULL) {
|
||||
- g_clear_pointer (&archive->unarr_stream, ar_close);
|
||||
- if (code == AR_ARCHIVE_ERROR_RAR5) {
|
||||
- libarchive_set_archive_type (archive, EV_ARCHIVE_TYPE_RAR5);
|
||||
- return ev_archive_open_filename (archive, path, error);
|
||||
- }
|
||||
- g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
- "Error opening RAR archive");
|
||||
- return FALSE;
|
||||
- }
|
||||
- return TRUE;
|
||||
case EV_ARCHIVE_TYPE_ZIP:
|
||||
case EV_ARCHIVE_TYPE_7Z:
|
||||
case EV_ARCHIVE_TYPE_TAR:
|
||||
- case EV_ARCHIVE_TYPE_RAR5:
|
||||
r = archive_read_open_filename (archive->libar, path, BUFFER_SIZE);
|
||||
if (r != ARCHIVE_OK) {
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
@@ -220,11 +189,9 @@ ev_archive_read_next_header (EvArchive *archive,
|
||||
case EV_ARCHIVE_TYPE_NONE:
|
||||
g_assert_not_reached ();
|
||||
case EV_ARCHIVE_TYPE_RAR:
|
||||
- return ar_parse_entry (archive->unarr);
|
||||
case EV_ARCHIVE_TYPE_ZIP:
|
||||
case EV_ARCHIVE_TYPE_7Z:
|
||||
case EV_ARCHIVE_TYPE_TAR:
|
||||
- case EV_ARCHIVE_TYPE_RAR5:
|
||||
return libarchive_read_next_header (archive, error);
|
||||
}
|
||||
|
||||
@@ -241,12 +208,9 @@ ev_archive_get_entry_pathname (EvArchive *archive)
|
||||
case EV_ARCHIVE_TYPE_NONE:
|
||||
g_assert_not_reached ();
|
||||
case EV_ARCHIVE_TYPE_RAR:
|
||||
- g_return_val_if_fail (archive->unarr != NULL, NULL);
|
||||
- return ar_entry_get_name (archive->unarr);
|
||||
case EV_ARCHIVE_TYPE_ZIP:
|
||||
case EV_ARCHIVE_TYPE_7Z:
|
||||
case EV_ARCHIVE_TYPE_TAR:
|
||||
- case EV_ARCHIVE_TYPE_RAR5:
|
||||
g_return_val_if_fail (archive->libar_entry != NULL, NULL);
|
||||
return archive_entry_pathname (archive->libar_entry);
|
||||
}
|
||||
@@ -261,15 +225,12 @@ ev_archive_get_entry_size (EvArchive *archive)
|
||||
g_return_val_if_fail (archive->type != EV_ARCHIVE_TYPE_NONE, -1);
|
||||
|
||||
switch (archive->type) {
|
||||
- case EV_ARCHIVE_TYPE_RAR:
|
||||
- g_return_val_if_fail (archive->unarr != NULL, -1);
|
||||
- return ar_entry_get_size (archive->unarr);
|
||||
case EV_ARCHIVE_TYPE_NONE:
|
||||
g_assert_not_reached ();
|
||||
+ case EV_ARCHIVE_TYPE_RAR:
|
||||
case EV_ARCHIVE_TYPE_ZIP:
|
||||
case EV_ARCHIVE_TYPE_7Z:
|
||||
case EV_ARCHIVE_TYPE_TAR:
|
||||
- case EV_ARCHIVE_TYPE_RAR5:
|
||||
g_return_val_if_fail (archive->libar_entry != NULL, -1);
|
||||
return archive_entry_size (archive->libar_entry);
|
||||
}
|
||||
@@ -284,16 +245,12 @@ ev_archive_get_entry_is_encrypted (EvArchive *archive)
|
||||
g_return_val_if_fail (archive->type != EV_ARCHIVE_TYPE_NONE, FALSE);
|
||||
|
||||
switch (archive->type) {
|
||||
- case EV_ARCHIVE_TYPE_RAR:
|
||||
- g_return_val_if_fail (archive->unarr != NULL, FALSE);
|
||||
- /* password-protected RAR is not even detected right now */
|
||||
- return FALSE;
|
||||
case EV_ARCHIVE_TYPE_NONE:
|
||||
g_assert_not_reached ();
|
||||
+ case EV_ARCHIVE_TYPE_RAR:
|
||||
case EV_ARCHIVE_TYPE_ZIP:
|
||||
case EV_ARCHIVE_TYPE_7Z:
|
||||
case EV_ARCHIVE_TYPE_TAR:
|
||||
- case EV_ARCHIVE_TYPE_RAR5:
|
||||
g_return_val_if_fail (archive->libar_entry != NULL, -1);
|
||||
return archive_entry_is_encrypted (archive->libar_entry);
|
||||
}
|
||||
@@ -313,21 +270,12 @@ ev_archive_read_data (EvArchive *archive,
|
||||
g_return_val_if_fail (archive->type != EV_ARCHIVE_TYPE_NONE, -1);
|
||||
|
||||
switch (archive->type) {
|
||||
- case EV_ARCHIVE_TYPE_RAR:
|
||||
- g_return_val_if_fail (archive->unarr != NULL, -1);
|
||||
- if (!ar_entry_uncompress (archive->unarr, buf, count)) {
|
||||
- g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
- "Failed to decompress RAR data");
|
||||
- return -1;
|
||||
- }
|
||||
- r = count;
|
||||
- break;
|
||||
case EV_ARCHIVE_TYPE_NONE:
|
||||
g_assert_not_reached ();
|
||||
+ case EV_ARCHIVE_TYPE_RAR:
|
||||
case EV_ARCHIVE_TYPE_ZIP:
|
||||
case EV_ARCHIVE_TYPE_7Z:
|
||||
case EV_ARCHIVE_TYPE_TAR:
|
||||
- case EV_ARCHIVE_TYPE_RAR5:
|
||||
g_return_val_if_fail (archive->libar_entry != NULL, -1);
|
||||
r = archive_read_data (archive->libar, buf, count);
|
||||
if (r < 0) {
|
||||
@@ -348,13 +296,9 @@ ev_archive_reset (EvArchive *archive)
|
||||
|
||||
switch (archive->type) {
|
||||
case EV_ARCHIVE_TYPE_RAR:
|
||||
- g_clear_pointer (&archive->unarr, ar_close_archive);
|
||||
- g_clear_pointer (&archive->unarr_stream, ar_close);
|
||||
- break;
|
||||
case EV_ARCHIVE_TYPE_ZIP:
|
||||
case EV_ARCHIVE_TYPE_7Z:
|
||||
case EV_ARCHIVE_TYPE_TAR:
|
||||
- case EV_ARCHIVE_TYPE_RAR5:
|
||||
g_clear_pointer (&archive->libar, archive_free);
|
||||
libarchive_set_archive_type (archive, archive->type);
|
||||
break;
|
||||
diff --git a/backend/comics/ev-archive.h b/backend/comics/ev-archive.h
|
||||
index 0b84d82c..94623434 100644
|
||||
--- a/backend/comics/ev-archive.h
|
||||
+++ b/backend/comics/ev-archive.h
|
||||
@@ -29,7 +29,6 @@ G_DECLARE_FINAL_TYPE (EvArchive, ev_archive, EV, ARCHIVE, GObject)
|
||||
typedef enum {
|
||||
EV_ARCHIVE_TYPE_NONE = 0,
|
||||
EV_ARCHIVE_TYPE_RAR,
|
||||
- EV_ARCHIVE_TYPE_RAR5,
|
||||
EV_ARCHIVE_TYPE_ZIP,
|
||||
EV_ARCHIVE_TYPE_7Z,
|
||||
EV_ARCHIVE_TYPE_TAR
|
||||
diff --git a/backend/comics/meson.build b/backend/comics/meson.build
|
||||
index 1e740194..c245b1ba 100644
|
||||
--- a/backend/comics/meson.build
|
||||
+++ b/backend/comics/meson.build
|
||||
@@ -7,7 +7,6 @@ incs = backends_incs + [cut_n_paste_inc]
|
||||
|
||||
deps = backends_deps + [
|
||||
libarchive_dep,
|
||||
- libunarr_dep,
|
||||
]
|
||||
|
||||
shared_module(
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 442a2566..87d710a7 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -349,7 +349,7 @@ else
|
||||
endif
|
||||
|
||||
# *** Comic Book ***
|
||||
-libarchive_req_version = '>= 3.2.0'
|
||||
+libarchive_req_version = '>= 3.6.0'
|
||||
libarchive_dep = dependency('libarchive', version: libarchive_req_version, required: get_option('comics'))
|
||||
enable_comics = libarchive_dep.found()
|
||||
if enable_comics
|
||||
--
|
||||
2.35.1
|
||||
|
7784
0002-unarr-Remove-obsolete-unarr-copy-paste.patch
Normal file
7784
0002-unarr-Remove-obsolete-unarr-copy-paste.patch
Normal file
File diff suppressed because it is too large
Load Diff
11
evince-42-poppler-requirement-decrease.patch
Normal file
11
evince-42-poppler-requirement-decrease.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- evince-42.rc/meson.build
|
||||
+++ evince-42.rc/meson.build
|
||||
@@ -399,7 +399,7 @@ elif get_option('dvi').auto()
|
||||
endif
|
||||
|
||||
# *** PDF ***
|
||||
-poppler_req_version = '>= 22.02.0'
|
||||
+poppler_req_version = '>= 22.01.0'
|
||||
poppler_glib_dep = dependency('poppler-glib', version: poppler_req_version, required: get_option('pdf'))
|
||||
|
||||
libxml_req_version = '>= 2.5.0'
|
25
evince.spec
25
evince.spec
@ -2,8 +2,8 @@
|
||||
%global __provides_exclude_from ^%{_libdir}/evince/
|
||||
%global __requires_exclude ^(%%(find %{buildroot}%{_libdir}/evince/ -name '*.so' | xargs -n1 basename | sort -u | paste -s -d '|' -))
|
||||
|
||||
%global libarchive_version 3.6.0
|
||||
%global poppler_version 22.02.0
|
||||
%global libarchive_version 3.5.3
|
||||
%global poppler_version 22.01.0
|
||||
|
||||
%global tarball_version %%(echo %{version} | tr '~' '.')
|
||||
|
||||
@ -16,6 +16,10 @@ License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse
|
||||
URL: https://wiki.gnome.org/Apps/Evince
|
||||
Source0: https://download.gnome.org/sources/%{name}/42/%{name}-%{tarball_version}.tar.xz
|
||||
|
||||
Patch0: evince-42-poppler-requirement-decrease.patch
|
||||
Patch1: 0002-unarr-Remove-obsolete-unarr-copy-paste.patch
|
||||
Patch2: 0001-comics-Use-libarchive-for-RAR-support.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gettext-devel
|
||||
BuildRequires: pkgconfig(adwaita-icon-theme)
|
||||
@ -135,7 +139,10 @@ This package brings the Evince previewer independently from Evince.
|
||||
It provides the printing preview for the GTK printing dialog.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{name}-%{tarball_version}
|
||||
%setup -q -n %{name}-%{tarball_version}
|
||||
%patch0 -p1 -b .decrease-poppler-requirement
|
||||
%patch1 -p1 -R -b .bring-back-unarr
|
||||
%patch2 -p1 -R -b .use-unarr
|
||||
|
||||
%build
|
||||
%meson \
|
||||
@ -153,7 +160,6 @@ It provides the printing preview for the GTK printing dialog.
|
||||
-Ddjvu=disabled \
|
||||
%endif
|
||||
-Dxps=enabled \
|
||||
-Dt1lib=disabled \
|
||||
%if 0%{?flatpak}
|
||||
-Dsystemduserunitdir=no \
|
||||
-Dnautilus=false \
|
||||
@ -226,9 +232,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Evince-p
|
||||
%{_libdir}/girepository-1.0/EvinceView-3.0.typelib
|
||||
|
||||
%files devel
|
||||
%{_datadir}/gtk-doc/html/evince/
|
||||
%{_datadir}/gtk-doc/html/libevview-3.0
|
||||
%{_datadir}/gtk-doc/html/libevdocument-3.0
|
||||
%{_datadir}/doc/evince-libs
|
||||
%{_datadir}/doc/libevview
|
||||
%{_datadir}/doc/libevdocument
|
||||
%dir %{_includedir}/evince
|
||||
%{_includedir}/evince/3.0
|
||||
%{_libdir}/libevview3.so
|
||||
@ -267,6 +273,11 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Evince-p
|
||||
%{_mandir}/man1/evince-previewer.1*
|
||||
|
||||
%changelog
|
||||
* Wed Mar 16 2022 Marek Kasik <mkasik@redhat.com> - 42~rc-1
|
||||
- Decrease required version of poppler to 22.01.0
|
||||
- Change doc path
|
||||
- Revert removal of unarr as libarchive 3.6.0 is not in Fedora 36
|
||||
|
||||
* Mon Mar 07 2022 David King <amigadave@amigadave.com> - 42~rc-1
|
||||
- Update to 42.rc
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user