From e7b9e8609f9ad7418633d2f78a9d3926363a7509 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 10 Dec 2020 12:10:25 -0700 Subject: [PATCH] Fix preview of PNG images (bz 1906363). Add missing Recommends needed to preview images (bz 1906363). --- sympy-png-decoder.patch | 13 +++++++++++++ sympy.spec | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 sympy-png-decoder.patch diff --git a/sympy-png-decoder.patch b/sympy-png-decoder.patch new file mode 100644 index 0000000..a51871a --- /dev/null +++ b/sympy-png-decoder.patch @@ -0,0 +1,13 @@ +--- sympy-sympy-1.7/sympy/printing/preview.py.orig 2020-11-29 04:02:22.000000000 -0700 ++++ sympy-sympy-1.7/sympy/printing/preview.py 2020-12-10 10:55:53.290413553 -0700 +@@ -32,8 +32,8 @@ def _run_pyglet(fname, fmt): + from pyglet.window import key + + if fmt == "png": +- from pyglet.image.codecs.png import PNGImageDecoder +- img = image.load(fname, decoder=PNGImageDecoder()) ++ from pyglet.image.codecs.pil import PILImageDecoder ++ img = image.load(fname, decoder=PILImageDecoder()) + else: + raise ValueError("pyglet preview works only for 'png' files.") + diff --git a/sympy.spec b/sympy.spec index f49377b..3651e92 100644 --- a/sympy.spec +++ b/sympy.spec @@ -1,6 +1,6 @@ Name: sympy Version: 1.7 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A Python library for symbolic mathematics License: BSD URL: http://sympy.org/ @@ -9,6 +9,8 @@ Source0: https://github.com/%{name}/%{name}/archive/%{name}-%{version}.ta Patch0: %{name}-float.patch # Default to python3 in the Cython backend Patch1: %{name}-python3.patch +# Work around Fedora pyglet not including PNGImageDecoder +Patch2: %{name}-png-decoder.patch BuildArch: noarch @@ -58,6 +60,12 @@ Requires: %{py3_dist gmpy2} Requires: %{py3_dist matplotlib} Requires: %{py3_dist pyglet} +Recommends: tex(latex) +Recommends: tex(amsfonts.sty) +Recommends: tex(amsmath.sty) +Recommends: tex(euler.sty) +Recommends: tex(eulervm.sty) +Recommends: tex(standalone.cls) Recommends: %{py3_dist numexpr} Recommends: %{py3_dist scipy} Recommends: %{py3_dist theano} @@ -140,7 +148,6 @@ find examples/ -name '*.py[co]' -print -delete # Do not run tests on 32-bit systems. %global maxpyint %(python3 -c 'import sys;print("%x" % sys.maxsize)') if [ "%{maxpyint}" != "7fffffff" ]; then - let "dnum = $RANDOM % 90 + 10" # Split into many small chunks to reduce waiting in the end-game jobs=%{?_smp_mflags}; jobs=${jobs#-j}; jobs=$((jobs * 3)) @@ -174,6 +181,10 @@ fi %{_docdir}/%{name}-doc/html %changelog +* Thu Dec 10 2020 Jerry James - 1.7-2 +- Fix preview of PNG images (bz 1906363) +- Add missing Recommends needed to preview images (bz 1906363) + * Sat Nov 28 2020 Jerry James - 1.7-1 - Version 1.7