pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
zathura-pdf-mupdf-git: Import zathura-pdf-mupdf-git-0.3.3 as wip/zathura-pdf-mupdf-git
Module Name: pkgsrc-wip
Committed By: Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By: leot
Date: Sat Sep 29 19:21:03 2018 +0200
Changeset: e0a527062eeba0c6e00c5ab43d370dddb81e185b
Modified Files:
Makefile
Added Files:
zathura-pdf-mupdf-git/DESCR
zathura-pdf-mupdf-git/Makefile
zathura-pdf-mupdf-git/PLIST
zathura-pdf-mupdf-git/distinfo
zathura-pdf-mupdf-git/patches/patch-document.c
zathura-pdf-mupdf-git/patches/patch-meson.build
zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_page.c
zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_render.c
zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_search.c
zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_utils.c
Log Message:
zathura-pdf-mupdf-git: Import zathura-pdf-mupdf-git-0.3.3 as wip/zathura-pdf-mupdf-git
The zathura-pdf-mupdf plugin adds PDF support to zathura by using the
mupdf rendering library.
Mainly intended to track develop branch to upstream pkgsrc patches.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e0a527062eeba0c6e00c5ab43d370dddb81e185b
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 1 +
zathura-pdf-mupdf-git/DESCR | 2 +
zathura-pdf-mupdf-git/Makefile | 33 ++++++++++++++++
zathura-pdf-mupdf-git/PLIST | 4 ++
zathura-pdf-mupdf-git/distinfo | 8 ++++
zathura-pdf-mupdf-git/patches/patch-document.c | 25 ++++++++++++
zathura-pdf-mupdf-git/patches/patch-meson.build | 25 ++++++++++++
.../patches/patch-zathura-pdf-mupdf_page.c | 23 +++++++++++
.../patches/patch-zathura-pdf-mupdf_render.c | 46 ++++++++++++++++++++++
.../patches/patch-zathura-pdf-mupdf_search.c | 31 +++++++++++++++
.../patches/patch-zathura-pdf-mupdf_utils.c | 17 ++++++++
11 files changed, 215 insertions(+)
diffs:
diff --git a/Makefile b/Makefile
index 908f711dfa..5b9faead3a 100644
--- a/Makefile
+++ b/Makefile
@@ -4866,6 +4866,7 @@ SUBDIR+= zathura
SUBDIR+= zathura-cb
SUBDIR+= zathura-djvu
SUBDIR+= zathura-pdf-mupdf
+SUBDIR+= zathura-pdf-mupdf-git
SUBDIR+= zathura-pdf-poppler
SUBDIR+= zathura-ps
SUBDIR+= zbackup
diff --git a/zathura-pdf-mupdf-git/DESCR b/zathura-pdf-mupdf-git/DESCR
new file mode 100644
index 0000000000..3c71cd55c5
--- /dev/null
+++ b/zathura-pdf-mupdf-git/DESCR
@@ -0,0 +1,2 @@
+The zathura-pdf-mupdf plugin adds PDF support to zathura by using the
+mupdf rendering library.
diff --git a/zathura-pdf-mupdf-git/Makefile b/zathura-pdf-mupdf-git/Makefile
new file mode 100644
index 0000000000..83d4dd56ed
--- /dev/null
+++ b/zathura-pdf-mupdf-git/Makefile
@@ -0,0 +1,33 @@
+# $NetBSD: Makefile,v 1.27 2018/08/16 18:55:09 adam Exp $
+#
+
+DISTNAME= zathura-pdf-mupdf-0.3.3
+CATEGORIES= print
+MASTER_SITES= https://pwmt.org/projects/zathura/plugins/download/
+EXTRACT_SUFX= .tar.xz
+
+MAINTAINER= leot%NetBSD.org@localhost
+HOMEPAGE= https://pwmt.org/projects/zathura-pdf-mupdf/
+COMMENT= Add PDF support to zathura using mupdf rendering engine
+LICENSE= zlib
+
+GIT_REPOSITORIES= zathura-pdf-mupdf
+GIT_BRANCH.zathura-pdf-mupdf= develop
+GIT_REPO.zathura-pdf-mupdf= https://git.pwmt.org/pwmt/zathura-pdf-mupdf.git
+WRKSRC= ${WRKDIR}/zathura-pdf-mupdf
+
+USE_TOOLS+= pkg-config
+
+# Link to external dependencies (jpeg, jbig2dec, openjpeg)
+MESON_ARGS+= -D link-external=true
+
+CPPFLAGS+= -D_XOPEN_SOURCE=600
+
+.include "../../devel/py-meson/build.mk"
+.include "../../graphics/cairo/buildlink3.mk"
+.include "../../wip/mupdf/buildlink3.mk"
+.include "../../wip/zathura/buildlink3.mk"
+.include "../../sysutils/desktop-file-utils/desktopdb.mk"
+.include "../../x11/gtk3/buildlink3.mk"
+.include "../../wip/mk/git-package.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/zathura-pdf-mupdf-git/PLIST b/zathura-pdf-mupdf-git/PLIST
new file mode 100644
index 0000000000..29e85f9432
--- /dev/null
+++ b/zathura-pdf-mupdf-git/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD$
+lib/zathura/libpdf-mupdf.so
+share/applications/org.pwmt.zathura-pdf-mupdf.desktop
+share/metainfo/org.pwmt.zathura-pdf-mupdf.metainfo.xml
diff --git a/zathura-pdf-mupdf-git/distinfo b/zathura-pdf-mupdf-git/distinfo
new file mode 100644
index 0000000000..a9ebed08fa
--- /dev/null
+++ b/zathura-pdf-mupdf-git/distinfo
@@ -0,0 +1,8 @@
+$NetBSD$
+
+SHA1 (patch-document.c) = b7d3c8c23148f7eb5f034586c2da4995a5cf2b5d
+SHA1 (patch-meson.build) = a6e57e646cb96b430564ac5cdbf18d67b62f8f0b
+SHA1 (patch-zathura-pdf-mupdf_page.c) = bfce420f9396025a23b7c8a78ff962b834d6746a
+SHA1 (patch-zathura-pdf-mupdf_render.c) = a551478679d14906482673e60bd52cfd6cf74f7a
+SHA1 (patch-zathura-pdf-mupdf_search.c) = 9d21523e2768436fe2e00bc4765d21643d996c0c
+SHA1 (patch-zathura-pdf-mupdf_utils.c) = 92655c0684c72ca42954936f72795d85f4c3a318
diff --git a/zathura-pdf-mupdf-git/patches/patch-document.c b/zathura-pdf-mupdf-git/patches/patch-document.c
new file mode 100644
index 0000000000..3bde10d3ff
--- /dev/null
+++ b/zathura-pdf-mupdf-git/patches/patch-document.c
@@ -0,0 +1,25 @@
+$NetBSD: patch-document.c,v 1.4 2017/01/31 10:12:02 leot Exp $
+
+- Correct the glib-2.0 include header file path.
+- Port to mupdf-1.14.0
+
+--- zathura-pdf-mupdf/document.c.orig 2018-03-17 19:47:01.000000000 +0000
++++ zathura-pdf-mupdf/document.c
+@@ -3,7 +3,7 @@
+ #include <mupdf/fitz.h>
+ #include <mupdf/pdf.h>
+
+-#include <glib-2.0/glib.h>
++#include <glib.h>
+
+ #include "plugin.h"
+
+@@ -138,7 +138,7 @@ pdf_document_get_information(zathura_doc
+
+ fz_try (mupdf_document->ctx) {
+ pdf_obj* trailer = pdf_trailer(mupdf_document->ctx, (pdf_document*) mupdf_document->document);
+- pdf_obj* info_dict = pdf_dict_get(mupdf_document->ctx, trailer, PDF_NAME_Info);
++ pdf_obj* info_dict = pdf_dict_get(mupdf_document->ctx, trailer, PDF_NAME(Info));
+
+ /* get string values */
+ typedef struct info_value_s {
diff --git a/zathura-pdf-mupdf-git/patches/patch-meson.build b/zathura-pdf-mupdf-git/patches/patch-meson.build
new file mode 100644
index 0000000000..bea89d1e78
--- /dev/null
+++ b/zathura-pdf-mupdf-git/patches/patch-meson.build
@@ -0,0 +1,25 @@
+$NetBSD$
+
+- Fix library name of jbig2dec (no 'lib' prefix is needed)
+- Adjust library name of mupdf-third for mupdf>=1.14.0.
+
+--- meson.build.orig 2018-09-29 16:16:56.000000000 +0000
++++ meson.build
+@@ -20,7 +20,7 @@ girara = dependency('girara-gtk3')
+ glib = dependency('glib-2.0')
+ cairo = dependency('cairo')
+ mupdf = cc.find_library('mupdf')
+-mupdfthird = cc.find_library('mupdfthird')
++mupdfthird = cc.find_library('mupdf-third')
+
+ build_dependencies = [
+ zathura,
+@@ -33,7 +33,7 @@ build_dependencies = [
+
+ if get_option('link-external')
+ libjpeg = dependency('libjpeg')
+- libjbig2dec = cc.find_library('libjbig2dec')
++ libjbig2dec = cc.find_library('jbig2dec')
+ libopenjp2 = dependency('libopenjp2')
+
+ build_dependencies += [
diff --git a/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_page.c b/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_page.c
new file mode 100644
index 0000000000..26b6d8fdab
--- /dev/null
+++ b/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_page.c
@@ -0,0 +1,23 @@
+$NetBSD$
+
+Port to mupdf-1.14.0
+
+--- zathura-pdf-mupdf/page.c.orig 2018-03-17 19:47:01.000000000 +0000
++++ zathura-pdf-mupdf/page.c
+@@ -30,14 +30,12 @@ pdf_page_init(zathura_page_t* page)
+ goto error_free;
+ }
+
+- fz_bound_page(mupdf_document->ctx, (fz_page*) mupdf_page->page, &mupdf_page->bbox);
++ mupdf_page->bbox = fz_bound_page(mupdf_document->ctx, (fz_page*) mupdf_page->page);
+
+ /* setup text */
+ mupdf_page->extracted_text = false;
+
+- fz_rect mediabox;
+- mupdf_page->text = fz_new_stext_page(mupdf_page->ctx,
+- fz_bound_page(mupdf_page->ctx, mupdf_page->page, &mediabox));
++ mupdf_page->text = fz_new_stext_page(mupdf_page->ctx, mupdf_page->bbox);
+ if (mupdf_page->text == NULL) {
+ goto error_free;
+ }
diff --git a/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_render.c b/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_render.c
new file mode 100644
index 0000000000..1590fdb1b0
--- /dev/null
+++ b/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_render.c
@@ -0,0 +1,46 @@
+$NetBSD$
+
+Port to mupdf-1.14.0
+
+--- zathura-pdf-mupdf/render.c.orig 2018-03-17 19:47:01.000000000 +0000
++++ zathura-pdf-mupdf/render.c
+@@ -18,13 +18,16 @@ pdf_page_render_to_buffer(mupdf_document
+ return ZATHURA_ERROR_UNKNOWN;
+ }
+
+- fz_display_list* display_list = fz_new_display_list(mupdf_page->ctx, NULL);
++ fz_irect irect = { .x1 = page_width, .y1 = page_height };
++ fz_rect rect = { .x1 = page_width, .y1 = page_height };
++
++ fz_display_list* display_list = fz_new_display_list(mupdf_page->ctx, rect);
+ fz_device* device = fz_new_list_device(mupdf_page->ctx, display_list);
+
+ fz_try (mupdf_document->ctx) {
+ fz_matrix m;
+- fz_scale(&m, scalex, scaley);
+- fz_run_page(mupdf_document->ctx, mupdf_page->page, device, &m, NULL);
++ m = fz_scale(scalex, scaley);
++ fz_run_page(mupdf_document->ctx, mupdf_page->page, device, m, NULL);
+ } fz_catch (mupdf_document->ctx) {
+ return ZATHURA_ERROR_UNKNOWN;
+ }
+@@ -32,16 +35,13 @@ pdf_page_render_to_buffer(mupdf_document
+ 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_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_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);
++ device = fz_new_draw_device(mupdf_page->ctx, fz_identity, 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);
+
diff --git a/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_search.c b/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_search.c
new file mode 100644
index 0000000000..6f53e1a6ac
--- /dev/null
+++ b/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_search.c
@@ -0,0 +1,31 @@
+$NetBSD$
+
+Port to mupdf-1.14.0
+
+--- zathura-pdf-mupdf/search.c.orig 2018-03-17 19:47:01.000000000 +0000
++++ zathura-pdf-mupdf/search.c
+@@ -39,17 +39,19 @@ pdf_page_search_text(zathura_page_t* pag
+ mupdf_page_extract_text(mupdf_document, mupdf_page);
+ }
+
+- fz_rect* hit_bbox = fz_malloc_array(mupdf_page->ctx, N_SEARCH_RESULTS, sizeof(fz_rect));
++ fz_quad* hit_bbox = fz_malloc_array(mupdf_page->ctx, N_SEARCH_RESULTS, sizeof(fz_quad));
+ int num_results = fz_search_stext_page(mupdf_page->ctx, mupdf_page->text,
+ text, hit_bbox, N_SEARCH_RESULTS);
+
++ fz_rect r;
+ for (int i = 0; i < num_results; i++) {
+ zathura_rectangle_t* rectangle = g_malloc0(sizeof(zathura_rectangle_t));
+
+- rectangle->x1 = hit_bbox[i].x0;
+- rectangle->x2 = hit_bbox[i].x1;
+- rectangle->y1 = hit_bbox[i].y0;
+- rectangle->y2 = hit_bbox[i].y1;
++ r = fz_rect_from_quad(hit_bbox[i]);
++ rectangle->x1 = r.x0;
++ rectangle->x2 = r.x1;
++ rectangle->y1 = r.y0;
++ rectangle->y2 = r.y1;
+
+ girara_list_append(list, rectangle);
+ }
diff --git a/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_utils.c b/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_utils.c
new file mode 100644
index 0000000000..03f7fb24fe
--- /dev/null
+++ b/zathura-pdf-mupdf-git/patches/patch-zathura-pdf-mupdf_utils.c
@@ -0,0 +1,17 @@
+$NetBSD$
+
+Port to mupdf-1.14.0
+
+--- zathura-pdf-mupdf/utils.c.orig 2018-03-17 19:47:01.000000000 +0000
++++ zathura-pdf-mupdf/utils.c
+@@ -18,8 +18,8 @@ mupdf_page_extract_text(mupdf_document_t
+ fz_disable_device_hints(mupdf_page->ctx, text_device, FZ_DONT_INTERPOLATE_IMAGES);
+
+ fz_matrix ctm;
+- fz_scale(&ctm, 1.0, 1.0);
+- fz_run_page(mupdf_page->ctx, mupdf_page->page, text_device, &ctm, NULL);
++ ctm = fz_scale(1.0, 1.0);
++ fz_run_page(mupdf_page->ctx, mupdf_page->page, text_device, ctm, NULL);
+ } fz_always (mupdf_document->ctx) {
+ fz_close_device(mupdf_page->ctx, text_device);
+ fz_drop_device(mupdf_page->ctx, text_device);
Home |
Main Index |
Thread Index |
Old Index