Index: Makefile =================================================================== --- Makefile (revision 417396) +++ Makefile (working copy) @@ -3,6 +3,7 @@ PORTNAME= llpp PORTVERSION= 22 +PORTREVISION= 2 CATEGORIES= graphics MASTER_SITES= http://repo.or.cz/llpp.git/snapshot/ DISTNAME= 561dc5673cea431e930668b0d87b0c4b31a36b39 @@ -23,12 +24,13 @@ ${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 Index: files/patch-build.sh =================================================================== --- files/patch-build.sh (revision 417396) +++ files/patch-build.sh (working copy) @@ -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" Index: files/patch-glfont.c =================================================================== --- files/patch-glfont.c (nonexistent) +++ files/patch-glfont.c (working copy) @@ -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; Property changes on: files/patch-glfont.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: files/patch-link.c =================================================================== --- files/patch-link.c (revision 417396) +++ files/patch-link.c (working copy) @@ -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); + Index: files/patch-misc_llppac =================================================================== --- files/patch-misc_llppac (revision 417396) +++ files/patch-misc_llppac (working copy) @@ -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 Index: pkg-message =================================================================== --- pkg-message (revision 417396) +++ pkg-message (working copy) @@ -11,6 +11,4 @@ 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.