From b803ed1e81debe5f11e129dab223cb52ebb37ba2 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Thu, 8 Oct 2020 23:00:24 +0200 Subject: [PATCH] support PyMuPDF --- 0001-support-PyMuPDF.patch | 42 ++++++++++++++++++++++++++++++++++++++ mupdf.spec | 7 ++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0001-support-PyMuPDF.patch diff --git a/0001-support-PyMuPDF.patch b/0001-support-PyMuPDF.patch new file mode 100644 index 0000000..5e9c8e2 --- /dev/null +++ b/0001-support-PyMuPDF.patch @@ -0,0 +1,42 @@ +From c8e13f6b200ca086085f8318409bd324ef498852 Mon Sep 17 00:00:00 2001 +Message-Id: +From: Michael J Gruber +Date: Thu, 8 Oct 2020 22:55:36 +0200 +Subject: [PATCH] support PyMuPDF + +PyMuPDF patches mupdf sources to build. Support this by including the +desired function. + +Originally-by: Jorj X. McKie +--- + source/pdf/pdf-font-add.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/source/pdf/pdf-font-add.c b/source/pdf/pdf-font-add.c +index f68b74c02..2ff11efe1 100644 +--- a/source/pdf/pdf-font-add.c ++++ b/source/pdf/pdf-font-add.c +@@ -778,3 +778,20 @@ pdf_add_cjk_font(fz_context *ctx, pdf_document *doc, fz_font *fzfont, int script + + return fref; + } ++void jm_valid_chars(fz_context *ctx, fz_font *font, void *arr) ++{ ++ FT_Face face = font->ft_face; ++ FT_ULong ucs; ++ FT_UInt gid; ++ long *table = (long *)arr; ++ fz_lock(ctx, FZ_LOCK_FREETYPE); ++ ucs = FT_Get_First_Char(face, &gid); ++ while (gid > 0) ++ { ++ if (gid < (FT_ULong)face->num_glyphs && face->num_glyphs > 0) ++ table[gid] = (long)ucs; ++ ucs = FT_Get_Next_Char(face, ucs, &gid); ++ } ++ fz_unlock(ctx, FZ_LOCK_FREETYPE); ++ return; ++} +-- +2.28.0.945.gedc4c61efd + diff --git a/mupdf.spec b/mupdf.spec index c4ba694..14a8a17 100644 --- a/mupdf.spec +++ b/mupdf.spec @@ -5,7 +5,7 @@ Name: mupdf Version: 1.18.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A lightweight PDF viewer and toolkit License: AGPLv3+ URL: http://mupdf.com/ @@ -31,6 +31,7 @@ Provides: bundled(freeglut-devel) = 3.0.0 # version so bundling them is the safer choice. Provides: bundled(mujs-devel) = 1.0.9 Patch0: 0001-fix-build-on-big-endian.patch +Patch1: 0001-support-PyMuPDF.patch %description MuPDF is a lightweight PDF viewer and toolkit written in portable C. @@ -63,6 +64,7 @@ do rm -rf thirdparty/$d done %patch0 -p1 -d thirdparty/lcms2 +%patch1 -p1 echo > user.make "\ USE_SYSTEM_FREETYPE := yes USE_SYSTEM_HARFBUZZ := yes @@ -110,6 +112,9 @@ cd %{buildroot}/%{_bindir} && ln -s %{name}-x11 %{name} %{_libdir}/lib%{name}*.a %changelog +* Thu Oct 08 2020 Michael J Gruber - 1.18.0-2 +- support PyMuPDF + * Thu Oct 08 2020 Michael J Gruber - 1.18.0-1 - bugfix and feature release - bz #1886338 #1886339 #1886083