From fd6694989d4c5c04f60c21a13a7e26308df69b2a Mon Sep 17 00:00:00 2001 From: Jerry James Date: Dec 10 2020 19:10:25 +0000 Subject: Fix preview of PNG images (bz 1906363). Add missing Recommends needed to preview images (bz 1906363). --- 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 a000a77..6b9d9ab 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/ @@ -11,6 +11,8 @@ Patch0: %{name}-float.patch Patch1: %{name}-python3.patch # Adapt to Theano-PyMC Patch2: %{name}-theano-pymc.patch +# Work around Fedora pyglet not including PNGImageDecoder +Patch3: %{name}-png-decoder.patch BuildArch: noarch @@ -61,6 +63,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-pymc} @@ -143,7 +151,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)) @@ -177,6 +184,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