Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package zathura-plugin-pdf-mupdf for
openSUSE:Factory checked in at 2026-05-29 18:11:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/zathura-plugin-pdf-mupdf (Old)
and /work/SRC/openSUSE:Factory/.zathura-plugin-pdf-mupdf.new.1937 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "zathura-plugin-pdf-mupdf"
Fri May 29 18:11:07 2026 rev:15 rq:1355839 version:2026.05.10
Changes:
--------
---
/work/SRC/openSUSE:Factory/zathura-plugin-pdf-mupdf/zathura-plugin-pdf-mupdf.changes
2025-11-20 14:50:31.110732394 +0100
+++
/work/SRC/openSUSE:Factory/.zathura-plugin-pdf-mupdf.new.1937/zathura-plugin-pdf-mupdf.changes
2026-05-29 18:12:46.788567463 +0200
@@ -1,0 +2,25 @@
+Fri May 29 09:02:49 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Cleanup spec file with spec-cleaner
+- Drop unused (already disabled) patches:
+ * 0001-Don-t-link-against-gumbo.patch
+ * 0002-Revert-Rework-detection-of-mupdf.patch
+
+-------------------------------------------------------------------
+Wed May 27 08:11:21 UTC 2026 - Андрей Алыпов <[email protected]>
+
+- Update to version 2026.05.10:
+ * Various bug fixes and improvements
+- Added zathura-pdf-mupdf.keyring
+- Updates from version 2026.02.03:
+ * Update for changes in girara
+- Updates from version 2026.01.30:
+ * Various bug fixes and improvements
+- Updates from version 0.4.6:
+ * Upgrade to mupdf 1.26
+ * Add support for user-provided CSS styles
+ * Add support for attachment export
+ * Various fixes and improvements
+- Add 0001-Don-t-link-against-gumbo.patch
+
+-------------------------------------------------------------------
Old:
----
0001-Don-t-link-against-gumbo.patch
0002-Revert-Rework-detection-of-mupdf.patch
zathura-pdf-mupdf-0.4.4.tar.xz
New:
----
zathura-pdf-mupdf-2026.05.10.tar.xz
zathura-pdf-mupdf-2026.05.10.tar.xz.asc
zathura-pdf-mupdf.keyring
----------(Old B)----------
Old:- Drop unused (already disabled) patches:
* 0001-Don-t-link-against-gumbo.patch
* 0002-Revert-Rework-detection-of-mupdf.patch
Old: * 0001-Don-t-link-against-gumbo.patch
* 0002-Revert-Rework-detection-of-mupdf.patch
----------(Old E)----------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ zathura-plugin-pdf-mupdf.spec ++++++
--- /var/tmp/diff_new_pack.oAl0PN/_old 2026-05-29 18:12:47.676604411 +0200
+++ /var/tmp/diff_new_pack.oAl0PN/_new 2026-05-29 18:12:47.676604411 +0200
@@ -1,7 +1,7 @@
#
# spec file for package zathura-plugin-pdf-mupdf
#
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,51 +17,54 @@
%define realname zathura-pdf-mupdf
+%if 0%{?suse_version} == 1600
+%bcond_without gcc15
+%endif
Name: zathura-plugin-pdf-mupdf
-Version: 0.4.4
+Version: 2026.05.10
Release: 0
Summary: Zathura PDF support through MuPDF
License: Zlib
-Group: Productivity/Office/Other
-URL: https://pwmt.org/projects/zathura-pdf-mupdf/
-Source:
https://pwmt.org/projects/%{realname}/download/%{realname}-%{version}.tar.xz
-Patch1: 0001-Don-t-link-against-gumbo.patch
-Patch2: 0002-Revert-Rework-detection-of-mupdf.patch
+URL: https://pwmt.org/projects/zathura-pdf-mupdf
+Source0: %{url}/download/%{realname}-%{version}.tar.xz
+Source1: %{url}/download/%{realname}-%{version}.tar.xz.asc
+Source2: %{realname}.keyring
+BuildRequires: AppStream
+BuildRequires: c_compiler
BuildRequires: cmake
-BuildRequires: meson >= 0.61
-BuildRequires: mupdf-devel-static >= 1.24
+BuildRequires: desktop-file-utils
+BuildRequires: meson >= 1.5
+BuildRequires: mupdf-devel-static >= 1.26
BuildRequires: pkgconfig
BuildRequires: pkgconfig(cairo)
-BuildRequires: pkgconfig(girara-gtk3)
-%if 0%{?suse_version} > 1500
-BuildRequires: pkgconfig(jbig2dec)
-%else
-BuildRequires: jbig2dec-devel
-%endif
-BuildRequires: pkgconfig(lept)
-BuildRequires: pkgconfig(libcurl)
-BuildRequires: pkgconfig(libjpeg)
-BuildRequires: pkgconfig(libopenjp2)
-BuildRequires: pkgconfig(tesseract)
-BuildRequires: pkgconfig(zathura) >= 0.5.2
-Requires: mupdf >= 1.24
-Requires: zathura >= 0.5.2
+BuildRequires: pkgconfig(girara)
+BuildRequires: pkgconfig(glib-2.0)
+BuildRequires: pkgconfig(zathura) >= 2026.01.30
+Requires: mupdf >= 1.26
+Requires: zathura >= 2026.01.30
Conflicts: zathura-plugin-pdf-poppler
-Provides: zathura-pdf-mupdf-plugin
+Provides: %{realname}-plugin
+%if %{with gcc15}
+BuildRequires: gcc15
+%endif
%description
-Zathura-plugin-MupDF extends the document viewing support of Zathura to PDF,
EPUB and OpenXPS with the help of MuPDF rendering engine.
+Zathura-plugin-MupDF extends the document viewing support of Zathura to
+PDF, EPUB and OpenXPS with the help of MuPDF rendering engine.
%prep
%autosetup -p1 -n %{realname}-%{version}
%build
-export CFLAGS="%{optflags}"
-%meson -Dlink-external=true -Dtests=disabled
+%{?with_gcc15:export CC=gcc-15}
+%meson
%meson_build
%install
%meson_install
+
+%check
+%meson_test
find %{buildroot} -name '*.desktop' -delete -print
%files -n %{name}
@@ -69,5 +72,5 @@
%doc AUTHORS
%dir %{_libdir}/zathura
%{_libdir}/zathura/libpdf-mupdf.so
-%{_datadir}/metainfo/org.pwmt.zathura-pdf-mupdf.metainfo.xml
+%{_datadir}/metainfo/org.pwmt.%{realname}.metainfo.xml
++++++ zathura-pdf-mupdf-0.4.4.tar.xz -> zathura-pdf-mupdf-2026.05.10.tar.xz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/.github/dependabot.yml
new/zathura-pdf-mupdf-2026.05.10/.github/dependabot.yml
--- old/zathura-pdf-mupdf-0.4.4/.github/dependabot.yml 1970-01-01
01:00:00.000000000 +0100
+++ new/zathura-pdf-mupdf-2026.05.10/.github/dependabot.yml 2026-05-10
13:47:32.000000000 +0200
@@ -0,0 +1,6 @@
+version: 2
+updates:
+- package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/.github/workflows/build.yaml
new/zathura-pdf-mupdf-2026.05.10/.github/workflows/build.yaml
--- old/zathura-pdf-mupdf-0.4.4/.github/workflows/build.yaml 1970-01-01
01:00:00.000000000 +0100
+++ new/zathura-pdf-mupdf-2026.05.10/.github/workflows/build.yaml
2026-05-10 13:47:32.000000000 +0200
@@ -0,0 +1,119 @@
+name: CI
+
+on:
+ push:
+ pull_request:
+
+env:
+ VERBOSE: 1
+
+jobs:
+ clang-format:
+ name: Check clang-format output
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/pwmt/github-actions-debian:forky
+ credentials:
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v6
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/girara
+ path: girara
+ - name: Install girara
+ run: |
+ mkdir girara/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu girara/build
girara
+ ninja --verbose -C girara/build install
+ rm -rf girara
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/zathura
+ path: zathura
+ - name: Install zathura
+ run: |
+ mkdir zathura/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu
zathura/build zathura
+ ninja --verbose -C zathura/build install
+ rm -rf zathura
+ - name: Build and test
+ run: |
+ mkdir build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu build .
+ ninja -C build clang-format-check
+
+ build-test-debian-forky:
+ name: Test on Debian forky
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/pwmt/github-actions-debian:forky
+ credentials:
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v6
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/girara
+ path: girara
+ - name: Install girara
+ run: |
+ mkdir girara/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu girara/build
girara
+ ninja --verbose -C girara/build install
+ rm -rf girara
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/zathura
+ path: zathura
+ - name: Install zathura
+ run: |
+ mkdir zathura/build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu
zathura/build zathura
+ ninja --verbose -C zathura/build install
+ rm -rf zathura
+ - name: Build and test
+ run: |
+ mkdir build
+ meson setup --prefix /usr --libdir=lib/x86_64-linux-gnu build .
+ ninja -C build --verbose
+ ninja -C build test --verbose
+
+ build-test-archlinux:
+ name: Test on Archlinux
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/pwmt/github-actions-archlinux:latest
+ credentials:
+ username: ${{ github.actor }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+ steps:
+ - uses: actions/checkout@v6
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/girara
+ path: girara
+ - name: Install girara
+ run: |
+ mkdir girara/build
+ meson setup --prefix /usr girara/build girara
+ ninja --verbose -C girara/build install
+ rm -rf girara
+ - uses: actions/checkout@v6
+ with:
+ repository: pwmt/zathura
+ path: zathura
+ - name: Install zathura
+ run: |
+ mkdir zathura/build
+ meson setup --prefix /usr zathura/build zathura
+ ninja --verbose -C zathura/build install
+ rm -rf zathura
+ - name: Build and test
+ run: |
+ mkdir build
+ meson setup --prefix /usr build .
+ ninja -C build --verbose
+ ninja -C build test --verbose
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/README.md
new/zathura-pdf-mupdf-2026.05.10/README.md
--- old/zathura-pdf-mupdf-0.4.4/README.md 2024-08-04 10:34:58.000000000
+0200
+++ new/zathura-pdf-mupdf-2026.05.10/README.md 2026-05-10 13:47:32.000000000
+0200
@@ -10,13 +10,13 @@
The following dependencies are required:
-* `zathura` (>= 0.2.0)
+* `zathura` (>= 2026.01.30)
* `girara`
-* `mupdf` (>= 1.24.0)
+* `mupdf` (>= 1.26)
For building plugin, the following dependencies are also required:
-* `meson` (>= 0.61)
+* `meson` (>= 1)
Installation
------------
@@ -28,9 +28,12 @@
ninja
ninja install
-Note that the default backend for meson might vary based on the platform.
Please
+> **Note:** The default backend for meson might vary based on the platform.
Please
refer to the meson documentation for platform specific dependencies.
+> **Note:** To avoid conflicts with `zathura-pdf-poppler`, PDF support can be
disabled
+at compile time by using `meson build -Dpdf=disabled` instead of `meson build`.
+
Bugs
----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/data/meson.build
new/zathura-pdf-mupdf-2026.05.10/data/meson.build
--- old/zathura-pdf-mupdf-0.4.4/data/meson.build 2024-08-04
10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/data/meson.build 2026-05-10
13:47:32.000000000 +0200
@@ -1,18 +1,36 @@
install_data('org.pwmt.zathura-pdf-mupdf.metainfo.xml', install_dir:
metainfodir)
-install_data('org.pwmt.zathura-pdf-mupdf.desktop', install_dir: desktopdir)
+
+conf_data = configuration_data()
+pdf = ''
+if get_option('pdf').enabled()
+ conf_data.set(
+ 'PDF',
+ 'application/pdf;'
+ )
+else
+ conf_data.set('PDF', '')
+endif
+
+desktop = configure_file(
+ input: join_paths(meson.current_source_dir(),
'org.pwmt.zathura-pdf-mupdf.desktop'),
+ output: 'org.pwmt.zathura-pdf-mupdf.desktop',
+ configuration: conf_data,
+)
+
+install_data(desktop, install_dir: desktopdir)
desktop_file_validate = find_program('desktop-file-validate', required:
get_option('tests'), native: true)
if desktop_file_validate.found()
test('validate-desktop',
desktop_file_validate,
- args: [join_paths(meson.current_source_dir(),
'org.pwmt.zathura-pdf-mupdf.desktop')]
+ args: [desktop]
)
endif
-appstream_util = find_program('appstream-util', required: get_option('tests'),
native: true)
+appstream_util = find_program('appstreamcli', required: get_option('tests'),
native: true)
if appstream_util.found()
test('validate-appdata',
appstream_util,
- args: ['validate-relax', '--nonet', join_paths(meson.current_source_dir(),
'org.pwmt.zathura-pdf-mupdf.metainfo.xml')]
+ args: ['validate', '--no-net', join_paths(meson.current_source_dir(),
'org.pwmt.zathura-pdf-mupdf.metainfo.xml')]
)
endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zathura-pdf-mupdf-0.4.4/data/org.pwmt.zathura-pdf-mupdf.desktop
new/zathura-pdf-mupdf-2026.05.10/data/org.pwmt.zathura-pdf-mupdf.desktop
--- old/zathura-pdf-mupdf-0.4.4/data/org.pwmt.zathura-pdf-mupdf.desktop
2024-08-04 10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/data/org.pwmt.zathura-pdf-mupdf.desktop
2026-05-10 13:47:32.000000000 +0200
@@ -8,4 +8,4 @@
Terminal=false
NoDisplay=true
Categories=Office;Viewer;
-MimeType=application/pdf;application/oxps;application/epub+zip;application/x-fictionbook;
+MimeType=@PDF@application/oxps;application/epub+zip;application/x-fictionbook;application/x-mobipocket-ebook;image/svg+xml;image/jpeg;image/png;image/bmp;image/x-bmp;image/tiff;image/tiff-fx;
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zathura-pdf-mupdf-0.4.4/data/org.pwmt.zathura-pdf-mupdf.metainfo.xml
new/zathura-pdf-mupdf-2026.05.10/data/org.pwmt.zathura-pdf-mupdf.metainfo.xml
--- old/zathura-pdf-mupdf-0.4.4/data/org.pwmt.zathura-pdf-mupdf.metainfo.xml
2024-08-04 10:34:58.000000000 +0200
+++
new/zathura-pdf-mupdf-2026.05.10/data/org.pwmt.zathura-pdf-mupdf.metainfo.xml
2026-05-10 13:47:32.000000000 +0200
@@ -4,9 +4,23 @@
<id>org.pwmt.zathura-pdf-mupdf</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>Zlib</project_license>
+ <developer id="org.pwmt">
+ <name>pwmt</name>
+ </developer>
<extends>org.pwmt.zathura</extends>
<name>Zathura-PDF-MuPDF</name>
<summary>PDF plugin for zathura based on MuPDF</summary>
<url type="homepage">https://pwmt.org/projects/zathura-pdf-mupdf/</url>
- <update_contact>[email protected]</update_contact>
+ <url type="bugtracker">https://github.com/pwmt/zathura-pdf-mupdf/issues</url>
+ <url type="donation">https://pwmt.org/help/donate</url>
+ <url type="contact">https://pwmt.org/contact</url>
+ <url type="vcs-browser">https://github.com/pwmt/zathura-pdf-mupdf</url>
+ <releases>
+ <release version="2026.05.10" date="2026-05-10" />
+ <release version="2026.02.03" date="2026-02-03" />
+ <release version="2026.01.30" date="2026-01-30" />
+ <release version="0.4.6" date="2025-10-28" />
+ <release version="0.4.5" date="2025-10-27" />
+ <release version="0.4.4" date="2024-08-04" />
+ </releases>
</component>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/meson.build
new/zathura-pdf-mupdf-2026.05.10/meson.build
--- old/zathura-pdf-mupdf-0.4.4/meson.build 2024-08-04 10:34:58.000000000
+0200
+++ new/zathura-pdf-mupdf-2026.05.10/meson.build 2026-05-10
13:47:32.000000000 +0200
@@ -1,7 +1,7 @@
project('zathura-pdf-mupdf', 'c',
- version: '0.4.4',
- meson_version: '>=0.61',
- default_options: ['c_std=c17', 'warning_level=3']
+ version: '2026.05.10',
+ meson_version: '>=1',
+ default_options: ['c_std=c23', 'warning_level=3']
)
version = meson.project_version()
@@ -9,6 +9,7 @@
cc = meson.get_compiler('c')
+datadir = get_option('datadir')
prefix = get_option('prefix')
datadir = get_option('datadir')
metainfodir = join_paths(datadir, 'metainfo')
@@ -16,14 +17,13 @@
# required dependencies
mupdf_required_version_major = 1
-mupdf_required_version_minor = 24
+mupdf_required_version_minor = 26
-zathura = dependency('zathura', version: '>=0.5.2')
-girara = dependency('girara-gtk3')
+zathura = dependency('zathura', version: '>=2026.01.30')
+girara = dependency('girara')
glib = dependency('glib-2.0')
cairo = dependency('cairo')
mupdf = dependency('mupdf', required: false, version:
'>=@0@.@1@'.format(mupdf_required_version_major, mupdf_required_version_minor))
-mupdfthird = cc.find_library('mupdf-third')
build_dependencies = [
zathura,
@@ -35,6 +35,7 @@
if not mupdf.found()
# normal build of mupdf
mupdf = cc.find_library('mupdf', has_headers: ['mupdf/fitz/version.h',
'mupdf/fitz.h', 'mupdf/pdf.h'], required: true)
+ mupdfthird = cc.find_library('mupdf-third')
version_check = '''
#include <mupdf/fitz/version.h>
@@ -49,25 +50,7 @@
build_dependencies += [mupdf, mupdfthird]
else
# build from Debian's libmupdf-dev
- build_dependencies += [mupdf, mupdfthird]
-
- libjpeg = dependency('libjpeg')
- libjbig2dec = cc.find_library('jbig2dec')
- libopenjp2 = dependency('libopenjp2')
- gumbo = dependency('gumbo')
- tesseract = dependency('tesseract')
- leptonica = dependency('lept')
- mujs = dependency('mujs')
-
- build_dependencies += [
- libjpeg,
- libjbig2dec,
- libopenjp2,
- gumbo,
- tesseract,
- leptonica,
- mujs
- ]
+ build_dependencies += [mupdf]
endif
if get_option('plugindir') == ''
@@ -83,17 +66,23 @@
'-DVERSION_REV=@0@'.format(version_array[2]),
'-D_DEFAULT_SOURCE',
]
+if get_option('pdf').allowed()
+ defines += ['-DHAVE_PDF']
+endif
# compile flags
flags = [
'-Werror=implicit-function-declaration',
'-Werror=vla',
+ '-Werror=int-conversion',
+ '-Werror=maybe-uninitialized'
]
flags = cc.get_supported_arguments(flags)
sources = files(
'zathura-pdf-mupdf/document.c',
'zathura-pdf-mupdf/image.c',
+ 'zathura-pdf-mupdf/attachment.c',
'zathura-pdf-mupdf/index.c',
'zathura-pdf-mupdf/links.c',
'zathura-pdf-mupdf/page.c',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/meson_options.txt
new/zathura-pdf-mupdf-2026.05.10/meson_options.txt
--- old/zathura-pdf-mupdf-0.4.4/meson_options.txt 2024-08-04
10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/meson_options.txt 2026-05-10
13:47:32.000000000 +0200
@@ -8,3 +8,8 @@
value: 'auto',
description: 'run tests'
)
+option('pdf',
+ type: 'feature',
+ value: 'auto',
+ description: 'PDF support which bring conflict with zathura-pdf-poppler'
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/attachment.c
new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/attachment.c
--- old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/attachment.c 1970-01-01
01:00:00.000000000 +0100
+++ new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/attachment.c
2026-05-10 13:47:32.000000000 +0200
@@ -0,0 +1,101 @@
+#include "plugin.h"
+#include "utils.h"
+#include <mupdf/pdf.h>
+
+girara_list_t* pdf_document_attachments_get(zathura_document_t* document,
void* data, zathura_error_t* error) {
+ if (document == NULL || data == NULL) {
+ if (error != NULL) {
+ *error = ZATHURA_ERROR_INVALID_ARGUMENTS;
+ }
+ goto error_ret;
+ }
+
+ mupdf_document_t* mupdf_document = data;
+
+ /* Setup attachment list */
+ girara_list_t* list =
girara_list_new_with_free((girara_free_function_t)g_free);
+ if (list == NULL) {
+ if (error != NULL) {
+ *error = ZATHURA_ERROR_OUT_OF_MEMORY;
+ }
+ return NULL;
+ }
+
+ /* Extract attachments */
+ g_mutex_lock(&mupdf_document->mutex);
+ fz_try(mupdf_document->ctx) {
+ pdf_document* pdf_doc = pdf_specifics(mupdf_document->ctx,
mupdf_document->document);
+ pdf_filespec_params fs_params;
+ int n_objects = pdf_xref_len(mupdf_document->ctx, pdf_doc);
+
+ for (int i = 1; i < n_objects; ++i) {
+ pdf_obj* obj = pdf_load_object(mupdf_document->ctx, pdf_doc, i);
+ if (pdf_is_embedded_file(mupdf_document->ctx, obj)) {
+ pdf_get_filespec_params(mupdf_document->ctx, obj, &fs_params);
+ girara_list_append(list, g_strdup(fs_params.filename));
+ }
+ pdf_drop_obj(mupdf_document->ctx, obj);
+ }
+ }
+ fz_catch(mupdf_document->ctx) {
+ if (error != NULL) {
+ *error = ZATHURA_ERROR_UNKNOWN;
+ }
+ g_mutex_unlock(&mupdf_document->mutex);
+ goto error_free;
+ }
+ g_mutex_unlock(&mupdf_document->mutex);
+
+ return list;
+
+error_free:
+
+ if (error != NULL && *error == ZATHURA_ERROR_OK) {
+ *error = ZATHURA_ERROR_UNKNOWN;
+ }
+
+ if (list != NULL) {
+ girara_list_free(list);
+ }
+
+error_ret:
+
+ return NULL;
+}
+
+zathura_error_t pdf_document_attachment_save(zathura_document_t* document,
void* data, const char* name,
+ const char* file) {
+ if (document == NULL || data == NULL) {
+ return ZATHURA_ERROR_INVALID_ARGUMENTS;
+ }
+ mupdf_document_t* mupdf_document = data;
+
+ g_mutex_lock(&mupdf_document->mutex);
+ fz_try(mupdf_document->ctx) {
+ pdf_document* pdf_doc = pdf_specifics(mupdf_document->ctx,
mupdf_document->document);
+ pdf_filespec_params fs_params;
+ int n_objects = pdf_xref_len(mupdf_document->ctx, pdf_doc);
+
+ for (int i = 1; i < n_objects; ++i) {
+ pdf_obj* obj = pdf_load_object(mupdf_document->ctx, pdf_doc, i);
+ if (pdf_is_embedded_file(mupdf_document->ctx, obj)) {
+ pdf_get_filespec_params(mupdf_document->ctx, obj, &fs_params);
+ if (strcmp(fs_params.filename, name) == 0) {
+ fz_buffer* buf =
pdf_load_embedded_file_contents(mupdf_document->ctx, obj);
+ fz_save_buffer(mupdf_document->ctx, buf, file);
+ fz_drop_buffer(mupdf_document->ctx, buf);
+ pdf_drop_obj(mupdf_document->ctx, obj);
+ break;
+ }
+ }
+ pdf_drop_obj(mupdf_document->ctx, obj);
+ }
+ }
+ fz_catch(mupdf_document->ctx) {
+ g_mutex_unlock(&mupdf_document->mutex);
+ return ZATHURA_ERROR_UNKNOWN;
+ }
+ g_mutex_unlock(&mupdf_document->mutex);
+
+ return ZATHURA_ERROR_OK;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/document.c
new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/document.c
--- old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/document.c 2024-08-04
10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/document.c
2026-05-10 13:47:32.000000000 +0200
@@ -6,6 +6,7 @@
#include <glib-2.0/glib.h>
#include "plugin.h"
+#include <girara/utils.h>
#define LENGTH(x) (sizeof(x) / sizeof((x)[0]))
@@ -37,11 +38,24 @@
fz_try(mupdf_document->ctx) {
fz_register_document_handlers(mupdf_document->ctx);
+ /* read user css from zathura/epub.css */
+ char* xdg_path = girara_get_xdg_path(XDG_CONFIG);
+ if (xdg_path != NULL) {
+ char* css_path = g_build_filename(xdg_path, "zathura", "epub.css",
NULL);
+ gchar* user_css = NULL;
+ if (g_file_get_contents(css_path, &user_css, NULL, NULL) == TRUE) {
+ fz_set_user_css(mupdf_document->ctx, user_css);
+ g_free(user_css);
+ }
+ g_free(css_path);
+ g_free(xdg_path);
+ }
+
mupdf_document->document = fz_open_document(mupdf_document->ctx, path);
}
fz_catch(mupdf_document->ctx) {
error = ZATHURA_ERROR_UNKNOWN;
- return error;
+ goto error_free;
}
if (mupdf_document->document == NULL) {
@@ -50,14 +64,27 @@
}
/* authenticate if password is required and given */
- if (fz_needs_password(mupdf_document->ctx, mupdf_document->document) != 0) {
- if (password == NULL || fz_authenticate_password(mupdf_document->ctx,
mupdf_document->document, password) == 0) {
- error = ZATHURA_ERROR_INVALID_PASSWORD;
- goto error_free;
+ fz_try(mupdf_document->ctx) {
+ if (fz_needs_password(mupdf_document->ctx, mupdf_document->document) != 0)
{
+ if (password == NULL || fz_authenticate_password(mupdf_document->ctx,
mupdf_document->document, password) == 0) {
+ error = ZATHURA_ERROR_INVALID_PASSWORD;
+ }
}
}
+ fz_catch(mupdf_document->ctx) {
+ error = ZATHURA_ERROR_UNKNOWN;
+ }
+ if (error != ZATHURA_ERROR_OK) {
+ goto error_free;
+ }
- zathura_document_set_number_of_pages(document,
fz_count_pages(mupdf_document->ctx, mupdf_document->document));
+ fz_try(mupdf_document->ctx) {
+ zathura_document_set_number_of_pages(document,
fz_count_pages(mupdf_document->ctx, mupdf_document->document));
+ }
+ fz_catch(mupdf_document->ctx) {
+ error = ZATHURA_ERROR_UNKNOWN;
+ goto error_free;
+ }
zathura_document_set_data(document, mupdf_document);
return ZATHURA_ERROR_OK;
@@ -127,7 +154,7 @@
girara_list_t* pdf_document_get_information(zathura_document_t* document,
void* data, zathura_error_t* error) {
mupdf_document_t* mupdf_document = data;
- if (document == NULL || mupdf_document == NULL || error == NULL) {
+ if (document == NULL || mupdf_document == NULL) {
if (error != NULL) {
*error = ZATHURA_ERROR_INVALID_ARGUMENTS;
}
@@ -171,7 +198,7 @@
continue;
}
- char* str_value = pdf_to_str_buf(mupdf_document->ctx, value);
+ const char* str_value = pdf_to_text_string(mupdf_document->ctx, value);
if (str_value == NULL || strlen(str_value) == 0) {
continue;
}
@@ -195,7 +222,7 @@
continue;
}
- char* str_value = pdf_to_str_buf(mupdf_document->ctx, value);
+ const char* str_value = pdf_to_text_string(mupdf_document->ctx, value);
if (str_value == NULL || strlen(str_value) == 0) {
continue;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/image.c
new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/image.c
--- old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/image.c 2024-08-04
10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/image.c 2026-05-10
13:47:32.000000000 +0200
@@ -7,7 +7,9 @@
#include "plugin.h"
#include "utils.h"
-static void pdf_zathura_image_free(zathura_image_t* image);
+static void pdf_zathura_image_free(void* image) {
+ g_free(image);
+}
girara_list_t* pdf_page_images_get(zathura_page_t* page, void* data,
zathura_error_t* error) {
mupdf_page_t* mupdf_page = data;
@@ -28,7 +30,7 @@
mupdf_document_t* mupdf_document = zathura_document_get_data(document);
/* Setup image list */
- list = girara_list_new();
+ list = girara_list_new_with_free(pdf_zathura_image_free);
if (list == NULL) {
if (error != NULL) {
*error = ZATHURA_ERROR_OUT_OF_MEMORY;
@@ -36,14 +38,13 @@
goto error_free;
}
- girara_list_set_free_function(list,
(girara_free_function_t)pdf_zathura_image_free);
-
/* Extract images */
g_mutex_lock(&mupdf_document->mutex);
- mupdf_page_extract_text(mupdf_document, mupdf_page);
+ if (!mupdf_page->extracted_text) {
+ mupdf_page_extract_text(mupdf_document, mupdf_page);
+ }
- fz_stext_block* block;
- for (block = mupdf_page->text->first_block; block; block = block->next) {
+ for (fz_stext_block* block = mupdf_page->text->first_block; block; block =
block->next) {
if (block->type == FZ_STEXT_BLOCK_IMAGE) {
zathura_image_t* zathura_image = g_malloc(sizeof(zathura_image_t));
@@ -105,8 +106,11 @@
goto error_free;
}
- surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, mupdf_image->w,
mupdf_image->h);
- if (surface == NULL) {
+ const int width = fz_pixmap_width(mupdf_page->ctx, pixmap);
+ const int height = fz_pixmap_height(mupdf_page->ctx, pixmap);
+
+ surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
+ if (surface == NULL || cairo_surface_status(surface) !=
CAIRO_STATUS_SUCCESS) {
goto error_free;
}
@@ -116,14 +120,12 @@
unsigned char* s = fz_pixmap_samples(mupdf_page->ctx, pixmap);
unsigned int n = fz_pixmap_components(mupdf_page->ctx, pixmap);
- const int height = fz_pixmap_height(mupdf_page->ctx, pixmap);
- const int width = fz_pixmap_width(mupdf_page->ctx, pixmap);
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
guchar* p = surface_data + y * rowstride + x * 4;
// RGB
- if (n == 4) {
+ if (n == 3) {
p[0] = s[2];
p[1] = s[1];
p[2] = s[0];
@@ -157,11 +159,3 @@
return NULL;
}
-
-static void pdf_zathura_image_free(zathura_image_t* image) {
- if (image == NULL) {
- return;
- }
-
- g_free(image);
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/links.c
new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/links.c
--- old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/links.c 2024-08-04
10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/links.c 2026-05-10
13:47:32.000000000 +0200
@@ -20,9 +20,8 @@
}
mupdf_document_t* mupdf_document = zathura_document_get_data(document);
- ;
- girara_list_t* list =
girara_list_new2((girara_free_function_t)zathura_link_free);
+ girara_list_t* list =
girara_list_new_with_free((girara_free_function_t)zathura_link_free);
if (list == NULL) {
if (error != NULL) {
*error = ZATHURA_ERROR_OUT_OF_MEMORY;
@@ -32,8 +31,8 @@
g_mutex_lock(&mupdf_document->mutex);
- fz_link* link = fz_load_links(mupdf_document->ctx, mupdf_page->page);
- for (; link != NULL; link = link->next) {
+ fz_link* link_head = fz_load_links(mupdf_document->ctx, mupdf_page->page);
+ for (fz_link* link = link_head; link != NULL; link = link->next) {
/* extract position */
zathura_rectangle_t position;
position.x1 = link->rect.x0;
@@ -75,6 +74,7 @@
girara_list_append(list, zathura_link);
}
}
+ fz_drop_link(mupdf_document->ctx, link_head);
g_mutex_unlock(&mupdf_document->mutex);
return list;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/page.c
new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/page.c
--- old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/page.c 2024-08-04
10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/page.c 2026-05-10
13:47:32.000000000 +0200
@@ -25,17 +25,15 @@
/* load page */
fz_try(mupdf_page->ctx) {
mupdf_page->page = fz_load_page(mupdf_document->ctx,
mupdf_document->document, index);
+ mupdf_page->bbox = fz_bound_page(mupdf_document->ctx,
(fz_page*)mupdf_page->page);
+ mupdf_page->text = fz_new_stext_page(mupdf_page->ctx, mupdf_page->bbox);
}
fz_catch(mupdf_page->ctx) {
goto error_free;
}
- mupdf_page->bbox = fz_bound_page(mupdf_document->ctx,
(fz_page*)mupdf_page->page);
-
- /* setup text */
mupdf_page->extracted_text = false;
- mupdf_page->text = fz_new_stext_page(mupdf_page->ctx, mupdf_page->bbox);
if (mupdf_page->text == NULL) {
goto error_free;
}
@@ -80,7 +78,7 @@
}
g_mutex_unlock(&mupdf_document->mutex);
- return ZATHURA_ERROR_UNKNOWN;
+ return ZATHURA_ERROR_OK;
}
zathura_error_t pdf_page_get_label(zathura_page_t* page, void* data, char**
label) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/plugin.c
new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/plugin.c
--- old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/plugin.c 2024-08-04
10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/plugin.c 2026-05-10
13:47:32.000000000 +0200
@@ -2,6 +2,12 @@
#include "plugin.h"
+#if defined(HAVE_PDF)
+#define PDF_MIMETYPE "application/pdf",
+#else
+#define PDF_MIMETYPE
+#endif
+
ZATHURA_PLUGIN_REGISTER_WITH_FUNCTIONS("pdf-mupdf", VERSION_MAJOR,
VERSION_MINOR, VERSION_REV,
ZATHURA_PLUGIN_FUNCTIONS({
.document_open =
pdf_document_open,
@@ -9,6 +15,8 @@
.document_save_as =
pdf_document_save_as,
.document_index_generate =
pdf_document_index_generate,
.document_get_information =
pdf_document_get_information,
+ .document_attachments_get =
pdf_document_attachments_get,
+ .document_attachment_save =
pdf_document_attachment_save,
.page_init =
pdf_page_init,
.page_clear =
pdf_page_clear,
.page_search_text =
pdf_page_search_text,
@@ -21,9 +29,15 @@
.page_get_label =
pdf_page_get_label,
}),
ZATHURA_PLUGIN_MIMETYPES({
- "application/pdf",
- "application/oxps",
+ PDF_MIMETYPE "application/oxps",
"application/epub+zip",
"application/x-fictionbook",
+ "application/x-mobipocket-ebook",
"text/xml",
+ "image/svg+xml",
+ "image/jpeg",
+ "image/png",
+ "image/bmp",
+ "image/tiff",
+ "image/tiff-fx",
}))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/plugin.h
new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/plugin.h
--- old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/plugin.h 2024-08-04
10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/plugin.h 2026-05-10
13:47:32.000000000 +0200
@@ -100,6 +100,30 @@
girara_list_t* pdf_page_links_get(zathura_page_t* page, void* mupdf_page,
zathura_error_t* error);
/**
+ * Returns a list of attachment names included in the document
+ *
+ * @param document Zathura document
+ * @param data Mupdf document representation
+ * @param error Set to an error value (see zathura_error_t) if an
+ * error occurred
+ * @return List of attachments
+ */
+girara_list_t* pdf_document_attachments_get(zathura_document_t* document,
void* data, zathura_error_t* error);
+
+/**
+ * Saves an attachment to a file
+ *
+ * @param document Zathura document
+ * @param data Mupdf document representation
+ * @param name Name of the attachment
+ * @param file Target file path
+ * @return ZATHURA_ERROR_OK when no error occurred, otherwise see
+ * zathura_error_t
+ */
+zathura_error_t pdf_document_attachment_save(zathura_document_t* document,
void* data, const char* name,
+ const char* file);
+
+/**
* Returns a list of images included on the zathura page
*
* @param page The page
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/search.c
new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/search.c
--- old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/search.c 2024-08-04
10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/search.c 2026-05-10
13:47:32.000000000 +0200
@@ -22,9 +22,8 @@
}
mupdf_document_t* mupdf_document = zathura_document_get_data(document);
- ;
- girara_list_t* list = girara_list_new2(g_free);
+ girara_list_t* list = girara_list_new_with_free(g_free);
if (list == NULL) {
if (error != NULL) {
*error = ZATHURA_ERROR_OUT_OF_MEMORY;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/select.c
new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/select.c
--- old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/select.c 2024-08-04
10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/select.c 2026-05-10
13:47:32.000000000 +0200
@@ -67,7 +67,7 @@
fz_point a = {rectangle.x1, rectangle.y1};
fz_point b = {rectangle.x2, rectangle.y2};
- girara_list_t* list = girara_list_new2(g_free);
+ girara_list_t* list = girara_list_new_with_free(g_free);
if (list == NULL) {
if (error != NULL) {
*error = ZATHURA_ERROR_OUT_OF_MEMORY;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/utils.c
new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/utils.c
--- old/zathura-pdf-mupdf-0.4.4/zathura-pdf-mupdf/utils.c 2024-08-04
10:34:58.000000000 +0200
+++ new/zathura-pdf-mupdf-2026.05.10/zathura-pdf-mupdf/utils.c 2026-05-10
13:47:32.000000000 +0200
@@ -10,14 +10,11 @@
fz_device* volatile text_device = NULL;
fz_try(mupdf_page->ctx) {
- text_device = fz_new_stext_device(mupdf_page->ctx, mupdf_page->text, NULL);
+ fz_stext_options stext_options;
+ stext_options.flags = FZ_STEXT_PRESERVE_IMAGES;
+ text_device = fz_new_stext_device(mupdf_page->ctx,
mupdf_page->text, &stext_options);
- /* Disable FZ_DONT_INTERPOLATE_IMAGES to collect image blocks */
- fz_disable_device_hints(mupdf_page->ctx, text_device,
FZ_DONT_INTERPOLATE_IMAGES);
-
- fz_matrix ctm;
- ctm = fz_scale(1.0, 1.0);
- fz_run_page(mupdf_page->ctx, mupdf_page->page, text_device, ctm, NULL);
+ fz_run_page(mupdf_page->ctx, mupdf_page->page, text_device, fz_identity,
NULL);
}
fz_always(mupdf_document->ctx) {
fz_close_device(mupdf_page->ctx, text_device);