Wed Apr 27 12:38:45 2016 UTC ()
Add patches to adapt zathura-pdf-mupdf to the mupdf-1.9 API.
Bump PKGREVISION.
(leot)
diff -r1.4 -r1.5 pkgsrc/print/zathura-pdf-mupdf/Makefile
diff -r1.2 -r1.3 pkgsrc/print/zathura-pdf-mupdf/distinfo
diff -r1.1 -r1.2 pkgsrc/print/zathura-pdf-mupdf/patches/patch-document.c
diff -r0 -r1.1 pkgsrc/print/zathura-pdf-mupdf/patches/patch-image.c
diff -r0 -r1.1 pkgsrc/print/zathura-pdf-mupdf/patches/patch-page.c
diff -r0 -r1.1 pkgsrc/print/zathura-pdf-mupdf/patches/patch-plugin.h
diff -r0 -r1.1 pkgsrc/print/zathura-pdf-mupdf/patches/patch-search.c
diff -r0 -r1.1 pkgsrc/print/zathura-pdf-mupdf/patches/patch-utils.c
--- pkgsrc/print/zathura-pdf-mupdf/Makefile 2016/03/05 11:29:18 1.4
+++ pkgsrc/print/zathura-pdf-mupdf/Makefile 2016/04/27 12:38:45 1.5
| @@ -1,28 +1,28 @@ | | | @@ -1,28 +1,28 @@ |
1 | # $NetBSD: Makefile,v 1.4 2016/03/05 11:29:18 jperkin Exp $ | | 1 | # $NetBSD: Makefile,v 1.5 2016/04/27 12:38:45 leot Exp $ |
2 | # | | 2 | # |
3 | | | 3 | |
4 | DISTNAME= zathura-pdf-mupdf-0.3.0 | | 4 | DISTNAME= zathura-pdf-mupdf-0.3.0 |
5 | PKGREVISION= 1 | | 5 | PKGREVISION= 2 |
6 | CATEGORIES= print | | 6 | CATEGORIES= print |
7 | MASTER_SITES= http://pwmt.org/projects/zathura/plugins/download/ | | 7 | MASTER_SITES= http://pwmt.org/projects/zathura/plugins/download/ |
8 | | | 8 | |
9 | MAINTAINER= leot@NetBSD.org | | 9 | MAINTAINER= leot@NetBSD.org |
10 | HOMEPAGE= http://pwmt.org/projects/zathura-pdf-mupdf/ | | 10 | HOMEPAGE= http://pwmt.org/projects/zathura-pdf-mupdf/ |
11 | COMMENT= Add PDF support to zathura using mupdf rendering engine | | 11 | COMMENT= Add PDF support to zathura using mupdf rendering engine |
12 | LICENSE= zlib | | 12 | LICENSE= zlib |
13 | | | 13 | |
14 | CONFLICTS+= zathura-pdf-poppler-[0-9]* | | 14 | CONFLICTS+= zathura-pdf-poppler-[0-9]* |
15 | | | 15 | |
16 | USE_TOOLS+= pkg-config gmake | | 16 | USE_TOOLS+= pkg-config gmake |
17 | USE_LIBTOOL= yes | | 17 | USE_LIBTOOL= yes |
18 | | | 18 | |
19 | CPPFLAGS+= -D_XOPEN_SOURCE=600 | | 19 | CPPFLAGS+= -D_XOPEN_SOURCE=600 |
20 | | | 20 | |
21 | MAKE_ENV+= MUPDF_LIB="-lmupdf -lmujs" | | 21 | MAKE_ENV+= MUPDF_LIB="-lmupdf -lmupdfthird" |
22 | | | 22 | |
23 | .include "../../graphics/cairo/buildlink3.mk" | | 23 | .include "../../graphics/cairo/buildlink3.mk" |
24 | .include "../../print/mupdf/buildlink3.mk" | | 24 | .include "../../print/mupdf/buildlink3.mk" |
25 | .include "../../print/zathura/buildlink3.mk" | | 25 | .include "../../print/zathura/buildlink3.mk" |
26 | .include "../../sysutils/desktop-file-utils/desktopdb.mk" | | 26 | .include "../../sysutils/desktop-file-utils/desktopdb.mk" |
27 | .include "../../x11/gtk3/buildlink3.mk" | | 27 | .include "../../x11/gtk3/buildlink3.mk" |
28 | .include "../../mk/bsd.pkg.mk" | | 28 | .include "../../mk/bsd.pkg.mk" |
--- pkgsrc/print/zathura-pdf-mupdf/distinfo 2016/02/15 03:04:27 1.2
+++ pkgsrc/print/zathura-pdf-mupdf/distinfo 2016/04/27 12:38:45 1.3
| @@ -1,7 +1,12 @@ | | | @@ -1,7 +1,12 @@ |
1 | $NetBSD: distinfo,v 1.2 2016/02/15 03:04:27 leot Exp $ | | 1 | $NetBSD: distinfo,v 1.3 2016/04/27 12:38:45 leot Exp $ |
2 | | | 2 | |
3 | SHA1 (zathura-pdf-mupdf-0.3.0.tar.gz) = ae0be41ea7c75b8ddc083fe01f1366673ea9751a | | 3 | SHA1 (zathura-pdf-mupdf-0.3.0.tar.gz) = ae0be41ea7c75b8ddc083fe01f1366673ea9751a |
4 | RMD160 (zathura-pdf-mupdf-0.3.0.tar.gz) = 377e7848a5ea7f43f020e131aacc24c51453bf8f | | 4 | RMD160 (zathura-pdf-mupdf-0.3.0.tar.gz) = 377e7848a5ea7f43f020e131aacc24c51453bf8f |
5 | SHA512 (zathura-pdf-mupdf-0.3.0.tar.gz) = c83eef453176c6317be338260e311c39e049b8ae1ae719445c6303725b4e993758ed3f3a61f0af31032d09f1f2f03574f862d24e36b27fa38732e0b6c7aa18ea | | 5 | SHA512 (zathura-pdf-mupdf-0.3.0.tar.gz) = c83eef453176c6317be338260e311c39e049b8ae1ae719445c6303725b4e993758ed3f3a61f0af31032d09f1f2f03574f862d24e36b27fa38732e0b6c7aa18ea |
6 | Size (zathura-pdf-mupdf-0.3.0.tar.gz) = 9914 bytes | | 6 | Size (zathura-pdf-mupdf-0.3.0.tar.gz) = 9914 bytes |
7 | SHA1 (patch-document.c) = dfef8e98cf6f5fbe65a904c7d53c369775b9f1b1 | | 7 | SHA1 (patch-document.c) = a891f161ae4af2d5b3cb3b46b3c7f010fee2ee9c |
| | | 8 | SHA1 (patch-image.c) = 1b4c178832aca195d5d1ccacd283dc52fa4d823e |
| | | 9 | SHA1 (patch-page.c) = d60e89e0ef2c98b20d9ca02ae8cb68a2c434c8e8 |
| | | 10 | SHA1 (patch-plugin.h) = 4ec3e1510938f4bf7c10194ee7702666b1e18eb9 |
| | | 11 | SHA1 (patch-search.c) = 312d29bd2463df3bbbe4410f5f5fad07f9f04b93 |
| | | 12 | SHA1 (patch-utils.c) = 38d6717abad516ff007a7eb4f6f6d1d263385b4f |
--- pkgsrc/print/zathura-pdf-mupdf/patches/patch-document.c 2016/02/14 14:01:49 1.1
+++ pkgsrc/print/zathura-pdf-mupdf/patches/patch-document.c 2016/04/27 12:38:45 1.2
| @@ -1,15 +1,30 @@ | | | @@ -1,15 +1,30 @@ |
1 | $NetBSD: patch-document.c,v 1.1 2016/02/14 14:01:49 leot Exp $ | | 1 | $NetBSD: patch-document.c,v 1.2 2016/04/27 12:38:45 leot Exp $ |
2 | | | 2 | |
3 | Correct the glib-2.0 include header file path. | | 3 | o Correct the glib-2.0 include header file path. |
| | | 4 | o Update to mupdf-1.9 API |
4 | | | 5 | |
5 | --- document.c.orig 2015-12-22 22:38:09.000000000 +0000 | | 6 | --- document.c.orig 2016-02-14 22:49:46.000000000 +0000 |
6 | +++ document.c | | 7 | +++ document.c |
7 | @@ -6,7 +6,7 @@ | | 8 | @@ -6,7 +6,7 @@ |
8 | #include <mupdf/xps.h> | | 9 | #include <mupdf/xps.h> |
9 | #include <mupdf/pdf.h> | | 10 | #include <mupdf/pdf.h> |
10 | | | 11 | |
11 | -#include <glib-2.0/glib.h> | | 12 | -#include <glib-2.0/glib.h> |
12 | +#include <glib.h> | | 13 | +#include <glib.h> |
13 | | | 14 | |
14 | #include "plugin.h" | | 15 | #include "plugin.h" |
15 | | | 16 | |
| | | 17 | @@ -109,12 +109,7 @@ pdf_document_save_as(zathura_document_t* |
| | | 18 | } |
| | | 19 | |
| | | 20 | fz_try (mupdf_document->ctx) { |
| | | 21 | - /* fz_write_document claims to accepts NULL as third argument but doesn't. |
| | | 22 | - * pdf_write_document does not check if the third arguments is NULL for some |
| | | 23 | - * options. */ |
| | | 24 | - |
| | | 25 | - fz_write_options opts = { 0 }; /* just use the default options */ |
| | | 26 | - fz_write_document(mupdf_document->ctx, mupdf_document->document, (char*) path, &opts); |
| | | 27 | + pdf_save_document(mupdf_document->ctx, pdf_specifics(mupdf_document->ctx, mupdf_document->document), (char*) path, NULL); |
| | | 28 | } fz_catch (mupdf_document->ctx) { |
| | | 29 | return ZATHURA_ERROR_UNKNOWN; |
| | | 30 | } |
$NetBSD: patch-image.c,v 1.1 2016/04/27 12:38:45 leot Exp $
Update to mupdf-1.9 API.
--- image.c.orig 2016-02-14 22:49:46.000000000 +0000
+++ 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;
}
$NetBSD: patch-page.c,v 1.1 2016/04/27 12:38:45 leot Exp $
Update to mupdf-1.9 API.
--- page.c.orig 2016-02-14 22:49:46.000000000 +0000
+++ 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) {
$NetBSD: patch-plugin.h,v 1.1 2016/04/27 12:38:45 leot Exp $
Update to mupdf-1.9 API.
--- plugin.h.orig 2016-02-14 22:49:46.000000000 +0000
+++ 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;
$NetBSD: patch-search.c,v 1.1 2016/04/27 12:38:45 leot Exp $
Update to mupdf-1.9 API.
--- search.c.orig 2016-02-14 22:49:46.000000000 +0000
+++ 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++) {
$NetBSD: patch-utils.c,v 1.1 2016/04/27 12:38:45 leot Exp $
Update to mupdf-1.9 API.
--- utils.c.orig 2016-02-14 22:49:46.000000000 +0000
+++ 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);