pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/print/zathura-pdf-mupdf zathura-pdf-mupdf: Update prin...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8fda39611b8e
branches:  trunk
changeset: 373624:8fda39611b8e
user:      leot <leot%pkgsrc.org@localhost>
date:      Sun Jan 07 13:01:32 2018 +0000

description:
zathura-pdf-mupdf: Update print/zathura-pdf-mupdf to 0.3.2

pkgsrc changes:
 - Remove patches/patch-image.c, patches/patch-index.c, patches/patch-page.c,
   patches/patch-plugin.h, patches/patch-render.c, patches/patch-select.c,
   patches/patch-utils.c . They were all applied upstream and no more needed.

Changes:
0.3.2
-----
* Compatible with mupdf 1.12
* Adapt to new plugin interface

diffstat:

 print/zathura-pdf-mupdf/Makefile               |   5 +-
 print/zathura-pdf-mupdf/distinfo               |  17 +----
 print/zathura-pdf-mupdf/patches/patch-image.c  |  35 ------------
 print/zathura-pdf-mupdf/patches/patch-index.c  |  29 ----------
 print/zathura-pdf-mupdf/patches/patch-page.c   |  75 --------------------------
 print/zathura-pdf-mupdf/patches/patch-plugin.h |  25 --------
 print/zathura-pdf-mupdf/patches/patch-render.c |  48 ----------------
 print/zathura-pdf-mupdf/patches/patch-select.c |  25 --------
 print/zathura-pdf-mupdf/patches/patch-utils.c  |  30 ----------
 9 files changed, 7 insertions(+), 282 deletions(-)

diffs (truncated from 332 to 300 lines):

diff -r b6ccba9ea62a -r 8fda39611b8e print/zathura-pdf-mupdf/Makefile
--- a/print/zathura-pdf-mupdf/Makefile  Sun Jan 07 13:01:05 2018 +0000
+++ b/print/zathura-pdf-mupdf/Makefile  Sun Jan 07 13:01:32 2018 +0000
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.21 2018/01/01 21:18:50 adam Exp $
+# $NetBSD: Makefile,v 1.22 2018/01/07 13:01:32 leot Exp $
 #
 
-DISTNAME=      zathura-pdf-mupdf-0.3.1
-PKGREVISION=   9
+DISTNAME=      zathura-pdf-mupdf-0.3.2
 CATEGORIES=    print
 MASTER_SITES=  https://pwmt.org/projects/zathura/plugins/download/
 
diff -r b6ccba9ea62a -r 8fda39611b8e print/zathura-pdf-mupdf/distinfo
--- a/print/zathura-pdf-mupdf/distinfo  Sun Jan 07 13:01:05 2018 +0000
+++ b/print/zathura-pdf-mupdf/distinfo  Sun Jan 07 13:01:32 2018 +0000
@@ -1,14 +1,7 @@
-$NetBSD: distinfo,v 1.7 2017/12/18 15:07:14 leot Exp $
+$NetBSD: distinfo,v 1.8 2018/01/07 13:01:32 leot Exp $
 
-SHA1 (zathura-pdf-mupdf-0.3.1.tar.gz) = ef37a181de96d6fca36db3ac818f790dcf3627ae
-RMD160 (zathura-pdf-mupdf-0.3.1.tar.gz) = 7497475ba55d2e7f96d23f378cbefeddd56089e4
-SHA512 (zathura-pdf-mupdf-0.3.1.tar.gz) = 87b5b8a750a6911be37a0195b0f4bc3304350f9d29173091b3eeece40350b10cb98b009b2722a69ae1e617b4242292f3eba17fea97d5276e485069180f2bd67d
-Size (zathura-pdf-mupdf-0.3.1.tar.gz) = 9755 bytes
+SHA1 (zathura-pdf-mupdf-0.3.2.tar.gz) = b33c7ec1ac3cf2ee575b7cc1eae611f00b9ba8d7
+RMD160 (zathura-pdf-mupdf-0.3.2.tar.gz) = 44aab38d9052a54c31674ac68d9301c52b8f907a
+SHA512 (zathura-pdf-mupdf-0.3.2.tar.gz) = f6273923d0c1d7f6fad5cc3369c35fff9f87dabcb726d5ab4f814775f5e8783c552cbac7ad1381f3c6d91753698d64a96c7e76e0b8b5a16d9c28147fbdeb3089
+Size (zathura-pdf-mupdf-0.3.2.tar.gz) = 9687 bytes
 SHA1 (patch-document.c) = b4695700ffc3a85667a292af059d0af58b3150f1
