View | Details | Raw Unified | Return to bug 210398 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-4 / +6 lines)
Lines 3-8 Link Here
3
3
4
PORTNAME=	zathura-pdf-mupdf
4
PORTNAME=	zathura-pdf-mupdf
5
PORTVERSION=	0.3.0
5
PORTVERSION=	0.3.0
6
PORTREVISION=	1
6
CATEGORIES=	graphics
7
CATEGORIES=	graphics
7
MASTER_SITES=	http://pwmt.org/projects/zathura-pdf-mupdf/download/
8
MASTER_SITES=	http://pwmt.org/projects/zathura-pdf-mupdf/download/
8
9
Lines 16-29 Link Here
16
		mupdf>=1.8,1:graphics/mupdf
17
		mupdf>=1.8,1:graphics/mupdf
17
RUN_DEPENDS=	zathura:graphics/zathura
18
RUN_DEPENDS=	zathura:graphics/zathura
18
LIB_DEPENDS=	libjbig2dec.so:graphics/jbig2dec \
19
LIB_DEPENDS=	libjbig2dec.so:graphics/jbig2dec \
19
		libopenjp2.so:graphics/openjpeg
20
		libopenjp2.so:graphics/openjpeg \
21
		libgirara-gtk3.so:x11-toolkits/girara
20
22
21
PLIST_FILES=	lib/zathura/pdf.so share/applications/zathura-pdf-mupdf.desktop
23
PLIST_FILES=	lib/zathura/pdf.so share/applications/zathura-pdf-mupdf.desktop
22
24
23
MAKE_ARGS=	MUPDF_LIB=-lmupdf_pic OPENSSL_INC=-I${OPENSSLINC} \
25
MAKE_ARGS=	MUPDF_LIB="-lmupdf_pic -lmupdfthird_pic" OPENSSL_INC=-I${OPENSSLINC} \
24
		OPENSSL_LIB="-L${OPENSSLLIB} -lcrypto"
26
		OPENSSL_LIB="-L${OPENSSLLIB} -lcrypto"
25
USES=		compiler:c11 desktop-file-utils gmake pkgconfig
27
USES=		compiler:c11 desktop-file-utils gmake gettext jpeg pkgconfig
26
USE_GNOME=	glib20 gtk30
28
USE_GNOME=	cairo gdkpixbuf2 glib20 gtk30
27
USE_OPENSSL=	yes
29
USE_OPENSSL=	yes
28
30
29
CONFLICTS_INSTALL=	zathura-pdf-poppler-[0-9]*
31
CONFLICTS_INSTALL=	zathura-pdf-poppler-[0-9]*
(-)files/patch-document.c (+22 lines)
Line 0 Link Here
1
--- document.c.orig	2016-02-14 22:49:46 UTC
2
+++ document.c
3
@@ -109,12 +109,16 @@ pdf_document_save_as(zathura_document_t*
4
   }
5
 
6
   fz_try (mupdf_document->ctx) {
7
-    /* fz_write_document claims to accepts NULL as third argument but doesn't.
8
+    /* fz_save_document claims to accepts NULL as third argument but doesn't.
9
      * pdf_write_document does not check if the third arguments is NULL for some
10
      * options. */
11
 
12
-    fz_write_options opts = { 0 }; /* just use the default options */
13
-    fz_write_document(mupdf_document->ctx, mupdf_document->document, (char*) path, &opts);
14
+    pdf_write_options opts = { 0 }; /* just use the default options */
15
+    pdf_document *pdf = pdf_specifics(mupdf_document->ctx, mupdf_document->document);
16
+    if (!pdf) {
17
+       return ZATHURA_ERROR_UNKNOWN;
18
+    }
19
+    pdf_save_document(mupdf_document->ctx, pdf, (char*) path, &opts);
20
   } fz_catch (mupdf_document->ctx) {
21
     return ZATHURA_ERROR_UNKNOWN;
22
   }
