Bug 210398 - graphics/mupdf: Update to 1.9a
Summary: graphics/mupdf: Update to 1.9a
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Pawel Pekala
Keywords: easy, patch, patch-ready
Depends on:
Reported: 2016-06-20 06:02 UTC by Zsolt Udvari
Modified: 2016-07-02 09:28 UTC (History)
4 users (show)

See Also:

patch (4.88 KB, patch)
2016-06-20 06:02 UTC, Zsolt Udvari
no flags Details | Diff
Patch to zathura-pdf-mupdf (3.05 KB, patch)
2016-06-23 08:54 UTC, Zsolt Udvari
no flags Details | Diff
llpp.diff (18.65 KB, patch)
2016-06-23 21:17 UTC, Tobias Kortkamp
tobik: maintainer-approval+
Details | Diff
zathura-pdf-mupdf.diff (5.99 KB, patch)
2016-06-24 14:03 UTC, Tobias Kortkamp
no flags Details | Diff
llpp.diff (18.98 KB, patch)
2016-06-24 14:08 UTC, Tobias Kortkamp
tobik: maintainer-approval+
Details | Diff
mupdf.diff (4.11 KB, patch)
2016-06-24 14:14 UTC, Tobias Kortkamp
tobik: maintainer-approval?
Details | Diff
mupdf updated patch (5.05 KB, patch)
2016-06-25 18:50 UTC, Zsolt Udvari
uzsolt: maintainer-approval+
Details | Diff
Updated patch to zathura-pdf-mupdf (7.63 KB, patch)
2016-06-25 18:52 UTC, Zsolt Udvari
uzsolt: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zsolt Udvari 2016-06-20 06:02:14 UTC
Created attachment 171594 [details]

- update to 1.9a
- change MASTER_SITES (download -> downloads)
- add patch-scripts_fontdump.c (see http://bugs.ghostscript.com/show_bug.cgi?id=696828 )
- don't delete everything in thirdparty

News: http://mupdf.com/news

Poudriere log: http://freebsd.uzsolt.hu/logs/mupdf/mupdf-1.9a%2C1.log
Comment 1 VK freebsd_triage 2016-06-21 09:12:16 UTC
Comment on attachment 171594 [details]

Thanks for the patch. Please flag your patches for ports your maintain with maintainer-approval(+) as that makes the PR visible in the "Maintainer approved" saved search. ;)
Comment 2 VK freebsd_triage 2016-06-21 09:12:55 UTC
Summary clean up in favor of patch flags.
Comment 3 Zsolt Udvari 2016-06-21 09:15:54 UTC
(In reply to Vladimir Krstulja from comment #1)
Okay, thanks! :)
Comment 4 Pawel Pekala freebsd_committer 2016-06-22 20:12:06 UTC
This upgrade breaks at least:


This must be resolved before we can commit this PR.
Comment 5 Zsolt Udvari 2016-06-23 08:54:29 UTC
Created attachment 171702 [details]
Patch to zathura-pdf-mupdf

Patch to use mupdf-1.9a in zathura-pdf-mupdf.
Poudriere log: http://freebsd.uzsolt.hu/logs/zathura-pdf-mupdf/zathura-pdf-mupdf-0.3.0_1.log
Comment 6 Tobias Kortkamp freebsd_committer 2016-06-23 21:17:29 UTC
Created attachment 171725 [details]

