diff options
author | pawel <pawel@FreeBSD.org> | 2016-06-30 16:05:54 +0000 |
---|---|---|
committer | pawel <pawel@FreeBSD.org> | 2016-06-30 16:05:54 +0000 |
commit | 0e9ede4eba28066694de4b1f265337af462d0402 (patch) | |
tree | 92265a88a3e858302207bee81bcc467361e31f24 | |
parent | 09eb91b8f1a4346f4322b2f874ae9b10195e8522 (diff) | |
download | FreeBSD-ports-0e9ede4eba28066694de4b1f265337af462d0402.zip FreeBSD-ports-0e9ede4eba28066694de4b1f265337af462d0402.tar.gz |
- 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]
-rw-r--r-- | graphics/llpp/Makefile | 4 | ||||
-rw-r--r-- | graphics/llpp/files/patch-build.sh | 2 | ||||
-rw-r--r-- | graphics/llpp/files/patch-glfont.c | 11 | ||||
-rw-r--r-- | graphics/llpp/files/patch-link.c | 382 | ||||
-rw-r--r-- | graphics/llpp/files/patch-misc_llppac | 9 | ||||
-rw-r--r-- | graphics/llpp/pkg-message | 4 | ||||
-rw-r--r-- | graphics/mupdf/Makefile | 26 | ||||
-rw-r--r-- | graphics/mupdf/distinfo | 5 | ||||
-rw-r--r-- | graphics/mupdf/files/patch-scripts_fontdump.c | 10 | ||||
-rw-r--r-- | graphics/mupdf/pkg-plist | 8 | ||||
-rw-r--r-- | graphics/zathura-pdf-mupdf/Makefile | 11 | ||||
-rw-r--r-- | graphics/zathura-pdf-mupdf/files/patch-document.c | 13 | ||||
-rw-r--r-- | graphics/zathura-pdf-mupdf/files/patch-image.c | 11 | ||||
-rw-r--r-- | graphics/zathura-pdf-mupdf/files/patch-page.c | 31 | ||||
-rw-r--r-- | graphics/zathura-pdf-mupdf/files/patch-plugin.h | 13 | ||||
-rw-r--r-- | graphics/zathura-pdf-mupdf/files/patch-search.c | 11 | ||||
-rw-r--r-- | graphics/zathura-pdf-mupdf/files/patch-utils.c | 11 |
17 files changed, 539 insertions, 23 deletions
diff --git a/graphics/llpp/Makefile b/graphics/llpp/Makefile index 6f28fc4..98f4efb 100644 --- a/graphics/llpp/Makefile +++ b/graphics/llpp/Makefile @@ -3,6 +3,7 @@ PORTNAME= llpp PORTVERSION= 22 +PORTREVISION= 1 CATEGORIES= graphics MASTER_SITES= http://repo.or.cz/llpp.git/snapshot/ DISTNAME= 561dc5673cea431e930668b0d87b0c4b31a36b39 @@ -23,12 +24,13 @@ BUILD_DEPENDS= gsed:textproc/gsed \ ${LOCALBASE}/lib/libmupdf.a:graphics/mupdf LIB_DEPENDS= libcurl.so:ftp/curl \ libfreetype.so:print/freetype2 \ + libharfbuzz.so:print/harfbuzz \ libjbig2dec.so:graphics/jbig2dec \ libopenjp2.so:graphics/openjpeg RUN_DEPENDS= xsel:x11/xsel-conrad STRIP= # Stripping renders the executable unusable, so don't do it for now -USES= desktop-file-utils gmake +USES= desktop-file-utils gmake jpeg USE_GL= gl USE_OCAML= yes NO_OCAML_RUNDEPENDS= yes diff --git a/graphics/llpp/files/patch-build.sh b/graphics/llpp/files/patch-build.sh index 776147e..d095a4d 100644 --- a/graphics/llpp/files/patch-build.sh +++ b/graphics/llpp/files/patch-build.sh @@ -32,4 +32,4 @@ $comp -c $mloptgl -I $builddir -o $builddir/main$osu $builddir/main.ml $comp -c $mlopt -I $builddir -o $builddir/wsi$osu $srcdir/wsi.ml -$comp -g $lfl -I lablGL -o $builddir/llpp unix$asu str$asu $builddir/help$osu $builddir/lablGL/raw$osu $builddir/utils$osu $builddir/parser$osu $builddir/lablGL/glMisc$osu $builddir/wsi$osu $builddir/lablGL/gl$osu $builddir/lablGL/glMat$osu $builddir/lablGL/glFunc$osu $builddir/lablGL/glClear$osu $builddir/lablGL/glPix$osu $builddir/lablGL/glTex$osu $builddir/lablGL/glDraw$osu $builddir/config$osu $builddir/lablGL/glArray$osu $builddir/main$osu $builddir/link.o -cclib "-lGL -lX11 -lmupdf -lz -lfreetype -ljpeg -ljbig2dec -lopenjpeg -lmujs -lpthread -L$srcdir/mupdf/build/native -lcrypto $builddir/lablGL/ml_gl.o $builddir/lablGL/ml_glarray.o $builddir/lablGL/ml_raw.o" -+$comp $lfl -I lablGL -o $builddir/llpp unix$asu str$asu $builddir/help$osu $builddir/lablGL/raw$osu $builddir/utils$osu $builddir/parser$osu $builddir/lablGL/glMisc$osu $builddir/wsi$osu $builddir/lablGL/gl$osu $builddir/lablGL/glMat$osu $builddir/lablGL/glFunc$osu $builddir/lablGL/glClear$osu $builddir/lablGL/glPix$osu $builddir/lablGL/glTex$osu $builddir/lablGL/glDraw$osu $builddir/config$osu $builddir/lablGL/glArray$osu $builddir/main$osu $builddir/link.o -cclib "-L${LOCALBASE}/lib -lGL -lX11 -lmupdf -lz -lfreetype -ljpeg -ljbig2dec -lopenjp2 -lpthread -L$srcdir/mupdf/build/native -lcrypto $builddir/lablGL/ml_gl.o $builddir/lablGL/ml_glarray.o $builddir/lablGL/ml_raw.o" ++$comp $lfl -I lablGL -o $builddir/llpp unix$asu str$asu $builddir/help$osu $builddir/lablGL/raw$osu $builddir/utils$osu $builddir/parser$osu $builddir/lablGL/glMisc$osu $builddir/wsi$osu $builddir/lablGL/gl$osu $builddir/lablGL/glMat$osu $builddir/lablGL/glFunc$osu $builddir/lablGL/glClear$osu $builddir/lablGL/glPix$osu $builddir/lablGL/glTex$osu $builddir/lablGL/glDraw$osu $builddir/config$osu $builddir/lablGL/glArray$osu $builddir/main$osu $builddir/link.o -cclib "-L${LOCALBASE}/lib -lGL -lX11 -lmupdf_pic -lmupdfthird_pic -lharfbuzz -lz -lfreetype -ljpeg -ljbig2dec -lopenjp2 -lpthread -L$srcdir/mupdf/build/native -lcrypto $builddir/lablGL/ml_gl.o $builddir/lablGL/ml_glarray.o $builddir/lablGL/ml_raw.o" diff --git a/graphics/llpp/files/patch-glfont.c b/graphics/llpp/files/patch-glfont.c new file mode 100644 index 0000000..1880dc6 --- /dev/null +++ b/graphics/llpp/files/patch-glfont.c @@ -0,0 +1,11 @@ +--- glfont.c.orig 2015-10-13 20:12:27 UTC ++++ glfont.c +@@ -120,7 +120,7 @@ static FT_Face load_font(char *fontname) + return face; + } + +-static FT_Face UNUSED_ATTR load_builtin_font(void *base, int len) ++static FT_Face UNUSED_ATTR load_builtin_font(const void *base, int len) + { + FT_Face face; + int code; diff --git a/graphics/llpp/files/patch-link.c b/graphics/llpp/files/patch-link.c index 3374da3..acdb163 100644 --- a/graphics/llpp/files/patch-link.c +++ b/graphics/llpp/files/patch-link.c @@ -13,7 +13,364 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wshadow" -@@ -3913,8 +3907,7 @@ CAMLprim value ml_platform (value unit_v +@@ -189,8 +183,8 @@ struct page { + int agen; + int pageno; + int pdimno; +- fz_text_page *text; +- fz_text_sheet *sheet; ++ fz_stext_page *text; ++ fz_stext_sheet *sheet; + fz_page *fzpage; + fz_display_list *dlist; + int slinkcount; +@@ -199,7 +193,7 @@ struct page { + struct annot *annots; + struct mark { + int i; +- fz_text_span *span; ++ fz_stext_span *span; + } fmark, lmark; + }; + +@@ -531,10 +525,10 @@ static void freepage (struct page *page) + { + if (!page) return; + if (page->text) { +- fz_drop_text_page (state.ctx, page->text); ++ fz_drop_stext_page (state.ctx, page->text); + } + if (page->sheet) { +- fz_drop_text_sheet (state.ctx, page->sheet); ++ fz_drop_stext_sheet (state.ctx, page->sheet); + } + if (page->slinks) { + free (page->slinks); +@@ -1307,11 +1301,11 @@ static void process_outline (void) + } + } + +-static char *strofspan (fz_text_span *span) ++static char *strofspan (fz_stext_span *span) + { + char *p; + char utf8[10]; +- fz_text_char *ch; ++ fz_stext_char *ch; + size_t size = 0, cap = 80; + + p = malloc (cap + 1); +@@ -1332,7 +1326,7 @@ static char *strofspan (fz_text_span *sp + return p; + } + +-static int matchspan (regex_t *re, fz_text_span *span, ++static int matchspan (regex_t *re, fz_stext_span *span, + int stop, int pageno, double start) + { + int ret; +@@ -1372,8 +1366,8 @@ static int matchspan (regex_t *re, fz_te + b = MAX (0, b-1); + } + +- fz_text_char_bbox (state.ctx, &sb, span, a); +- fz_text_char_bbox (state.ctx, &eb, span, b); ++ fz_stext_char_bbox (state.ctx, &sb, span, a); ++ fz_stext_char_bbox (state.ctx, &eb, span, b); + + p1.x = sb.x0; + p1.y = sb.y0; +@@ -1411,8 +1405,8 @@ static int matchspan (regex_t *re, fz_te + + static int compareblocks (const void *l, const void *r) + { +- fz_text_block const *ls = l; +- fz_text_block const *rs = r; ++ fz_stext_block const *ls = l; ++ fz_stext_block const *rs = r; + return ls->bbox.y0 - rs->bbox.y0; + } + +@@ -1421,8 +1415,8 @@ static void search (regex_t *re, int pag + { + int i, j; + fz_device *tdev; +- fz_text_page *text; +- fz_text_sheet *sheet; ++ fz_stext_page *text; ++ fz_stext_sheet *sheet; + struct pagedim *pdim, *pdimprev; + int stop = 0, niters = 0; + double start, end; +@@ -1458,9 +1452,9 @@ static void search (regex_t *re, int pag + pdim = pdimprev; + found: + +- sheet = fz_new_text_sheet (state.ctx); +- text = fz_new_text_page (state.ctx); +- tdev = fz_new_text_device (state.ctx, sheet, text); ++ sheet = fz_new_stext_sheet (state.ctx); ++ text = fz_new_stext_page (state.ctx); ++ tdev = fz_new_stext_device (state.ctx, sheet, text); + + page = fz_load_page (state.ctx, state.doc, pageno); + { +@@ -1474,15 +1468,15 @@ static void search (regex_t *re, int pag + for (j = 0; j < text->len; ++j) { + int k; + fz_page_block *pb; +- fz_text_block *block; ++ fz_stext_block *block; + + pb = &text->blocks[forward ? j : text->len - 1 - j]; + if (pb->type != FZ_PAGE_BLOCK_TEXT) continue; + block = pb->u.text; + + for (k = 0; k < block->len; ++k) { +- fz_text_line *line; +- fz_text_span *span; ++ fz_stext_line *line; ++ fz_stext_span *span; + + if (forward) { + line = &block->lines[k]; +@@ -1511,8 +1505,8 @@ static void search (regex_t *re, int pag + y = INT_MAX; + } + endloop: +- fz_drop_text_page (state.ctx, text); +- fz_drop_text_sheet (state.ctx, sheet); ++ fz_drop_stext_page (state.ctx, text); ++ fz_drop_stext_sheet (state.ctx, sheet); + fz_drop_page (state.ctx, page); + } + end = now (); +@@ -2010,9 +2004,9 @@ static void showsel (struct page *page, + int seen = 0; + fz_irect bbox; + fz_rect rect; +- fz_text_line *line; ++ fz_stext_line *line; + fz_page_block *pageb; +- fz_text_block *block; ++ fz_stext_block *block; + struct mark first, last; + unsigned char selcolor[] = {15,15,15,140}; + +@@ -2036,7 +2030,7 @@ static void showsel (struct page *page, + for (line = block->lines; + line < block->lines + block->len; + ++line) { +- fz_text_span *span; ++ fz_stext_span *span; + rect = fz_empty_rect; + + for (span = line->first_span; span; span = span->next) { +@@ -2066,7 +2060,7 @@ static void showsel (struct page *page, + for (i = j; i <= k; ++i) { + fz_rect bbox1; + fz_union_rect (&rect, +- fz_text_char_bbox (state.ctx, &bbox1, ++ fz_stext_char_bbox (state.ctx, &bbox1, + span, i)); + } + fz_round_rect (&bbox, &rect); +@@ -2216,7 +2210,7 @@ static int compareslinks (const void *l, + static void droptext (struct page *page) + { + if (page->text) { +- fz_drop_text_page (state.ctx, page->text); ++ fz_drop_stext_page (state.ctx, page->text); + page->fmark.i = -1; + page->lmark.i = -1; + page->fmark.span = NULL; +@@ -2224,7 +2218,7 @@ static void droptext (struct page *page) + page->text = NULL; + } + if (page->sheet) { +- fz_drop_text_sheet (state.ctx, page->sheet); ++ fz_drop_stext_sheet (state.ctx, page->sheet); + page->sheet = NULL; + } + } +@@ -2252,7 +2246,7 @@ static void ensureannots (struct page *p + + for (annot = fz_first_annot (state.ctx, page->fzpage); + annot; +- annot = fz_next_annot (state.ctx, page->fzpage, annot)) { ++ annot = fz_next_annot (state.ctx, annot)) { + count++; + } + +@@ -2265,10 +2259,10 @@ static void ensureannots (struct page *p + + for (annot = fz_first_annot (state.ctx, page->fzpage), i = 0; + annot; +- annot = fz_next_annot (state.ctx, page->fzpage, annot), i++) { ++ annot = fz_next_annot (state.ctx, annot), i++) { + fz_rect rect; + +- fz_bound_annot (state.ctx, page->fzpage, annot, &rect); ++ fz_bound_annot (state.ctx, annot, &rect); + page->annots[i].annot = annot; + fz_round_rect (&page->annots[i].bbox, &rect); + } +@@ -2325,10 +2319,7 @@ static void ensureslinks (struct page *p + } + for (j = 0; j < page->annotcount; ++j, ++i) { + fz_rect rect; +- fz_bound_annot (state.ctx, +- page->fzpage, +- page->annots[j].annot, +- &rect); ++ fz_bound_annot (state.ctx, page->annots[j].annot, &rect); + fz_transform_rect (&rect, &ctm); + fz_round_rect (&page->slinks[i].bbox, &rect); + +@@ -2647,16 +2638,14 @@ static void ensuretext (struct page *pag + fz_matrix ctm; + fz_device *tdev; + +- page->text = fz_new_text_page (state.ctx); +- page->sheet = fz_new_text_sheet (state.ctx); +- tdev = fz_new_text_device (state.ctx, page->sheet, page->text); ++ page->text = fz_new_stext_page (state.ctx); ++ page->sheet = fz_new_stext_sheet (state.ctx); ++ tdev = fz_new_stext_device (state.ctx, page->sheet, page->text); + ctm = pagectm (page); +- fz_begin_page (state.ctx, tdev, &fz_infinite_rect, &ctm); + fz_run_display_list (state.ctx, page->dlist, + tdev, &ctm, &fz_infinite_rect, NULL); + qsort (page->text->blocks, page->text->len, + sizeof (*page->text->blocks), compareblocks); +- fz_end_page (state.ctx, tdev); + fz_drop_device (state.ctx, tdev); + } + } +@@ -3049,13 +3038,13 @@ CAMLprim value ml_whatsunder (value ptr_ + else { + fz_rect *b; + fz_page_block *pageb; +- fz_text_block *block; ++ fz_stext_block *block; + + ensuretext (page); + for (pageb = page->text->blocks; + pageb < page->text->blocks + page->text->len; + ++pageb) { +- fz_text_line *line; ++ fz_stext_line *line; + if (pageb->type != FZ_PAGE_BLOCK_TEXT) continue; + block = pageb->u.text; + +@@ -3066,7 +3055,7 @@ CAMLprim value ml_whatsunder (value ptr_ + for (line = block->lines; + line < block->lines + block->len; + ++line) { +- fz_text_span *span; ++ fz_stext_span *span; + + b = &line->bbox; + if (!(x >= b->x0 && x <= b->x1 && y >= b->y0 && y <= b->y1)) +@@ -3081,12 +3070,12 @@ CAMLprim value ml_whatsunder (value ptr_ + + for (charnum = 0; charnum < span->len; ++charnum) { + fz_rect bbox; +- fz_text_char_bbox (state.ctx, &bbox, span, charnum); ++ fz_stext_char_bbox (state.ctx, &bbox, span, charnum); + b = &bbox; + + if (x >= b->x0 && x <= b->x1 + && y >= b->y0 && y <= b->y1) { +- fz_text_style *style = span->text->style; ++ fz_stext_style *style = span->text->style; + const char *n2 = + style->font + ? style->font->name +@@ -3164,9 +3153,9 @@ CAMLprim value ml_markunder (value ptr_v + CAMLlocal1 (ret_v); + fz_rect *b; + struct page *page; +- fz_text_line *line; ++ fz_stext_line *line; + fz_page_block *pageb; +- fz_text_block *block; ++ fz_stext_block *block; + struct pagedim *pdim; + int mark = Int_val (mark_v); + char *s = String_val (ptr_v); +@@ -3242,7 +3231,7 @@ CAMLprim value ml_markunder (value ptr_v + for (line = block->lines; + line < block->lines + block->len; + ++line) { +- fz_text_span *span; ++ fz_stext_span *span; + + b = &line->bbox; + if (!(x >= b->x0 && x <= b->x1 && y >= b->y0 && y <= b->y1)) +@@ -3267,7 +3256,7 @@ CAMLprim value ml_markunder (value ptr_v + + for (charnum = 0; charnum < span->len; ++charnum) { + fz_rect bbox; +- fz_text_char_bbox (state.ctx, &bbox, span, charnum); ++ fz_stext_char_bbox (state.ctx, &bbox, span, charnum); + b = &bbox; + + if (x >= b->x0 && x <= b->x1 && y >= b->y0 && y <= b->y1) { +@@ -3383,10 +3372,10 @@ CAMLprim value ml_seltext (value ptr_v, + struct pagedim *pdim; + char *s = String_val (ptr_v); + int i, x0, x1, y0, y1, fi, li; +- fz_text_line *line; ++ fz_stext_line *line; + fz_page_block *pageb; +- fz_text_block *block; +- fz_text_span *span, *fspan, *lspan; ++ fz_stext_block *block; ++ fz_stext_span *span, *fspan, *lspan; + + if (trylock ("ml_seltext")) { + goto done; +@@ -3426,7 +3415,7 @@ CAMLprim value ml_seltext (value ptr_v, + + for (span = line->first_span; span; span = span->next) { + for (i = 0; i < span->len; ++i) { +- fz_text_char_bbox (state.ctx, &b, span, i); ++ fz_stext_char_bbox (state.ctx, &b, span, i); + + if (x0 >= b.x0 && x0 <= b.x1 + && y0 >= b.y0 && y0 <= b.y1) { +@@ -3465,7 +3454,7 @@ CAMLprim value ml_seltext (value ptr_v, + CAMLreturn (Val_unit); + } + +-static int UNUSED_ATTR pipespan (FILE *f, fz_text_span *span, int a, int b) ++static int UNUSED_ATTR pipespan (FILE *f, fz_stext_span *span, int a, int b) + { + char buf[4]; + int i, len, ret; +@@ -3589,9 +3578,9 @@ CAMLprim value ml_copysel (value fd_v, v + FILE *f; + int seen = 0; + struct page *page; +- fz_text_line *line; ++ fz_stext_line *line; + fz_page_block *pageb; +- fz_text_block *block; ++ fz_stext_block *block; + int fd = Int_val (fd_v); + char *s = String_val (ptr_v); + +@@ -3621,7 +3610,7 @@ CAMLprim value ml_copysel (value fd_v, v + for (line = block->lines; + line < block->lines + block->len; + ++line) { +- fz_text_span *span; ++ fz_stext_span *span; + + for (span = line->first_span; span; span = span->next) { + int a, b; +@@ -3913,8 +3902,7 @@ CAMLprim value ml_platform (value unit_v platid = pilinux; #elif defined __CYGWIN__ platid = picygwin; @@ -23,3 +380,26 @@ platid = pibsd; #elif defined __sun__ platid = pisun; +@@ -4185,7 +4173,7 @@ CAMLprim value ml_savedoc (value path_v) + pdf_document *pdf = pdf_specifics (state.ctx, state.doc); + + if (pdf) { +- pdf_write_document (state.ctx, pdf, String_val (path_v), NULL); ++ pdf_save_document (state.ctx, pdf, String_val (path_v), NULL); + } + CAMLreturn (Val_unit); + } +@@ -4400,10 +4388,10 @@ CAMLprim value ml_init (value csock_v, v + #endif + } + else { +- unsigned int len; +- void *base = pdf_lookup_substitute_font (state.ctx, 0, 0, 0, 0, &len); ++ int len; ++ const char *data = pdf_lookup_substitute_font (state.ctx, 0, 0, 0, 0, &len); + +- state.face = load_builtin_font (base, len); ++ state.face = load_builtin_font (data, len); + } + if (!state.face) _exit (1); + diff --git a/graphics/llpp/files/patch-misc_llppac b/graphics/llpp/files/patch-misc_llppac index b1059c1..3f44fb4 100644 --- a/graphics/llpp/files/patch-misc_llppac +++ b/graphics/llpp/files/patch-misc_llppac @@ -1,5 +1,14 @@ --- misc/llppac.orig 2015-10-13 20:12:27 UTC +++ misc/llppac +@@ -7,7 +7,7 @@ die() { + } + + cachedir="${XDG_CACHE_HOME:-$HOME/.cache}/llpp" +-test -d "$cachedir" || die "cache directory '$cachedir' does not exist" ++mkdir -p "$cachedir" + + caspsuf= + type= @@ -197,7 +197,7 @@ EOF *) die "unhandled filter type: '$type'";; esac diff --git a/graphics/llpp/pkg-message b/graphics/llpp/pkg-message index 5469fb7..abea433 100644 --- a/graphics/llpp/pkg-message +++ b/graphics/llpp/pkg-message @@ -11,6 +11,4 @@ x11-toolkits/pango Fonts graphics/imagemagick Image formats besides PNG and JPEG textproc/hs-pandoc Text files -It might be necessary to first create a cache directory with - -$ mkdir -p ~/.cache/llpp +Auto-converted documents are cached in ~/.cache/llpp. diff --git a/graphics/mupdf/Makefile b/graphics/mupdf/Makefile index 51c1b89..53590b0 100644 --- a/graphics/mupdf/Makefile +++ b/graphics/mupdf/Makefile @@ -2,12 +2,12 @@ # $FreeBSD$ PORTNAME= mupdf -PORTVERSION= 1.8 +PORTVERSION= 1.9a DISTVERSIONSUFFIX= -source PORTEPOCH= 1 CATEGORIES= graphics -MASTER_SITES= http://www.mupdf.com/download/ \ - http://www.mupdf.com/download/archive/ +MASTER_SITES= http://www.mupdf.com/downloads/ \ + http://www.mupdf.com/downloads/archive/ MAINTAINER= udvzsolt@gmail.com COMMENT= Lightweight PDF viewer and toolkit @@ -17,14 +17,16 @@ LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libcurl.so:ftp/curl \ libfreetype.so:print/freetype2 \ + libharfbuzz.so:print/harfbuzz \ libjbig2dec.so:graphics/jbig2dec \ libopenjp2.so:graphics/openjpeg -CFLAGS+= -I${WRKSRC}/include/mupdf +CFLAGS+= -I${WRKSRC}/include/mupdf -I${LOCALBASE}/include LIBS+= -L${LOCALBASE}/lib MAKE_ARGS= build=release prefix=${PREFIX} mandir=${PREFIX}/man verbose=yes USES= cpe compiler:c++11-lang gmake jpeg pkgconfig -USE_XORG= x11 xext +USE_XORG= x11 xcursor xext xinerama xrandr +USE_GL= gl CPE_VENDOR= artifex @@ -45,9 +47,13 @@ post-patch: -e 's|/usr/local|${LOCALBASE}|' \ -e 's/Linux/FreeBSD/' \ ${WRKSRC}/Makerules - @${REINPLACE_CMD} '/^CFLAGS/s|$$| -I${LOCALBASE}/include|' \ - ${WRKSRC}/Makefile - @${RM} -r ${WRKSRC}/thirdparty/* + @${RM} -r ${WRKSRC}/thirdparty/curl \ + ${WRKSRC}/thirdparty/jbig2dec \ + ${WRKSRC}/thirdparty/freetype \ + ${WRKSRC}/thirdparty/harfbuzz \ + ${WRKSRC}/thirdparty/jpeg \ + ${WRKSRC}/thirdparty/openjpeg \ + ${WRKSRC}/thirdparty/zlib post-build: (cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \ @@ -56,8 +62,10 @@ post-build: post-install: ${INSTALL_DATA} ${WRKSRC}/build/pic/libmupdf.a \ ${STAGEDIR}${PREFIX}/lib/libmupdf_pic.a + ${INSTALL_DATA} ${WRKSRC}/build/pic/libmupdfthird.a \ + ${STAGEDIR}${PREFIX}/lib/libmupdfthird_pic.a ${MV} ${STAGEDIR}${PREFIX}/bin/mupdf-x11 ${STAGEDIR}${PREFIX}/bin/mupdf -.for binary in mutool mujstest mupdf mupdf-x11-curl +.for binary in mutool mujstest mupdf mupdf-gl mupdf-x11-curl ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${binary} .endfor diff --git a/graphics/mupdf/distinfo b/graphics/mupdf/distinfo index 9c363f0..b69d337 100644 --- a/graphics/mupdf/distinfo +++ b/graphics/mupdf/distinfo @@ -1,2 +1,3 @@ -SHA256 (mupdf-1.8-source.tar.gz) = a2a3c64d8b24920f87cf4ea9339a25abf7388496440f13b37482d1403c33c206 -SIZE (mupdf-1.8-source.tar.gz) = 14169777 +TIMESTAMP = 1466328793 +SHA256 (mupdf-1.9a-source.tar.gz) = 8015c55f4e6dd892d3c50db4f395c1e46660a10b460e2ecd180a497f55bbc4cc +SIZE (mupdf-1.9a-source.tar.gz) = 20493793 diff --git a/graphics/mupdf/files/patch-scripts_fontdump.c b/graphics/mupdf/files/patch-scripts_fontdump.c new file mode 100644 index 0000000..092f416 --- /dev/null +++ b/graphics/mupdf/files/patch-scripts_fontdump.c @@ -0,0 +1,10 @@ +--- scripts/fontdump.c.orig 2016-06-12 09:11:56 UTC ++++ scripts/fontdump.c +@@ -50,7 +50,6 @@ main(int argc, char **argv) + fprintf(fo, "#ifndef __STRICT_ANSI__\n"); + fprintf(fo, "#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)\n"); + fprintf(fo, "#if !defined(__ICC)\n"); +- fprintf(fo, "#define HAVE_INCBIN\n"); + fprintf(fo, "#endif\n"); + fprintf(fo, "#endif\n"); + fprintf(fo, "#endif\n"); diff --git a/graphics/mupdf/pkg-plist b/graphics/mupdf/pkg-plist index 524cee1..c46b19c 100644 --- a/graphics/mupdf/pkg-plist +++ b/graphics/mupdf/pkg-plist @@ -1,9 +1,11 @@ bin/mujstest bin/mupdf +bin/mupdf-gl bin/mupdf-x11-curl bin/mutool include/mupdf/fitz.h include/mupdf/fitz/annotation.h +include/mupdf/fitz/bidi.h include/mupdf/fitz/bitmap.h include/mupdf/fitz/buffer.h include/mupdf/fitz/colorspace.h @@ -27,12 +29,14 @@ include/mupdf/fitz/outline.h include/mupdf/fitz/output-pcl.h include/mupdf/fitz/output-png.h include/mupdf/fitz/output-pnm.h +include/mupdf/fitz/output-ps.h include/mupdf/fitz/output-pwg.h include/mupdf/fitz/output-svg.h include/mupdf/fitz/output-tga.h include/mupdf/fitz/output.h include/mupdf/fitz/path.h include/mupdf/fitz/pixmap.h +include/mupdf/fitz/pool.h include/mupdf/fitz/separation.h include/mupdf/fitz/shade.h include/mupdf/fitz/store.h @@ -47,7 +51,6 @@ include/mupdf/fitz/ucdn.h include/mupdf/fitz/unzip.h include/mupdf/fitz/util.h include/mupdf/fitz/version.h -include/mupdf/fitz/write-document.h include/mupdf/fitz/xml.h include/mupdf/html.h include/mupdf/memento.h @@ -62,6 +65,7 @@ include/mupdf/pdf/document.h include/mupdf/pdf/event.h include/mupdf/pdf/field.h include/mupdf/pdf/font.h +include/mupdf/pdf/graft.h include/mupdf/pdf/interpret.h include/mupdf/pdf/javascript.h include/mupdf/pdf/name-table.h @@ -74,6 +78,8 @@ include/mupdf/pdf/widget.h include/mupdf/pdf/xref.h include/mupdf/xps.h lib/libmupdf.a +lib/libmupdfthird.a +lib/libmupdfthird_pic.a lib/libmupdf_pic.a man/man1/mupdf.1.gz man/man1/mutool.1.gz diff --git a/graphics/zathura-pdf-mupdf/Makefile b/graphics/zathura-pdf-mupdf/Makefile index ec64bab..bac3627 100644 --- a/graphics/zathura-pdf-mupdf/Makefile +++ b/graphics/zathura-pdf-mupdf/Makefile @@ -3,6 +3,7 @@ PORTNAME= zathura-pdf-mupdf PORTVERSION= 0.3.0 +PORTREVISION= 1 CATEGORIES= graphics MASTER_SITES= http://pwmt.org/projects/zathura-pdf-mupdf/download/ @@ -16,15 +17,15 @@ BUILD_DEPENDS= zathura:graphics/zathura \ mupdf>=1.8,1:graphics/mupdf RUN_DEPENDS= zathura:graphics/zathura LIB_DEPENDS= libjbig2dec.so:graphics/jbig2dec \ - libopenjp2.so:graphics/openjpeg + libopenjp2.so:graphics/openjpeg \ + libgirara-gtk3.so:x11-toolkits/girara PLIST_FILES= lib/zathura/pdf.so share/applications/zathura-pdf-mupdf.desktop -MAKE_ARGS= MUPDF_LIB=-lmupdf_pic OPENSSL_INC=-I${OPENSSLINC} \ +MAKE_ARGS= MUPDF_LIB="-lmupdf_pic -lmupdfthird_pic" OPENSSL_INC=-I${OPENSSLINC} \ OPENSSL_LIB="-L${OPENSSLLIB} -lcrypto" -USES= compiler:c11 desktop-file-utils gmake pkgconfig -USE_GNOME= glib20 gtk30 -USE_OPENSSL= yes +USES= compiler:c11 desktop-file-utils gmake gettext jpeg pkgconfig ssl +USE_GNOME= cairo gdkpixbuf2 glib20 gtk30 CONFLICTS_INSTALL= zathura-pdf-poppler-[0-9]* diff --git a/graphics/zathura-pdf-mupdf/files/patch-document.c b/graphics/zathura-pdf-mupdf/files/patch-document.c new file mode 100644 index 0000000..22817ce --- /dev/null +++ b/graphics/zathura-pdf-mupdf/files/patch-document.c @@ -0,0 +1,13 @@ +--- document.c.orig 2016-02-14 22:49:46 UTC ++++ document.c +@@ -113,8 +113,8 @@ pdf_document_save_as(zathura_document_t* + * pdf_write_document does not check if the third arguments is NULL for some + * options. */ + +- fz_write_options opts = { 0 }; /* just use the default options */ +- fz_write_document(mupdf_document->ctx, mupdf_document->document, (char*) path, &opts); ++ pdf_write_options opts = { 0 }; /* just use the default options */ ++ pdf_save_document(mupdf_document->ctx, mupdf_document->document, (char*) path, &opts); + } fz_catch (mupdf_document->ctx) { + return ZATHURA_ERROR_UNKNOWN; + } diff --git a/graphics/zathura-pdf-mupdf/files/patch-image.c b/graphics/zathura-pdf-mupdf/files/patch-image.c new file mode 100644 index 0000000..5a504ca --- /dev/null +++ b/graphics/zathura-pdf-mupdf/files/patch-image.c @@ -0,0 +1,11 @@ +--- image.c.orig 2016-06-25 17:52:28 UTC ++++ image.c +@@ -93,7 +93,7 @@ pdf_page_image_get_cairo(zathura_page_t* + fz_pixmap* pixmap = NULL; + cairo_surface_t* surface = NULL; + +- pixmap = fz_new_pixmap_from_image(mupdf_page->ctx, mupdf_image, 0, 0); ++ pixmap = fz_get_pixmap_from_image(mupdf_page->ctx, mupdf_image, 0, 0); + if (pixmap == NULL) { + goto error_free; + } diff --git a/graphics/zathura-pdf-mupdf/files/patch-page.c b/graphics/zathura-pdf-mupdf/files/patch-page.c new file mode 100644 index 0000000..23bf1fd --- /dev/null +++ b/graphics/zathura-pdf-mupdf/files/patch-page.c @@ -0,0 +1,31 @@ +--- page.c.orig 2016-06-25 17:39:19 UTC ++++ page.c +@@ -43,12 +43,12 @@ pdf_page_init(zathura_page_t* page) + /* setup text */ + mupdf_page->extracted_text = false; + +- mupdf_page->text = fz_new_text_page(mupdf_page->ctx); ++ mupdf_page->text = fz_new_stext_page(mupdf_page->ctx); + if (mupdf_page->text == NULL) { + goto error_free; + } + +- mupdf_page->sheet = fz_new_text_sheet(mupdf_page->ctx); ++ mupdf_page->sheet = fz_new_stext_sheet(mupdf_page->ctx); + if (mupdf_page->sheet == NULL) { + goto error_free; + } +@@ -74,11 +74,11 @@ pdf_page_clear(zathura_page_t* page, mup + + if (mupdf_page != NULL) { + if (mupdf_page->text != NULL) { +- fz_drop_text_page(mupdf_page->ctx, mupdf_page->text); ++ fz_drop_stext_page(mupdf_page->ctx, mupdf_page->text); + } + + if (mupdf_page->sheet != NULL) { +- fz_drop_text_sheet(mupdf_page->ctx, mupdf_page->sheet); ++ fz_drop_stext_sheet(mupdf_page->ctx, mupdf_page->sheet); + } + + if (mupdf_page->page != NULL) { diff --git a/graphics/zathura-pdf-mupdf/files/patch-plugin.h b/graphics/zathura-pdf-mupdf/files/patch-plugin.h new file mode 100644 index 0000000..b32d537 --- /dev/null +++ b/graphics/zathura-pdf-mupdf/files/patch-plugin.h @@ -0,0 +1,13 @@ +--- plugin.h.orig 2016-02-14 22:49:46 UTC ++++ plugin.h +@@ -21,8 +21,8 @@ typedef struct mupdf_page_s + { + fz_page* page; /**< Reference to the mupdf page */ + fz_context* ctx; /**< Context */ +- fz_text_sheet* sheet; /**< Text sheet */ +- fz_text_page* text; /**< Page text */ ++ fz_stext_sheet* sheet; /**< Text sheet */ ++ fz_stext_page* text; /**< Page text */ + fz_rect bbox; /**< Bbox */ + bool extracted_text; /**< If text has already been extracted */ + } mupdf_page_t; diff --git a/graphics/zathura-pdf-mupdf/files/patch-search.c b/graphics/zathura-pdf-mupdf/files/patch-search.c new file mode 100644 index 0000000..a5918ae --- /dev/null +++ b/graphics/zathura-pdf-mupdf/files/patch-search.c @@ -0,0 +1,11 @@ +--- search.c.orig 2016-06-25 17:42:12 UTC ++++ search.c +@@ -40,7 +40,7 @@ pdf_page_search_text(zathura_page_t* pag + } + + fz_rect* hit_bbox = fz_malloc_array(mupdf_page->ctx, N_SEARCH_RESULTS, sizeof(fz_rect)); +- int num_results = fz_search_text_page(mupdf_page->ctx, mupdf_page->text, ++ int num_results = fz_search_stext_page(mupdf_page->ctx, mupdf_page->text, + (char*) text, hit_bbox, N_SEARCH_RESULTS); + + for (int i = 0; i < num_results; i++) { diff --git a/graphics/zathura-pdf-mupdf/files/patch-utils.c b/graphics/zathura-pdf-mupdf/files/patch-utils.c new file mode 100644 index 0000000..5e8ec1b --- /dev/null +++ b/graphics/zathura-pdf-mupdf/files/patch-utils.c @@ -0,0 +1,11 @@ +--- utils.c.orig 2016-06-25 17:44:43 UTC ++++ utils.c +@@ -14,7 +14,7 @@ mupdf_page_extract_text(mupdf_document_t + fz_device* text_device = NULL; + + fz_try (mupdf_page->ctx) { +- text_device = fz_new_text_device(mupdf_page->ctx, mupdf_page->sheet, mupdf_page->text); ++ text_device = fz_new_stext_device(mupdf_page->ctx, mupdf_page->sheet, mupdf_page->text); + + /* Disable FZ_IGNORE_IMAGE to collect image blocks */ + fz_disable_device_hints(mupdf_page->ctx, text_device, FZ_IGNORE_IMAGE); |