pkgsrc-WIP-changes archive

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

zathura-pdf-mupdf: Revert all my WIP patches



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Mon Dec 18 10:40:05 2017 +0100
Changeset:	3670e782b16b9335dab7314362d233f3aee05908

Modified Files:
	zathura-pdf-mupdf/TODO
	zathura-pdf-mupdf/distinfo
	zathura-pdf-mupdf/patches/patch-document.c
	zathura-pdf-mupdf/patches/patch-index.c
	zathura-pdf-mupdf/patches/patch-links.c
Removed Files:
	zathura-pdf-mupdf/patches/patch-image.c
	zathura-pdf-mupdf/patches/patch-page.c
	zathura-pdf-mupdf/patches/patch-plugin.h
	zathura-pdf-mupdf/patches/patch-render.c
	zathura-pdf-mupdf/patches/patch-select.c
	zathura-pdf-mupdf/patches/patch-utils.c

Log Message:
zathura-pdf-mupdf: Revert all my WIP patches

Just few hours ago on upstream `develop' branch the commit a3f70378 authored by
Pavel Vinogradov update that (and probably without introducing my bugs!),
document that in TODO and revert all my WIP patches to prepare to reuse the
Pavel's ones!

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=3670e782b16b9335dab7314362d233f3aee05908

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 zathura-pdf-mupdf/TODO                     |  4 ++--
 zathura-pdf-mupdf/distinfo                 | 12 +++-------
 zathura-pdf-mupdf/patches/patch-document.c |  8 +------
 zathura-pdf-mupdf/patches/patch-image.c    | 31 -------------------------
 zathura-pdf-mupdf/patches/patch-index.c    | 11 +--------
 zathura-pdf-mupdf/patches/patch-links.c    | 11 +--------
 zathura-pdf-mupdf/patches/patch-page.c     | 36 ------------------------------
 zathura-pdf-mupdf/patches/patch-plugin.h   | 12 ----------
 zathura-pdf-mupdf/patches/patch-render.c   | 13 -----------
 zathura-pdf-mupdf/patches/patch-select.c   | 17 --------------
 zathura-pdf-mupdf/patches/patch-utils.c    | 24 --------------------
 11 files changed, 8 insertions(+), 171 deletions(-)

diffs:
diff --git a/zathura-pdf-mupdf/TODO b/zathura-pdf-mupdf/TODO
index f219235bfa..7fb2a6bb92 100644
--- a/zathura-pdf-mupdf/TODO
+++ b/zathura-pdf-mupdf/TODO
@@ -1,2 +1,2 @@
-- Comment all the new patches
-- Still not stable, the patches need to be revised and adjusted.
+- Backport commit a3f70378 by Pavel Vinogradov to adjust zathura-pdf-mupdf
+  for the MuPDF 1.12.0
diff --git a/zathura-pdf-mupdf/distinfo b/zathura-pdf-mupdf/distinfo
index 9dc73a97c1..e762ac6ff3 100644
--- a/zathura-pdf-mupdf/distinfo
+++ b/zathura-pdf-mupdf/distinfo
@@ -4,12 +4,6 @@ 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 (patch-document.c) = dc12f3ec7d9cff6476e79540abbe9944cb280b4e
-SHA1 (patch-image.c) = b4afbd50638ed3738dd745a34659663fdfc22abd
-SHA1 (patch-index.c) = 87b67c5b9bbb2fbf184f966dc37e90d25978e10c
-SHA1 (patch-links.c) = ce2c1b3dfd5c6469bf64800c43bbdd15c75ddcbb
-SHA1 (patch-page.c) = d5e0125057bcc643e54ffdad64a6fdfbe062473f
-SHA1 (patch-plugin.h) = 686d313995cb29ba634f37cf969d8c3d3644700a
-SHA1 (patch-render.c) = f961f74b1daeca88a742c716fa7deed8c71d5ae8
-SHA1 (patch-select.c) = e3dbd7c8fc4d271fc1a9f159b35c34f874ff75a3
-SHA1 (patch-utils.c) = 511b1e7f648d5ed484d6c45d1ebb9af43a58b840
+SHA1 (patch-document.c) = b4695700ffc3a85667a292af059d0af58b3150f1
+SHA1 (patch-index.c) = fbf31d17bbf979a74160db6d6838a11ce47d37f1
+SHA1 (patch-links.c) = 58581cbe1468ddf9c0e5a58e80c16586977be49b
diff --git a/zathura-pdf-mupdf/patches/patch-document.c b/zathura-pdf-mupdf/patches/patch-document.c
index 8bcd7bf4b3..5b0e79e3b1 100644
--- a/zathura-pdf-mupdf/patches/patch-document.c
+++ b/zathura-pdf-mupdf/patches/patch-document.c
@@ -4,13 +4,7 @@ Correct the glib-2.0 include header file path.
 
 --- document.c.orig	2017-01-11 21:21:14.000000000 +0000
 +++ document.c
-@@ -2,10 +2,13 @@
- 
- #define _POSIX_C_SOURCE 1
- 
-+#include <stdlib.h>
-+#include <string.h>
-+
+@@ -5,7 +5,7 @@
  #include <mupdf/fitz.h>
  #include <mupdf/pdf.h>
  
diff --git a/zathura-pdf-mupdf/patches/patch-image.c b/zathura-pdf-mupdf/patches/patch-image.c
deleted file mode 100644
index b4e8e7fba5..0000000000
--- a/zathura-pdf-mupdf/patches/patch-image.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD$
-
---- 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 --git a/zathura-pdf-mupdf/patches/patch-index.c b/zathura-pdf-mupdf/patches/patch-index.c
index cf418a96f0..bf49be7367 100644
--- a/zathura-pdf-mupdf/patches/patch-index.c
+++ b/zathura-pdf-mupdf/patches/patch-index.c
@@ -4,16 +4,7 @@ Avoid possible NULL-pointer dereference.
 
 --- index.c.orig	2017-01-11 21:21:14.000000000 +0000
 +++ index.c
-@@ -2,6 +2,8 @@
- 
- #define _POSIX_C_SOURCE 1
- 
-+#include <string.h>
-+
- #include <girara/datastructures.h>
- 
- #include "plugin.h"
-@@ -51,24 +53,26 @@ build_index(fz_context* ctx, fz_document
+@@ -51,24 +51,26 @@ 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 };
  
diff --git a/zathura-pdf-mupdf/patches/patch-links.c b/zathura-pdf-mupdf/patches/patch-links.c
index f9cdd83a4d..721f834064 100644
--- a/zathura-pdf-mupdf/patches/patch-links.c
+++ b/zathura-pdf-mupdf/patches/patch-links.c
@@ -4,16 +4,7 @@ Avoid possible NULL-pointer dereference.
 
 --- links.c.orig	2017-01-11 21:21:14.000000000 +0000
 +++ links.c
-@@ -2,6 +2,8 @@
- 
- #define _POSIX_C_SOURCE 1
- 
-+#include <string.h>
-+
- #include <glib.h>
- 
- #include "plugin.h"
-@@ -43,25 +45,27 @@ pdf_page_links_get(zathura_page_t* page,
+@@ -43,25 +43,27 @@ pdf_page_links_get(zathura_page_t* page,
      zathura_link_type_t type     = ZATHURA_LINK_INVALID;
      zathura_link_target_t target = { 0 };
  
diff --git a/zathura-pdf-mupdf/patches/patch-page.c b/zathura-pdf-mupdf/patches/patch-page.c
deleted file mode 100644
index 1f99e39afc..0000000000
--- a/zathura-pdf-mupdf/patches/patch-page.c
+++ /dev/null
@@ -1,36 +0,0 @@
-$NetBSD$
-
---- page.c.orig	2017-01-11 21:21:14.000000000 +0000
-+++ page.c
-@@ -2,6 +2,8 @@
- 
- #define _POSIX_C_SOURCE 1
- 
-+#include <stdlib.h>
-+
- #include "plugin.h"
- 
- zathura_error_t
-@@ -50,11 +52,6 @@ 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;
--  }
--
-   return ZATHURA_ERROR_OK;
- 
- error_free:
-@@ -79,10 +76,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 --git a/zathura-pdf-mupdf/patches/patch-plugin.h b/zathura-pdf-mupdf/patches/patch-plugin.h
deleted file mode 100644
index eb902dadb0..0000000000
--- a/zathura-pdf-mupdf/patches/patch-plugin.h
+++ /dev/null
@@ -1,12 +0,0 @@
-$NetBSD$
-
---- plugin.h.orig	2017-01-11 21:21:14.000000000 +0000
-+++ plugin.h
-@@ -21,7 +21,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 --git a/zathura-pdf-mupdf/patches/patch-render.c b/zathura-pdf-mupdf/patches/patch-render.c
deleted file mode 100644
index 40707cc24c..0000000000
--- a/zathura-pdf-mupdf/patches/patch-render.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD$
-
---- render.c.orig	2017-01-11 21:21:14.000000000 +0000
-+++ render.c
-@@ -37,7 +37,7 @@ pdf_page_render_to_buffer(mupdf_document
-   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_pixmap* pixmap = fz_new_pixmap_with_bbox_and_data(mupdf_page->ctx, colorspace, &irect, NULL, 1, image);
-   fz_clear_pixmap_with_value(mupdf_page->ctx, pixmap, 0xFF);
- 
-   device = fz_new_draw_device(mupdf_page->ctx, NULL, pixmap);
diff --git a/zathura-pdf-mupdf/patches/patch-select.c b/zathura-pdf-mupdf/patches/patch-select.c
deleted file mode 100644
index 9fda902db3..0000000000
--- a/zathura-pdf-mupdf/patches/patch-select.c
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD$
-
---- select.c.orig	2017-01-11 21:21:14.000000000 +0000
-+++ select.c
-@@ -24,9 +24,10 @@ 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);
-+  return fz_copy_selection(mupdf_page->ctx, mupdf_page->text, a, b, 0);
- 
- error_ret:
- 
diff --git a/zathura-pdf-mupdf/patches/patch-utils.c b/zathura-pdf-mupdf/patches/patch-utils.c
deleted file mode 100644
index 7f0fcfa4a6..0000000000
--- a/zathura-pdf-mupdf/patches/patch-utils.c
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD$
-
---- utils.c.orig	2017-01-11 21:21:14.000000000 +0000
-+++ utils.c
-@@ -7,17 +7,14 @@
- void
- mupdf_page_extract_text(mupdf_document_t* mupdf_document, mupdf_page_t* mupdf_page) {
-   if (mupdf_document == NULL || mupdf_document->ctx == NULL || mupdf_page == NULL ||
--      mupdf_page->sheet == NULL || mupdf_page->text == NULL) {
-+      mupdf_page->text == NULL) {
-     return;
-   }
- 
-   fz_device* text_device = NULL;
- 
-   fz_try (mupdf_page->ctx) {
--    text_device = fz_new_stext_device(mupdf_page->ctx, mupdf_page->sheet, mupdf_page->text, NULL);
--
--    /* Disable FZ_IGNORE_IMAGE to collect image blocks */
--    fz_disable_device_hints(mupdf_page->ctx, text_device, FZ_IGNORE_IMAGE);
-+    text_device = fz_new_stext_device(mupdf_page->ctx, mupdf_page->text, NULL);
- 
-     fz_matrix ctm;
-     fz_scale(&ctm, 1.0, 1.0);


Home | Main Index | Thread Index | Old Index