-SHA1 (patch-image.c) = 65fee62ddeddf5329a9eeb868b39f26c9232f759
-SHA1 (patch-index.c) = 96022a5e5c6152e56cecad8f47c4893419536c83
-SHA1 (patch-page.c) = adbe5766d39befdde4aed0a937ff96312921eb2f
-SHA1 (patch-plugin.h) = 1e93cac827843be7a5caf887c5c3381ad16388f4
-SHA1 (patch-render.c) = 000477afe5286eb6e183cc87864c06f3f73ad8f2
-SHA1 (patch-select.c) = 5b6505ad998e1980a6cfa4dc0484f0707ea9799a
-SHA1 (patch-utils.c) = 870c37dfd7c359ad1e9891a75e9afc71ac3c36c7
diff -r b6ccba9ea62a -r 8fda39611b8e print/zathura-pdf-mupdf/patches/patch-image.c
--- a/print/zathura-pdf-mupdf/patches/patch-image.c     Sun Jan 07 13:01:05 2018 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-$NetBSD: patch-image.c,v 1.4 2017/12/18 15:07:14 leot Exp $
-
-Updated for MuPDF 1.12.0
-
-Backport from upstream, commit a3f703788f77b19bb986e14666fe0c47911adddc.
-
---- image.c.orig       2017-01-11 21:21:14.000000000 +0000
-+++ image.c
-@@ -43,18 +43,16 @@ pdf_page_images_get(zathura_page_t* page
-   /* Extract images */
-   mupdf_page_extract_text(mupdf_document, mupdf_page);
- 
--  fz_page_block* block;
--  for (block = mupdf_page->text->blocks; block < mupdf_page->text->blocks + mupdf_page->text->len; block++) {
--    if (block->type == FZ_PAGE_BLOCK_IMAGE) {
--      fz_image_block *image_block = block->u.image;
--
-+  fz_stext_block* block;
-+  for (block = mupdf_page->text->first_block; block; block = block->next) {
-+    if (block->type == FZ_STEXT_BLOCK_IMAGE) {
-       zathura_image_t* zathura_image = g_malloc(sizeof(zathura_image_t));
- 
--      zathura_image->position.x1 = image_block->bbox.x0;
--      zathura_image->position.y1 = image_block->bbox.y0;
--      zathura_image->position.x2 = image_block->bbox.x1;
--      zathura_image->position.y2 = image_block->bbox.y1;
--      zathura_image->data        = image_block->image;
-+      zathura_image->position.x1 = block->bbox.x0;
-+      zathura_image->position.y1 = block->bbox.y0;
-+      zathura_image->position.x2 = block->bbox.x1;
-+      zathura_image->position.y2 = block->bbox.y1;
-+      zathura_image->data        = block->u.i.image;
- 
-       girara_list_append(list, zathura_image);
-     }
diff -r b6ccba9ea62a -r 8fda39611b8e print/zathura-pdf-mupdf/patches/patch-index.c
--- a/print/zathura-pdf-mupdf/patches/patch-index.c     Sun Jan 07 13:01:05 2018 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-$NetBSD: patch-index.c,v 1.4 2017/12/18 15:07:14 leot Exp $
-
-index: handle outline entries with no URI
-
-Some PDFs (such as [1]) cause mupdf to return outline elements with a
-NULL uri element, which causes a NULL pointer dereference to happen in
-fz_is_external_link.
-
-Catch this case, but still create a dummy entry in the outline.
-
-[1] http://www.st.com/resource/en/reference_manual/dm00093941.pdf
-
-Signed-off-by: Florian Larysch <fl%n621.de@localhost>
-
-Backported from upstream, commit 74deda65003386df216c7c0343c86d95c866f5e1.
-
---- index.c.orig       2017-01-11 21:21:14.000000000 +0000
-+++ index.c
-@@ -51,7 +51,9 @@ build_index(fz_context* ctx, fz_document
-     zathura_link_type_t type               = ZATHURA_LINK_INVALID;
-     zathura_rectangle_t rect               = { .x1 = 0, .y1 = 0, .x2 = 0, .y2 = 0 };
- 
--    if (fz_is_external_link(ctx, outline->uri) == 1) {
-+    if (outline->uri == NULL) {
-+      type = ZATHURA_LINK_NONE;
-+    } else if (fz_is_external_link(ctx, outline->uri) == 1) {
-       if (strstr(outline->uri, "file://") == outline->uri) {
-         type         = ZATHURA_LINK_GOTO_REMOTE;
-         target.value = outline->uri;
diff -r b6ccba9ea62a -r 8fda39611b8e print/zathura-pdf-mupdf/patches/patch-page.c
--- a/print/zathura-pdf-mupdf/patches/patch-page.c      Sun Jan 07 13:01:05 2018 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-$NetBSD: patch-page.c,v 1.4 2017/12/18 15:07:14 leot Exp $
-
-- Fix double free in pdf_page_init()
-  
-  In case of failure in 'pdf_page_init', the mupdf_page is being cleared
-  and freed but the zathura_page still holds a pointer to it, resulting
-  in a double free when 'pdf_page_clear' is later called.
-  
-  The execution flow resulting in a double free is the following:
-    zathura_page_new()
-      pdf_page_init()
-        zathura_page_set_data()
-        failure of fz_load_page(),fz_bound_page() or fz_new_stext_sheet()
-        pdf_page_clear()
-      zathura_page_free()
-        pdf_page_clear() // double free
-  
-  Make sure 'zathura_page_set_data' is called only if no errors occurred
-  so that page->data never points to freed memory.
-  
-  Backported from upstream, commit 83b3f9e77bb6aedfa6b4fffc1088c25ae209fd81.
-
-- Updated for MuPDF 1.12.0
-  
-  Backport from upstream, commit a3f703788f77b19bb986e14666fe0c47911adddc.
-
---- page.c.orig        2017-12-18 10:17:58.832972588 +0000
-+++ page.c
-@@ -20,8 +20,6 @@ pdf_page_init(zathura_page_t* page)
-     return  ZATHURA_ERROR_OUT_OF_MEMORY;
-   }
- 
--  zathura_page_set_data(page, mupdf_page);
--
-   mupdf_page->ctx = mupdf_document->ctx;
-   if (mupdf_page->ctx == NULL) {
-     goto error_free;
-@@ -36,10 +34,6 @@ pdf_page_init(zathura_page_t* page)
- 
-   fz_bound_page(mupdf_document->ctx, (fz_page*) mupdf_page->page, &mupdf_page->bbox);
- 
--  /* get page dimensions */
--  zathura_page_set_width(page,  mupdf_page->bbox.x1 - mupdf_page->bbox.x0);
--  zathura_page_set_height(page, mupdf_page->bbox.y1 - mupdf_page->bbox.y0);
--
-   /* setup text */
-   mupdf_page->extracted_text = false;
- 
-@@ -50,10 +44,11 @@ pdf_page_init(zathura_page_t* page)
-     goto error_free;
-   }
- 
--  mupdf_page->sheet = fz_new_stext_sheet(mupdf_page->ctx);
--  if (mupdf_page->sheet == NULL) {
--    goto error_free;
--  }
-+  zathura_page_set_data(page, mupdf_page);
-+
-+  /* get page dimensions */
-+  zathura_page_set_width(page,  mupdf_page->bbox.x1 - mupdf_page->bbox.x0);
-+  zathura_page_set_height(page, mupdf_page->bbox.y1 - mupdf_page->bbox.y0);
- 
-   return ZATHURA_ERROR_OK;
- 
-@@ -79,10 +74,6 @@ pdf_page_clear(zathura_page_t* page, mup
-       fz_drop_stext_page(mupdf_page->ctx, mupdf_page->text);
-     }
- 
--    if (mupdf_page->sheet != NULL) {
--      fz_drop_stext_sheet(mupdf_page->ctx, mupdf_page->sheet);
--    }
--
-     if (mupdf_page->page != NULL) {
-       fz_drop_page(mupdf_document->ctx, mupdf_page->page);
-     }
diff -r b6ccba9ea62a -r 8fda39611b8e print/zathura-pdf-mupdf/patches/patch-plugin.h
--- a/print/zathura-pdf-mupdf/patches/patch-plugin.h    Sun Jan 07 13:01:05 2018 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-$NetBSD: patch-plugin.h,v 1.4 2017/12/18 15:07:14 leot Exp $
-
-Updated for MuPDF 1.12.0
-
-Backport from upstream, commit a3f703788f77b19bb986e14666fe0c47911adddc.
-
---- plugin.h.orig      2017-01-11 21:21:14.000000000 +0000
-+++ plugin.h
-@@ -3,6 +3,8 @@
- #ifndef PDF_H
- #define PDF_H
- 
-+#include <stdlib.h>
-+#include <string.h>
- #include <stdbool.h>
- #include <zathura/plugin-api.h>
- #include <mupdf/fitz.h>
-@@ -21,7 +23,6 @@ typedef struct mupdf_page_s
- {
-   fz_page* page; /**< Reference to the mupdf page */
-   fz_context* ctx; /**< Context */
--  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 */
diff -r b6ccba9ea62a -r 8fda39611b8e print/zathura-pdf-mupdf/patches/patch-render.c
--- a/print/zathura-pdf-mupdf/patches/patch-render.c    Sun Jan 07 13:01:05 2018 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-$NetBSD: patch-render.c,v 1.5 2017/12/18 15:07:14 leot Exp $
-
-- Close device.
-
-  Every fz_drop_device() need a corresponding fz_close_device().
-  
-  This fixes the:
-  
-   warning: dropping unclosed device
-   warning: ... repeated <n> times ..
-  
-  warnings.
-
-  Backport from upstream, commit 622b35440d708a187add31adab8bca747c11d2a8.
-  
-- Updated for MuPDF 1.12.0
-  
-  Backport from upstream, commit a3f703788f77b19bb986e14666fe0c47911adddc.
-
---- render.c.orig      2017-01-11 21:21:14.000000000 +0000
-+++ render.c
-@@ -31,21 +31,25 @@ pdf_page_render_to_buffer(mupdf_document
-     return ZATHURA_ERROR_UNKNOWN;
-   }
- 
-+  fz_close_device(mupdf_page->ctx, device);
-   fz_drop_device(mupdf_page->ctx, device);
- 
-   fz_irect irect = { .x1 = page_width, .y1 = page_height };
-   fz_rect rect = { .x1 = page_width, .y1 = page_height };
- 
-   fz_colorspace* colorspace = fz_device_bgr(mupdf_document->ctx);
--  fz_pixmap* pixmap = fz_new_pixmap_with_bbox_and_data(mupdf_page->ctx, colorspace, &irect, 1, image);
-+  fz_separations* seps= fz_page_separations(mupdf_page->ctx, mupdf_page->page);
-+  fz_pixmap* pixmap = fz_new_pixmap_with_bbox_and_data(mupdf_page->ctx, colorspace, &irect, seps, 1, image);
-   fz_clear_pixmap_with_value(mupdf_page->ctx, pixmap, 0xFF);
- 
-   device = fz_new_draw_device(mupdf_page->ctx, NULL, pixmap);
-   fz_run_display_list(mupdf_page->ctx, display_list, device, &fz_identity, &rect, NULL);
-+  fz_close_device(mupdf_page->ctx, device);
-   fz_drop_device(mupdf_page->ctx, device);
- 
-   fz_drop_pixmap(mupdf_page->ctx, pixmap);
-   fz_drop_display_list(mupdf_page->ctx, display_list);
-+  fz_drop_separations(mupdf_page->ctx, seps);
- 
-   return ZATHURA_ERROR_OK;
- }
diff -r b6ccba9ea62a -r 8fda39611b8e print/zathura-pdf-mupdf/patches/patch-select.c
--- a/print/zathura-pdf-mupdf/patches/patch-select.c    Sun Jan 07 13:01:05 2018 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-$NetBSD: patch-select.c,v 1.1 2017/12/18 15:07:14 leot Exp $
-
-Updated for MuPDF 1.12.0
-
-Backport from upstream, commit a3f703788f77b19bb986e14666fe0c47911adddc.
-
---- select.c.orig      2017-01-11 21:21:14.000000000 +0000
-+++ select.c
-@@ -24,9 +24,14 @@ pdf_page_get_text(zathura_page_t* page, 
-     mupdf_page_extract_text(mupdf_document, mupdf_page);
-   }
- 
--  fz_rect rect = { rectangle.x1, rectangle.y1, rectangle.x2, rectangle.y2 };
-+  fz_point a = { rectangle.x1, rectangle.y1 };
-+  fz_point b = { rectangle.x2, rectangle.y2 };
- 
--  return fz_copy_selection(mupdf_page->ctx, mupdf_page->text, rect);
-+#ifdef _WIN32
-+  return fz_copy_selection(mupdf_page->ctx, mupdf_page->text, a, b, 1);
-+#else
-+  return fz_copy_selection(mupdf_page->ctx, mupdf_page->text, a, b, 0);
-+#endif
- 
- error_ret:
- 
diff -r b6ccba9ea62a -r 8fda39611b8e print/zathura-pdf-mupdf/patches/patch-utils.c
--- a/print/zathura-pdf-mupdf/patches/patch-utils.c     Sun Jan 07 13:01:05 2018 +0000



Home | Main Index | Thread Index | Old Index