Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: jazzbiker on May 07, 2019, 08:27:45 AM

Title: new version of mupdf
Post by: jazzbiker on May 07, 2019, 08:27:45 AM
Hi, Cores!

mupdf.tcz is nice working and is Tiny and toolkit independant, so everything is ok with it, i use it almost every day.
But new mupdf versions are available at mupdf.org, and they can work not only with pdf's, but with .epub and .fb2 too. If i am not mistaken, .epub's can be viewed with flviewer.tcz, but i don't know any extension for .fb2's.
I've loaded and compiled and tried a little mupdf-1.15. It works well too, but have issues with sourced GL interface in .tar.xz (missing header glu.h). So i succeed only with building mupdf-x11, not mupdf-gl. Of course it is big enough (it is toolkit independent too)- built without any dependencies weights 35M.
I've made an extension mupdf-1.15.tcz and the bright side of it is that new extension is not conflicting with the old mupdf.tcz, they can coexist, and there is no need to displace time-proved and tiny old version.
May be it will be usefull to add this new version to repo in order to have fb2-able viewer?
And mupdf-tools in additional extension? Even library is built accompanied with dev files, but is static one.
License is AGPL, can we use it?
Title: Re: new version of mupdf
Post by: jazzbiker on May 07, 2019, 08:31:15 AM
UI is the same, with some improvements, TOC is now available.
Title: Re: new version of mupdf
Post by: Rich on May 07, 2019, 08:42:36 AM
Hi jazzbiker
Quote
...  (missing header glu.h) ...
Did you try installing  glu-dev.tcz ?
Title: Re: new version of mupdf
Post by: curaga on May 07, 2019, 09:47:51 AM
Yes, AGPL is an accepted license. Please send your extension according to the instructions in the wiki.
Title: new version of mupdf
Post by: coreplayer2 on May 07, 2019, 10:05:12 AM
Hey jazbiker

Firefox opens pdf files perfectly.   There are also Firefox addon’s available to open epub & fb2 documents

[emoji2]


Sent from my iPhone using Tapatalk
Title: Re: new version of mupdf
Post by: jazzbiker on May 07, 2019, 11:20:37 AM
Did you try installing  glu-dev.tcz ?

Hi, Rich!

Yes, as authors reminded, and other extensions too. But tarball is aimed on fully standalone make install, all dependencies' sources are inside of /thirdparty dir. To replace them with system libs according directory must be cleaned and appropriate variables given to make, i don't understand yet what exactly, they differs slightly from standard form. And docs are spread upon different dirs, some issues seen only in Makefile.
Another issue is, that some of the libs (don't remember now which ones) have later and incompatible with TC's versions of them. For example, thay want some headers, which are simply absent in TC *-dev.tcz. So i will need gurus' advice what to do - update some system libs devs or compile with attached sources. It will take some time for me to clear out all obstacles.

Thanks, advices are welcome!
Title: Re: new version of mupdf
Post by: jazzbiker on May 07, 2019, 11:23:34 AM
Yes, AGPL is an accepted license. Please send your extension according to the instructions in the wiki.
Ok, I will try to do my best.
Title: Re: new version of mupdf
Post by: jazzbiker on May 07, 2019, 11:35:50 AM
Firefox opens pdf files perfectly.   There are also Firefox addon’s available to open epub & fb2 documents
[emoji2]

Hi, coreplayer2!

I use TC on different boxes, some have 1G memory, about what Firefox you are talking? It can be only the dead one.
I use lynx and fifth, sweet pair.
Browsers' authors want them to do everything at all, but this is not mine problem. I respect Mozilla for their efforts, they provide very pleasant helps and docs, and Rust is their child in great measure, as i can understand.

So thanks for advice, but i will not follow it  :)
Title: Re: new version of mupdf
Post by: coreplayer2 on May 07, 2019, 02:11:45 PM
Firefox opens pdf files perfectly.   There are also Firefox addon’s available to open epub & fb2 documents
[emoji2]

Hi, coreplayer2!

...what Firefox you are talking? It can be only the dead one.

Hello Jazzbiker

What “dead one” are you referring to?

I use Firefox because I want the best possible browsing experience.




Sent from my iPhone using Tapatalk
Title: Re: new version of mupdf
Post by: Juanito on May 07, 2019, 10:11:20 PM
To replace them with system libs according directory must be cleaned and appropriate variables given to make, i don't understand yet what exactly, they differs slightly from standard form.

Have you seen the build instructions here:

http://www.linuxfromscratch.org/blfs/view/svn/pst/mupdf.html
Title: Re: new version of mupdf
Post by: jazzbiker on May 07, 2019, 10:46:29 PM

Have you seen the build instructions here:

http://www.linuxfromscratch.org/blfs/view/svn/pst/mupdf.html

Thanks, Juanito! I've forgotten about wonderful LFS! All my questions answered.
Title: Re: new version of mupdf
Post by: jazzbiker on June 15, 2019, 08:43:00 AM
Sorry, but i didn't succeed in creating mupdf-1.15 extension. Tried different variants, but...
I want to show what was done, please give me advice where to move further.

