aboutsummaryrefslogtreecommitdiff
path: root/graphics/zathura-pdf-mupdf
diff options
context:
space:
mode:
authorPawel Pekala <pawel@FreeBSD.org>2016-06-30 16:05:54 +0000
committerPawel Pekala <pawel@FreeBSD.org>2016-06-30 16:05:54 +0000
commit5557089bd7b992b8d1b909d800f8c45b1854847c (patch)
tree92265a88a3e858302207bee81bcc467361e31f24 /graphics/zathura-pdf-mupdf
parentb045ae83c37f9dd4b31af6e19698a9c01c1afd7f (diff)
downloadports-5557089bd7b992b8d1b909d800f8c45b1854847c.tar.gz
ports-5557089bd7b992b8d1b909d800f8c45b1854847c.zip
Notes
Diffstat (limited to 'graphics/zathura-pdf-mupdf')
-rw-r--r--graphics/zathura-pdf-mupdf/Makefile11
-rw-r--r--graphics/zathura-pdf-mupdf/files/patch-document.c13
-rw-r--r--graphics/zathura-pdf-mupdf/files/patch-image.c11
-rw-r--r--graphics/zathura-pdf-mupdf/files/patch-page.c31
-rw-r--r--graphics/zathura-pdf-mupdf/files/patch-plugin.h13
-rw-r--r--graphics/zathura-pdf-mupdf/files/patch-search.c11
-rw-r--r--graphics/zathura-pdf-mupdf/files/patch-utils.c11
7 files changed, 96 insertions, 5 deletions
diff --git a/graphics/zathura-pdf-mupdf/Makefile b/graphics/zathura-pdf-mupdf/Makefile
index ec64bab12246..bac3627384c9 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 000000000000..22817ce90c0b
--- /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 000000000000..5a504cae665b
--- /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 000000000000..23bf1fd7a69d
--- /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 000000000000..b32d53786579
--- /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 000000000000..a5918ae7bd68
--- /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 000000000000..5e8ec1b4c6c1
--- /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);