From 106d3f3b98536af0aabad6210e02e4b7cd9a74a0 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Dec 19 2017 15:42:43 +0000 Subject: sync with upstream 0.11.2 In particular, this restores all main functionality based solely on mupdf (rather than pdftk). --- diff --git a/.gitignore b/.gitignore index 6027721..6d06a23 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ Impressive-0.10.2.tar.gz /Impressive-0.10.3.tar.gz /Impressive-0.10.4.tar.gz /Impressive-0.11.1.tar.gz +/Impressive-0.11.2.tar.gz diff --git a/impressive-0.11.1-mudraw-1.7.patch b/impressive-0.11.1-mudraw-1.7.patch deleted file mode 100644 index f26f094..0000000 --- a/impressive-0.11.1-mudraw-1.7.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- impressive.py.orig 2015-11-21 23:56:54.197386430 +0100 -+++ impressive.py 2015-11-22 00:00:11.310669086 +0100 -@@ -19,7 +19,7 @@ - - __title__ = "Impressive" - __version__ = "0.11.1" --__rev__ = 186 -+__rev__ = "v0.11.1-1-gdd43e7d" - __author__ = "Martin J. Fiedler" - __email__ = "martin.fiedler@gmx.net" - __website__ = "http://impressive.sourceforge.net/" -@@ -2973,7 +2973,7 @@ class MuPDFRenderer(PDFRendererBase): - name = "MuPDF" - binaries = ["mudraw", "pdfdraw"] - test_run_args = [] -- required_options = ["o", "r", "b"] -+ required_options = ["o", "r", "A"] - - # helper object for communication with the reader thread - class ThreadComm(object): -@@ -3016,7 +3016,7 @@ class MuPDFRenderer(PDFRendererBase): - except (OSError, IOError, AttributeError): - pass - if not antialias: -- aa_opts = ["-b", "0"] -+ aa_opts = ["-A", "0"] - else: - aa_opts = [] - try: diff --git a/impressive-0.11.1-mutool-info.patch b/impressive-0.11.1-mutool-info.patch deleted file mode 100644 index db8f981..0000000 --- a/impressive-0.11.1-mutool-info.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- impressive.py.orig 2015-11-21 23:56:54.197386430 +0100 -+++ impressive.py 2015-11-22 00:23:17.998145913 +0100 -@@ -19,7 +19,7 @@ - - __title__ = "Impressive" - __version__ = "0.11.1" --__rev__ = "v0.11.1-1-gdd43e7d" -+__rev__ = "v0.11.1-2-gbbb6abd" - __author__ = "Martin J. Fiedler" - __email__ = "martin.fiedler@gmx.net" - __website__ = "http://impressive.sourceforge.net/" -@@ -148,6 +148,7 @@ if os.name == "nt": - return path - return binary # fall-back if not found - pdftkPath = FindBinary("pdftk.exe") -+ mutoolPath = FindBinary("mutool.exe") - GhostScriptPlatformOptions = ["-I" + os.path.join(root, "gs")] - try: - import win32api -@@ -173,6 +174,7 @@ else: - MPlayerPlatformOptions = [ "-vo", "gl" ] - MPlayerColorKey = False - pdftkPath = "pdftk" -+ mutoolPath = "mutool" - FontPath = ["/usr/share/fonts", "/usr/local/share/fonts", "/usr/X11R6/lib/X11/fonts/TTF"] - FontList = ["DejaVuSans.ttf", "Vera.ttf", "Verdana.ttf"] - Nice = ["nice", "-n", "7"] -@@ -781,18 +783,6 @@ def b2s(b): - if b: return "Y" - return "N" - --# extract a number at the beginning of a string --def num(s): -- s = s.strip() -- r = "" -- while s[0] in "0123456789": -- r += s[0] -- s = s[1:] -- try: -- return int(r) -- except ValueError: -- return -1 -- - # linearly interpolate between two floating-point RGB colors represented as tuples - def lerpColor(a, b, t): - return tuple([min(1.0, max(0.0, x + t * (y - x))) for x, y in zip(a, b)]) -@@ -807,11 +797,22 @@ def my_stat(filename): - - # determine (pagecount,width,height) of a PDF file - def analyze_pdf(filename): -- f = file(filename,"rb") -+ t = TempFileName + ".txt" -+ f = file(t, "w") -+ try: -+ assert 0 == subprocess.Popen([mutoolPath, "info", filename], stdout=f).wait() -+ except OSError: -+ print >>sys.stderr, "Note: mutool not found, cannot determine output size." -+ return -+ except AssertionError: -+ print >>sys.stderr, "Note: mutool failed, cannot determine output size." -+ return -+ f.close() -+ f = file(t, "r") - pdf = f.read() - f.close() -- box = map(float, pdf.split("/MediaBox",1)[1].split("]",1)[0].split("[",1)[1].strip().split()) -- return (max(map(num, pdf.split("/Count")[1:])), box[2]-box[0], box[3]-box[1]) -+ box = map(float, pdf.split("Mediaboxes",1)[1].split("]",1)[0].split("[",1)[1].strip().split()) -+ return (int(pdf.split("Pages:")[1].split()[0]), box[2]-box[0], box[3]-box[1]) - - # unescape { literals in PDF files - re_unescape = re.compile(r'&#[0-9]+;') diff --git a/impressive.spec b/impressive.spec index f24bc75..a9d34fc 100644 --- a/impressive.spec +++ b/impressive.spec @@ -1,6 +1,6 @@ Name: impressive -Version: 0.11.1 -Release: 6%{?dist} +Version: 0.11.2 +Release: 1%{?dist} Summary: A program that displays presentation slides Group: Applications/Productivity @@ -9,8 +9,6 @@ URL: http://impressive.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/Impressive-%{version}.tar.gz # Wrapper script for making sure hardware acceleration is available Source1: %{name}.sh -Patch1: impressive-0.11.1-mudraw-1.7.patch -Patch2: impressive-0.11.1-mutool-info.patch BuildArch: noarch BuildRequires: python-devel @@ -21,7 +19,6 @@ Requires: pygame Requires: PyOpenGL Requires: opengl-games-utils # - external tools for displaying and parsing pdf (required): -Requires: poppler-utils Requires: mupdf # - external tool for acting on links (strongly recommended): Requires: xdg-utils @@ -42,11 +39,6 @@ that are really useful for presentations. %prep %setup -q -n Impressive-%{version} -# adjust to current mudraw option syntax -%patch1 -# use mutool for info parsing -%patch2 - %build sed -e "s|@PYTHON_SITELIB@|%{python_sitelib}|" %{SOURCE1} > impressive.sh # This package doesn't build anything, just copy files under build root. @@ -71,6 +63,9 @@ rm -rf %{buildroot} %{_mandir}/man1/impressive.1* %changelog +* Tue Dec 19 2017 Michael J Gruber - 0.11.2-1 +- sync with upstream + * Wed Jul 26 2017 Fedora Release Engineering - 0.11.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild diff --git a/sources b/sources index c677465..06b109e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0fdac7431208ff5866a6443bbdddeaee Impressive-0.11.1.tar.gz +SHA512 (Impressive-0.11.2.tar.gz) = c3e31f129503179f26255d721c151e0c981d14b218a084b2a13a18f6a96ad935f6655b20e0eeda9bc6a58477b5657314ddec189fab3e50fed1f3cfd43c8152e9