Here is a patch for graphics/llpp to build with mupdf 1.9a. Poudriere testport log for FreeBSD 10.2/amd64 is here: https://gist.github.com/t6/427522876cd634198a8c1794f30ac0c4
Comment 7 Zsolt Udvari 2016-06-24 03:29:05 UTC
(In reply to Pawel Pekala from comment #4)
I think no more port:
$ find /usr/ports/ -depth 3 -name Makefile | xargs grep -l mupdf

graphics/zathura-pdf-poppler only conflicts with zathura-pdf-mupdf.
Comment 8 Tobias Kortkamp freebsd_committer 2016-06-24 13:59:58 UTC
It seems like there is still an issue with the mupdf update. 

When loading PDF files with embedded JPEG images llpp fails with:

> error: jpeg error: Wrong JPEG library version: library is 90, caller expects 80

It also looks like graphics/mupdf starts (re-)building stuff during the stage phase.

The zathura-pdf-mupdf patch did not work for me. If I open the same PDF in zathura I get this:
> error: could not load plugin /usr/local/lib/zathura/pdf.so (/usr/local/lib/zathura/pdf.so: Undefined symbol "js_newobject")

I had to link llpp with libmupdfthird.a in addition to libmupdf.a. The same likely applies here.  I tried to quickly fix this by adding MUPDF_LIB="-lmupdf -lmupdfthird" to the Makefile but that did not work:

> LD pdf.so
> /usr/bin/ld: /usr/local/lib/libmupdf.a(list-device.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
> /usr/local/lib/libmupdf.a: could not read symbols: Bad value

I think mupdf's build/pic/libmupdfthird.a should be installed as ${LOCALBASE}/lib/libmupdfthird_pic.a as well.

zathura-pdf-mupdf also gives quite a lot of undefined function warnings which leads to zathura failing to load the mupdf pugin. I'll attach a new patch for zathura-pdf-mupdf next.

The fixed zathura-pdf-mupdf can open PDF with JPEG images, so the JPEG issue seems to be only in llpp. I'll investigate.
Comment 9 Tobias Kortkamp freebsd_committer 2016-06-24 14:03:51 UTC
Created attachment 171754 [details]

Here is an updated patch for graphics/zathura-pdf-mupdf. This requires an update to graphics/mupdf to also install libmupdfthird_pic.a.
Comment 10 Tobias Kortkamp freebsd_committer 2016-06-24 14:08:06 UTC
Created attachment 171755 [details]

llpp's JPEG issue can be fixed by linking with libmupdf_pic.a and libmupdfthird_pic.a.
Comment 11 Tobias Kortkamp freebsd_committer 2016-06-24 14:14:00 UTC
Created attachment 171756 [details]

And here is an update mupdf patch which also install libmupdfthird_pic.a.
Comment 12 Zsolt Udvari 2016-06-25 18:49:46 UTC
Thank for your work!
I attach the full patches.
Comment 13 Zsolt Udvari 2016-06-25 18:50:48 UTC
Created attachment 171796 [details]
mupdf updated patch
Comment 14 Zsolt Udvari 2016-06-25 18:52:11 UTC
Created attachment 171797 [details]
Updated patch to zathura-pdf-mupdf
Comment 16 commit-hook freebsd_committer 2016-06-30 16:06:00 UTC
A commit references this bug:

Author: pawel
Date: Thu Jun 30 16:05:56 UTC 2016
New revision: 417832
URL: https://svnweb.freebsd.org/changeset/ports/417832

  - Update graphics/mupdf to version 1.9a [1]
  - Fix graphics/zathura-pdf-mupdf after mupdf update [1]
  - Fix graphics/llpp after mupdf update [2]

  PR:		210398
  Submitted by:	Zsolt Udvari (maintainer) [1]
  		Tobias Kortkamp (maintainer) [2]

Comment 17 jakub_lach 2016-07-01 06:58:46 UTC

I got this - 

Comment 18 Zsolt Udvari 2016-07-01 08:33:44 UTC
(In reply to jakub_lach from comment #17)
Works for me with poudriere and simple "cd /usr/ports/graphics/mupdf && make package". How did you want to build (command, etc.)?

/Maybe you should open a new bug report./
Comment 19 jakub_lach 2016-07-01 14:12:33 UTC
(In reply to Zsolt Udvari from comment #18)

This behaviour was introduced with this update, though I can 
open new PR. I'm sorry for being so laconic. I've tried portmaster 
and make build (package) with the same results, also tried commenting out
Comment 20 Pawel Pekala freebsd_committer 2016-07-01 21:05:44 UTC
Jakub: Build failure seems to occur because you have old version of
mupdf installed and new mupdf tries to compile against old headers.
Deleting old package and installing new one should fix this issue.

Zsolt: This build failure is caused by adding -I${LOCALBASE}/include to
CFLAGS in last update. Removing it fixes build for me and it seems
unnecessary. Can you explain why it was added?
Comment 21 Zsolt Udvari 2016-07-02 09:28:30 UTC
(In reply to Pawel Pekala from comment #20)
See here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210741