cc ajacoutot@ in case he has something to say re: the webkit errors
and debugging (bottom).

libepubdocument uses the (Linux-only?) {ftello,fseeko,fopen}64
functions, so trying to open an EPUB results in the following console
prints (and the misleading GUI error message "File type electronic
book document (application/epub+zip) is not supported"):

        atril:/usr/local/lib/atril/3/backends/libepubdocument.so: undefined 
symbol 'ftello64'
        atril:/usr/local/lib/atril/3/backends/libepubdocument.so: undefined 
symbol 'fseeko64'
        atril:/usr/local/lib/atril/3/backends/libepubdocument.so: undefined 
symbol 'fopen64'

        (atril:26401): AtrilDocument-WARNING **: Cannot load specified object

        (atril:26401): AtrilDocument-WARNING **: Cannot load backend 
'epubdocument' since file '/usr/local/lib/atril/3/backends/libepubdocument.so' 
cannot be read.

This is easy to fix with the following (crude) patch:

diff --git x11/mate/atril/patches/patch-backend_epub_minizip_ioapi_h 
x11/mate/atril/patches/patch-backend_epub_minizip_ioapi_h
new file mode 100644
index 000000000..ba014a61d
--- /dev/null
+++ x11/mate/atril/patches/patch-backend_epub_minizip_ioapi_h
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+Index: backend/epub/minizip/ioapi.h
+--- backend/epub/minizip/ioapi.h.orig
++++ backend/epub/minizip/ioapi.h
+@@ -50,7 +50,7 @@
+ #define ftello64 ftell
+ #define fseeko64 fseek
+ #else
+-#ifdef __FreeBSD__
++#ifdef __OpenBSD__
+ #define fopen64 fopen
+ #define ftello64 ftello
+ #define fseeko64 fseeko

Now EPUB files load, but they only show blank pages.  The following
error prints appear on the console:

        (atril:65545): GLib-GObject-WARNING **: value "-538976290" of type 
'gint' is invalid or out of range for property 'page' of type 'gint'

        (atril:65545): GLib-GObject-WARNING **: value "-538976290" of type 
'gint' is invalid or out of range for property 'page' of type 'gint'

        (atril:65545): GLib-GObject-WARNING **: value "-538976290" of type 
'gint' is invalid or out of range for property 'page' of type 'gint'

        (atril:65545): Gtk-WARNING **: Allocating size to EvSidebar 
0xd7a580d7f60 without calling gtk_widget_get_preferred_width/height(). How does 
the code know the size to allocate?

        (atril:65545): AtrilView-WARNING **: Error loading data from 
file:///tmp/atril-65545/Metamorphosis-jackson.epubUWLRAZ/OEBPS/front-cover.html:
 Frame load interrupted

The last one is, I believe, the relevant one, but it comes from the
depths of webkitgtk4, and my attempts to debug it were stymied by my
failure to get the port to compile with debug symbols, which is
apparently a long-term unresolved issue for the library [1].

[1]: https://bugs.webkit.org/show_bug.cgi?id=140384

Reply via email to