Code: [Select]
tce-load -i compiletc Xorg-7.7-3d-dev libjpeg-turbo-dev harfbuzz-dev openjpeg2-dev jbig2dec-dev glu-dev
cd /tmp
wget https://mupdf.com/downloads/archive/mupdf-1.15.0-source.tar.gz
tar x -zvf mupdf-1.15.0-source.tar.gz
cd mupdf-1.15.0-source
export XCFLAGS="-march=i486 -mtune=i686"
make

This is the simplest way, without use of system libraries, everything compiled from sources.
Then

Code: [Select]
tc@box:/tmp/mupdf-1.15.0-source$ cd build/release
tc@box:/tmp/mupdf-1.15.0-source/build/release$ ls
libfreeglut.a       libmupdf.a          mutool              thirdparty/
libmupdf-pkcs7.a    mupdf-gl            platform/
libmupdf-third.a    mupdf-x11           resources/
libmupdf-threads.a  muraster            source/
tc@box:/tmp/mupdf-1.15.0-source/build/release$ ldd ./mupdf-x11
Illegal instruction
tc@box:/tmp/mupdf-1.15.0-source/build/release$ dmesg | tail -n 1
traps: ld-linux.so.2[25449] trap invalid opcode ip:b7f7df56 sp:bf9045c0 error:0 in ld-2.28.so[b7f70000+15000]
tc@box:/tmp/mupdf-1.15.0-source/build/release$

What does it means?

I want to say, that i packed the extension and use it. Is it dangerous?
Title: Re: new version of mupdf
Post by: Rich on June 15, 2019, 08:48:20 AM
Hi jazzbiker
Code: [Select]
export XCFLAGS="-march=i486 -mtune=i686"
 ...............

Code: [Select]
Illegal instruction
tc@box:/tmp/mupdf-1.15.0-source/build/release$ dmesg | tail -n 1
traps: ld-linux.so.2[25449] trap invalid opcode ip:b7f7df56 sp:bf9045c0 error:0 in ld-2.28.so[b7f70000+15000]

Try changing that to:
Code: [Select]
export CFLAGS="-march=i486 -mtune=i686"
Title: Re: new version of mupdf
Post by: Juanito on June 15, 2019, 09:10:46 AM
You didn't follow the lfs instructions:
Code: [Select]
$ patch -Np1 -i ../mupdf-1.15.0-shared_libs-1.patch
$ USE_SYSTEM_LIBS=yes CC="gcc -march=i486 -mtune=i686 -Os -pipe" make
$ sudo USE_SYSTEM_LIBS=yes CC="gcc -march=i486 -mtune=i686 -Os -pipe" make prefix=/usr/local build=release install
$ ls build/release
libmupdf-pkcs7.so    mupdf-gl             platform/
libmupdf-third.so    mupdf-x11            resources/
libmupdf-threads.so  muraster             source/
libmupdf.so          mutool               thirdparty/
Title: Re: new version of mupdf
Post by: jazzbiker on June 15, 2019, 09:26:58 AM
Try changing that to:
Code: [Select]
export CFLAGS="-march=i486 -mtune=i686"

Hi, Rich!
CFLAGS is used in Makefile and mupdf developers propose to pass switches with XCFLAGS

Code: [Select]
tc@box:~$ cat /tmp/mupdf-1.15.0-source/Makefile | head -n 25 | tail -n 7

# Do not specify CFLAGS or LIBS on the make invocation line - specify
# XCFLAGS or XLIBS instead. Make ignores any lines in the makefile that
# set a variable that was set on the command line.
CFLAGS += $(XCFLAGS) -Iinclude
LIBS += $(XLIBS) -lm

Title: Re: new version of mupdf
Post by: jazzbiker on June 15, 2019, 09:30:49 AM
You didn't follow the lfs instructions:
Code: [Select]
$ patch -Np1 -i ../mupdf-1.15.0-shared_libs-1.patch
$ USE_SYSTEM_LIBS=yes CC="gcc -march=i486 -mtune=i686 -Os -pipe" make
$ sudo USE_SYSTEM_LIBS=yes CC="gcc -march=i486 -mtune=i686 -Os -pipe" make prefix=/usr/local build=release install
$ ls build/release
libmupdf-pkcs7.so    mupdf-gl             platform/
libmupdf-third.so    mupdf-x11            resources/
libmupdf-threads.so  muraster             source/
libmupdf.so          mutool               thirdparty/

Hi, Juanito!

I do tried this patch. It concerns shared libs, but ldd result was the same - Illegal instruction.
If You did make, please try ldd ./mupdf-x11.
Title: Re: new version of mupdf
Post by: jazzbiker on June 15, 2019, 09:53:00 AM
I've tried with USE_SYSTEM_LIBS=yes, but this decreased binary only by 1M from 34M to 33M, it is huge. The cause are fonts linked into binary, variety of fonts, including many of Eastern ones. It is very good for using without any toolkit and external fonts, but the new mupdf is huge, not a mu one, i think )
So it appears to be usefull only for minimal X neighbourhood. I think it is useless for full Xorg, especially if some toolkits are already loaded. And now i am not sure that such a huge extension with basic functional should find its place in TinyCore repo.
But there is no other FB2 viewer at all.
And TOC in .pdf's is accessible only in mupdf-gl binary, which i failed to make work at all.
Title: Re: new version of mupdf
Post by: Juanito on June 15, 2019, 09:55:17 AM
You're correct and even without CFLAGS there is an invalid opcode...