(-)files/patch-image.c (+11 lines)
Line 0 Link Here
1
--- image.c.orig	2016-06-24 13:57:02 UTC
2
+++ image.c
3
@@ -93,7 +93,7 @@ pdf_page_image_get_cairo(zathura_page_t*
4
   fz_pixmap* pixmap = NULL;
5
   cairo_surface_t* surface = NULL;
6
 
7
-  pixmap = fz_new_pixmap_from_image(mupdf_page->ctx, mupdf_image, 0, 0);
8
+  pixmap = fz_get_pixmap_from_image(mupdf_page->ctx, mupdf_image, 0, 0);
9
   if (pixmap == NULL) {
10
     goto error_free;
11
   }
(-)files/patch-page.c (+31 lines)
Line 0 Link Here
1
--- page.c.orig	2016-02-14 22:49:46 UTC
2
+++ page.c
3
@@ -43,12 +43,12 @@ pdf_page_init(zathura_page_t* page)
4
   /* setup text */
5
   mupdf_page->extracted_text = false;
6
 
7
-  mupdf_page->text = fz_new_text_page(mupdf_page->ctx);
8
+  mupdf_page->text = fz_new_stext_page(mupdf_page->ctx);
9
   if (mupdf_page->text == NULL) {
10
     goto error_free;
11
   }
12
 
13
-  mupdf_page->sheet = fz_new_text_sheet(mupdf_page->ctx);
14
+  mupdf_page->sheet = fz_new_stext_sheet(mupdf_page->ctx);
15
   if (mupdf_page->sheet == NULL) {
16
     goto error_free;
17
   }
18
@@ -74,11 +74,11 @@ pdf_page_clear(zathura_page_t* page, mup
19
 
20
   if (mupdf_page != NULL) {
21
     if (mupdf_page->text != NULL) {
22
-      fz_drop_text_page(mupdf_page->ctx, mupdf_page->text);
23
+      fz_drop_stext_page(mupdf_page->ctx, mupdf_page->text);
24
     }
25
 
26
     if (mupdf_page->sheet != NULL) {
27
-      fz_drop_text_sheet(mupdf_page->ctx, mupdf_page->sheet);
28
+      fz_drop_stext_sheet(mupdf_page->ctx, mupdf_page->sheet);
29
     }
30
 
31
     if (mupdf_page->page != NULL) {
(-)files/patch-plugin.h (+13 lines)
Line 0 Link Here
1
--- plugin.h.orig	2016-02-14 22:49:46 UTC
2
+++ plugin.h
3
@@ -21,8 +21,8 @@ typedef struct mupdf_page_s
4
 {
5
   fz_page* page; /**< Reference to the mupdf page */
6
   fz_context* ctx; /**< Context */
7
-  fz_text_sheet* sheet; /**< Text sheet */
8
-  fz_text_page* text; /**< Page text */
9
+  fz_stext_sheet* sheet; /**< Text sheet */
10
+  fz_stext_page* text; /**< Page text */
11
   fz_rect bbox; /**< Bbox */
12
   bool extracted_text; /**< If text has already been extracted */
13
 } mupdf_page_t;
(-)files/patch-search.c (+11 lines)
Line 0 Link Here
1
--- search.c.orig	2016-02-14 22:49:46 UTC
2
+++ search.c
3
@@ -40,7 +40,7 @@ pdf_page_search_text(zathura_page_t* pag
4
   }
5
 
6
   fz_rect* hit_bbox = fz_malloc_array(mupdf_page->ctx, N_SEARCH_RESULTS, sizeof(fz_rect));
7
-  int num_results = fz_search_text_page(mupdf_page->ctx, mupdf_page->text,
8
+  int num_results = fz_search_stext_page(mupdf_page->ctx, mupdf_page->text,
9
       (char*) text, hit_bbox, N_SEARCH_RESULTS);
10
 
11
   for (int i = 0; i < num_results; i++) {
(-)files/patch-utils.c (+11 lines)
Line 0 Link Here
1
--- utils.c.orig	2016-02-14 22:49:46 UTC
2
+++ utils.c
3
@@ -14,7 +14,7 @@ mupdf_page_extract_text(mupdf_document_t
4
   fz_device* text_device = NULL;
5
 
6
   fz_try (mupdf_page->ctx) {
7
-    text_device = fz_new_text_device(mupdf_page->ctx, mupdf_page->sheet, mupdf_page->text);
8
+    text_device = fz_new_stext_device(mupdf_page->ctx, mupdf_page->sheet, mupdf_page->text);
9
 
10
     /* Disable FZ_IGNORE_IMAGE to collect image blocks */
11
     fz_disable_device_hints(mupdf_page->ctx, text_device, FZ_IGNORE_IMAGE);

Return to bug 210398