From 44a66d3ca3290483fda0727a83bb453c9c3f61af Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Thu, 14 Mar 2024 09:12:27 +0100 Subject: [PATCH] evince: update to 45.0 --- mingw-w64-evince/0002-missing-include.patch | 10 --- .../0003-mingw-dont-have-fcntl.patch | 68 ++++++++++++++++++- .../0005-previewer-unix-prin-only.patch | 13 ---- mingw-w64-evince/0007-meson-fixes.patch | 66 ------------------ .../0008-disable-pdf-document-load-fd.patch | 29 ++++++++ mingw-w64-evince/PKGBUILD | 33 ++++----- 6 files changed, 109 insertions(+), 110 deletions(-) delete mode 100644 mingw-w64-evince/0002-missing-include.patch delete mode 100644 mingw-w64-evince/0005-previewer-unix-prin-only.patch delete mode 100644 mingw-w64-evince/0007-meson-fixes.patch create mode 100644 mingw-w64-evince/0008-disable-pdf-document-load-fd.patch diff --git a/mingw-w64-evince/0002-missing-include.patch b/mingw-w64-evince/0002-missing-include.patch deleted file mode 100644 index f6247fb1efaf3..0000000000000 --- a/mingw-w64-evince/0002-missing-include.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- evince-3.18.0/backend/pdf/ev-poppler.cc.orig 2015-09-25 12:25:31.343557800 +0300 -+++ evince-3.18.0/backend/pdf/ev-poppler.cc 2015-09-25 12:25:48.411850800 +0300 -@@ -23,6 +23,7 @@ - - #include - #include -+#include - #include - #include - #include diff --git a/mingw-w64-evince/0003-mingw-dont-have-fcntl.patch b/mingw-w64-evince/0003-mingw-dont-have-fcntl.patch index 03ccc2284f1b6..d472b5bc6c0c6 100644 --- a/mingw-w64-evince/0003-mingw-dont-have-fcntl.patch +++ b/mingw-w64-evince/0003-mingw-dont-have-fcntl.patch @@ -1,6 +1,6 @@ -diff -Naur evince-3.32.0-orig/libdocument/ev-file-helpers.c evince-3.32.0/libdocument/ev-file-helpers.c ---- evince-3.32.0-orig/libdocument/ev-file-helpers.c 2019-01-31 06:03:59.000000000 +0300 -+++ evince-3.32.0/libdocument/ev-file-helpers.c 2019-06-11 22:40:13.048270000 +0300 +diff -Naur evince-45.0-orig/libdocument/ev-file-helpers.c evince-45.0/libdocument/ev-file-helpers.c +--- evince-45.0-orig/libdocument/ev-file-helpers.c 2019-01-31 06:03:59.000000000 +0300 ++++ evince-45.0/libdocument/ev-file-helpers.c 2019-06-11 22:40:13.048270000 +0300 @@ -39,6 +39,10 @@ #define O_BINARY 0 #endif @@ -40,3 +40,65 @@ diff -Naur evince-3.32.0-orig/libdocument/ev-file-helpers.c evince-3.32.0/libdoc NULL, NULL, &pout, NULL, &err)) { GIOChannel *in, *out; +diff -Naur evince-45.0-orig/libdocument/ev-document.c evince-45.0/libdocument/ev-document.c +--- evince-45.0-orig/libdocument/ev-document.c 2019-01-31 06:03:59.000000000 +0300 ++++ evince-45.0/libdocument/ev-document.c 2019-06-11 22:40:13.048270000 +0300 +@@ -595,8 +595,12 @@ ev_document_load_fd (EvDocument *document, + return FALSE; + } + ++#ifdef G_OS_WIN32 ++ if (fstat(fd, &statbuf) == -1) { ++#else + if (fstat(fd, &statbuf) == -1 || + (fd_flags = fcntl (fd, F_GETFL, &flags)) == -1) { ++#endif + int errsv = errno; + g_set_error_literal (error, G_FILE_ERROR, + g_file_error_from_errno (errsv), +diff -Naur evince-45.0-orig/libview/ev-jobs.c evince-45.0/libview/ev-jobs.c +--- evince-45.0-orig/libview/ev-jobs.c 2019-01-31 06:03:59.000000000 +0300 ++++ evince-45.0/libview/ev-jobs.c 2019-06-11 22:40:13.048270000 +0300 +@@ -1458,7 +1458,11 @@ ev_dupfd (int fd, + { + int new_fd; + ++#ifdef G_OS_WIN32 ++ new_fd = -1; ++#else + new_fd = fcntl (fd, F_DUPFD_CLOEXEC, 3); ++#endif + if (new_fd == -1) { + int errsv = errno; + g_set_error_literal (error, G_FILE_ERROR, g_file_error_from_errno (errsv), +diff -Naur evince-45.0-orig/previewer/ev-previewer-window.c evince-45.0/previewer/ev-previewer-window.c +--- evince-45.0-orig/previewer/ev-previewer-window.c 2019-01-31 06:03:59.000000000 +0300 ++++ evince-45.0/previewer/ev-previewer-window.c 2019-06-11 22:40:13.048270000 +0300 +@@ -648,7 +648,11 @@ ev_previewer_window_set_source_fd (EvPreviewerWindow *window, + g_return_val_if_fail (EV_IS_PREVIEWER_WINDOW (window), FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + ++#ifdef G_OS_WIN32 ++ nfd = -1; ++#else + nfd = fcntl (fd, F_DUPFD_CLOEXEC, 3); ++#endif + if (nfd == -1) { + int errsv = errno; + g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv), +diff -Naur evince-45.0-orig/previewer/ev-previewer.c evince-45.0/previewer/ev-previewer.c +--- evince-45.0-orig/previewer/ev-previewer.c 2019-01-31 06:03:59.000000000 +0300 ++++ evince-45.0/previewer/ev-previewer.c 2019-06-11 22:40:13.048270000 +0300 +@@ -166,8 +166,12 @@ check_arguments (int argc, + struct stat statbuf; + int flags; + ++#ifdef G_OS_WIN32 ++ if (fstat (input_fd, &statbuf) == -1 ) { ++#else + if (fstat (input_fd, &statbuf) == -1 || + (flags = fcntl (input_fd, F_GETFL, &flags)) == -1) { ++#endif + int errsv = errno; + g_set_error_literal (error, G_FILE_ERROR, + g_file_error_from_errno(errsv), diff --git a/mingw-w64-evince/0005-previewer-unix-prin-only.patch b/mingw-w64-evince/0005-previewer-unix-prin-only.patch deleted file mode 100644 index fc93a7dc63158..0000000000000 --- a/mingw-w64-evince/0005-previewer-unix-prin-only.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -Naur evince-3.32.0-orig/previewer/ev-previewer-window.c evince-3.32.0/previewer/ev-previewer-window.c ---- evince-3.32.0-orig/previewer/ev-previewer-window.c 2019-02-09 06:36:23.000000000 +0300 -+++ evince-3.32.0/previewer/ev-previewer-window.c 2019-06-12 00:13:30.339416700 +0300 -@@ -272,7 +272,9 @@ - #endif - - static const GActionEntry actions[] = { -+#if GTKUNIXPRINT_ENABLED - { "print", ev_previewer_window_print }, -+#endif - { "go-previous-page", ev_previewer_window_previous_page }, - { "go-next-page", ev_previewer_window_next_page }, - { "select-page", ev_previewer_window_focus_page_selector }, diff --git a/mingw-w64-evince/0007-meson-fixes.patch b/mingw-w64-evince/0007-meson-fixes.patch deleted file mode 100644 index 34b837ac6a940..0000000000000 --- a/mingw-w64-evince/0007-meson-fixes.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff -Nur evince-3.36.0-orig/libview/meson.build evince-3.36.0/libview/meson.build ---- evince-3.36.0-orig/libview/meson.build 2019-09-29 20:04:36.000000000 +0200 -+++ evince-3.36.0/libview/meson.build 2020-05-28 17:50:37.649911000 +0200 -@@ -64,12 +64,15 @@ - gstreamer_base_dep, - gstreamer_dep, - gstreamer_video_dep, -- gtk_unix_print_dep, - gthread_dep, - libevdocument_dep, - m_dep, - ] - -+if enable_gtk_unix_print -+ deps += gtk_unix_print_dep -+endif -+ - cflags = [ - '-DG_LOG_DOMAIN="EvinceView"', - '-DEVINCEDATADIR="@0@"'.format(ev_pkgdatadir), -diff -Nur evince-3.36.0-orig/meson.build evince-3.36.0/meson.build ---- evince-3.36.0-orig/meson.build 2020-03-07 03:53:56.000000000 +0100 -+++ evince-3.36.0/meson.build 2020-05-28 18:33:49.555574700 +0200 -@@ -103,8 +103,7 @@ - - if build_machine.system() == 'windows' - common_flags += '-D_WIN32_WINNT=0x0500' -- -- common_ldflags = cc.get_supported_link_arguments('-mwindows') -+ common_ldflags += '-lshlwapi' - endif - - if ev_debug -@@ -124,7 +123,7 @@ - add_project_arguments(common_flags, language: 'c') - - lib_symbol_map = join_paths(meson.current_source_dir(), 'lib-symbol.map') --lib_ldflags = cc.get_supported_link_arguments('-Wl,--version-script,' + lib_symbol_map) -+lib_ldflags = common_ldflags + cc.get_supported_link_arguments('-Wl,--version-script,' + lib_symbol_map) - - gnome = import('gnome') - i18n = import('i18n') -diff -Nur evince-3.36.0-orig/shell/meson.build evince-3.36.0/shell/meson.build ---- evince-3.36.0-orig/shell/meson.build 2020-02-15 14:28:25.000000000 +0100 -+++ evince-3.36.0/shell/meson.build 2020-05-28 18:33:56.647578700 +0200 -@@ -82,15 +82,11 @@ - - ldflags = common_ldflags - --if ev_platform == 'win32' -- resource = 'evince-icon.o' -- -- ldflag += custom_target( -- resource, -- input: 'evince-icon.rc', -- output: resource, -- command: [find_program('windres'), '@INPUT@', '-I', data_dir, '@OUTPUT@'], -- ) -+if build_machine.system() == 'windows' -+ sources += import('windows').compile_resources( -+ 'evince-icon.rc', -+ include_directories : include_directories('../data')) -+ ldflags += cc.get_supported_link_arguments('-mwindows') - else - deps += adwaita_icon_theme_dep - endif diff --git a/mingw-w64-evince/0008-disable-pdf-document-load-fd.patch b/mingw-w64-evince/0008-disable-pdf-document-load-fd.patch new file mode 100644 index 0000000000000..0af4e37e4a026 --- /dev/null +++ b/mingw-w64-evince/0008-disable-pdf-document-load-fd.patch @@ -0,0 +1,29 @@ +diff -Naur evince-45.0-orig/backend/pdf/ev-poppler.c evince-45.0/backend/pdf/ev-poppler.c +--- evince-45.0-orig/backend/pdf/ev-poppler.c 2019-01-31 06:03:59.000000000 +0300 ++++ evince-45.0/backend/pdf/ev-poppler.c 2019-06-11 22:40:13.048270000 +0300 +@@ -315,6 +315,7 @@ pdf_document_load_gfile (EvDocument *document, + return TRUE; + } + ++#ifndef G_OS_WIN32 + static gboolean + pdf_document_load_fd (EvDocument *document, + int fd, +@@ -338,6 +339,7 @@ pdf_document_load_fd (EvDocument *document, + + return TRUE; + } ++#endif + + static int + pdf_document_get_n_pages (EvDocument *document) +@@ -788,7 +790,9 @@ pdf_document_class_init (PdfDocumentClass *klass) + ev_document_class->get_info = pdf_document_get_info; + ev_document_class->get_backend_info = pdf_document_get_backend_info; + ev_document_class->support_synctex = pdf_document_support_synctex; ++#ifndef G_OS_WIN32 + ev_document_class->load_fd = pdf_document_load_fd; ++#endif + } + + /* EvDocumentSecurity */ diff --git a/mingw-w64-evince/PKGBUILD b/mingw-w64-evince/PKGBUILD index e1d8595c15348..7d9715b0461ba 100644 --- a/mingw-w64-evince/PKGBUILD +++ b/mingw-w64-evince/PKGBUILD @@ -3,8 +3,8 @@ _realname=evince pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=3.38.0 -pkgrel=6 +pkgver=45.0 +pkgrel=1 arch=('any') mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') pkgdesc="Document (PostScript, PDF) viewer (mingw-w64)" @@ -31,43 +31,40 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-meson" "${MINGW_PACKAGE_PREFIX}-ninja" "${MINGW_PACKAGE_PREFIX}-pkgconf" + "${MINGW_PACKAGE_PREFIX}-desktop-file-utils" "${MINGW_PACKAGE_PREFIX}-gettext-tools" "${MINGW_PACKAGE_PREFIX}-gobject-introspection" "${MINGW_PACKAGE_PREFIX}-gtk-doc" "${MINGW_PACKAGE_PREFIX}-itstool" + "${MINGW_PACKAGE_PREFIX}-libhandy" "${MINGW_PACKAGE_PREFIX}-yelp-tools") source=(https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz - 0002-missing-include.patch 0003-mingw-dont-have-fcntl.patch - 0005-previewer-unix-prin-only.patch - 0007-meson-fixes.patch - https://gitlab.gnome.org/GNOME/evince/-/commit/1060b24d051607f14220f148d2f7723b29897a54.patch) -sha256sums=('26df897a417545b476d2606b14731122e84278ae994bd64ea535449c3cf01948' - 'd2850c4bdfa87fa56bae2674d2c798f9181bfb3f19319fbc9966672caae48237' - '035f9cd952daa040d32309398b73022d199e27fed756126eb15663fb6a435c45' - '4e6a1ae77d36f0b36ea68ec2cc3abe4a706355ba02e4066d1b9add138052ba1b' - 'b15ad558c060a62c03e54cb08696f859485708d29e317bd6e7d163cac0cfd368' - '25e5df47c3e0f190244b55018d31f1adadc86c0c241b21e06199d656e36e778a') + 0008-disable-pdf-document-load-fd.patch) +sha256sums=('d18647d4275cbddf0d32817b1d04e307342a85be914ec4dad2d8082aaf8aa4a8' + '5c011fb1dec0564dcea06d145a2cc3572641dcd021477eb1172ecddd9cacbffd' + 'f9e2010366f9185e1f6a18b9ac7207c792d970fd1636b3f3bd329f58259cf89e') +noextract=(${_realname}-${pkgver}.tar.xz) prepare() { - cd "${srcdir}"/${_realname}-${pkgver} + cd "${srcdir}" + plain "Extracting ${_realname}-${pkgver}.tar.xz due to symlink(s) without pre-existing target(s)" + tar -xJf ${srcdir}/${_realname}-${pkgver}.tar.xz -C ${srcdir} || true + cd ${_realname}-${pkgver} - patch -p1 -i ${srcdir}/0002-missing-include.patch patch -p1 -i ${srcdir}/0003-mingw-dont-have-fcntl.patch - patch -p1 -i ${srcdir}/0005-previewer-unix-prin-only.patch - patch -p1 -i ${srcdir}/0007-meson-fixes.patch - patch -p1 -i ${srcdir}/1060b24d051607f14220f148d2f7723b29897a54.patch + patch -p1 -i ${srcdir}/0008-disable-pdf-document-load-fd.patch } build() { mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM} + CFLAGS+=" -Wno-implicit-function-declaration" \ MSYS2_ARG_CONV_EXCL="--prefix=" \ ${MINGW_PREFIX}/bin/meson \ --prefix=${MINGW_PREFIX} \ --buildtype=plain \ -Dplatform=win32 \ - -Dbrowser_plugin=false \ -Ddbus=false \ -Dnautilus=false \ -Dgtk_doc=false \