1
0
forked from pool/python-Cython

Accepting request 690771 from home:TheBlackCat:branches:devel:languages:python

Fix building of documentation

OBS-URL: https://build.opensuse.org/request/show/690771
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Cython?expand=0&rev=122
This commit is contained in:
Todd R 2019-04-02 18:58:30 +00:00 committed by Git OBS Bridge
parent 9a978ca19a
commit 6c016720d7
5 changed files with 57 additions and 0 deletions

33
cython_use_imgmath.patch Normal file
View File

@ -0,0 +1,33 @@
From 452627ce99f3fa180f85838b8208a3cb3fcf0b71 Mon Sep 17 00:00:00 2001
From: Stefan Behnel <stefan_ml@behnel.de>
Date: Sun, 27 Jan 2019 16:43:41 +0100
Subject: [PATCH] Docs: switch from outdated "pngmath" sphinx package to
"imgmath", and use "svg" as output format. See #2818.
---
docs/conf.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/conf.py b/docs/conf.py
index 10662e28ca..c20a57574e 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -41,7 +41,7 @@
extensions = [
'ipython_console_highlighting',
'cython_highlighting',
- 'sphinx.ext.pngmath',
+ 'sphinx.ext.imgmath',
'sphinx.ext.todo',
'sphinx.ext.intersphinx',
'sphinx.ext.autodoc'
@@ -132,6 +132,9 @@
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False
+# The output image format. The default is 'png'. It should be either 'png' or 'svg'.
+imgmath_image_format = "svg"
+
# -- Options for HTML output ---------------------------------------------------

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Apr 2 16:08:29 UTC 2019 - Todd R <toddrme2178@gmail.com>
- Add cython_use_imgmath.patch
The pngmath Sphinx extension has been removed. Use imgmath instead.
See: gh#cython/cython#2818
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Feb 28 15:30:08 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com> Thu Feb 28 15:30:08 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>

View File

@ -28,9 +28,14 @@ Group: Documentation/Other
URL: http://www.cython.org URL: http://www.cython.org
Source: https://files.pythonhosted.org/packages/source/C/Cython/Cython-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/C/Cython/Cython-%{version}.tar.gz
Source1: python-Cython-rpmlintrc Source1: python-Cython-rpmlintrc
# PATCH-FIX-UPSTREAM -- cython_use_imgmath.patch -- Don't use removed pngmath Sphinx extension -- gh#cython/cython#2818
Patch0: cython_use_imgmath.patch
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
BuildRequires: python3-Sphinx BuildRequires: python3-Sphinx
BuildRequires: python3-Sphinx-latex
BuildRequires: texlive-dvipng
BuildRequires: texlive-latex
BuildArch: noarch BuildArch: noarch
%if %{with test} %if %{with test}
BuildRequires: %{python_module Cython = %{version}} BuildRequires: %{python_module Cython = %{version}}
@ -49,6 +54,7 @@ allows the compiler to generate very efficient C code from Cython code.
%prep %prep
%setup -q -n Cython-%{version} %setup -q -n Cython-%{version}
%patch0 -p1
# Fix EOL encoding # Fix EOL encoding
sed -i "s|\r||" Demos/callback/{README.rst,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static} sed -i "s|\r||" Demos/callback/{README.rst,cheesefinder.h} Demos/embed/Makefile.{unix,msc.static}
# Remove tests broken with new gcc # Remove tests broken with new gcc
@ -60,6 +66,7 @@ python3 setup.py build_sphinx && rm build/sphinx/html/.buildinfo
%install %install
mkdir -p %{buildroot}%{_docdir}/python-Cython mkdir -p %{buildroot}%{_docdir}/python-Cython
cp -r build/sphinx/html %{buildroot}%{_docdir}/python-Cython cp -r build/sphinx/html %{buildroot}%{_docdir}/python-Cython
sed -i 's/\r$//' %{buildroot}%{_docdir}/python-Cython/html/_sources/examples/README.rst.txt
%fdupes %{buildroot}%{_docdir}/python-Cython %fdupes %{buildroot}%{_docdir}/python-Cython
%if %{with test} %if %{with test}

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Apr 2 16:08:29 UTC 2019 - Todd R <toddrme2178@gmail.com>
- Add cython_use_imgmath.patch
The pngmath Sphinx extension has been removed. Use imgmath instead.
See: gh#cython/cython#2818
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Feb 28 15:30:08 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com> Thu Feb 28 15:30:08 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>

View File

@ -27,6 +27,8 @@ Group: Development/Languages/Python
URL: http://www.cython.org URL: http://www.cython.org
Source: https://files.pythonhosted.org/packages/source/C/Cython/Cython-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/C/Cython/Cython-%{version}.tar.gz
Source1: python-Cython-rpmlintrc Source1: python-Cython-rpmlintrc
# PATCH-FIX-UPSTREAM -- cython_use_imgmath.patch -- Don't use removed pngmath Sphinx extension -- gh#cython/cython#2818
Patch0: cython_use_imgmath.patch
BuildRequires: %{python_module devel} BuildRequires: %{python_module devel}
BuildRequires: %{python_module xml} BuildRequires: %{python_module xml}
BuildRequires: fdupes BuildRequires: fdupes
@ -54,6 +56,7 @@ allows the compiler to generate very efficient C code from Cython code.
%prep %prep
%setup -q -n Cython-%{version} %setup -q -n Cython-%{version}
%patch0 -p1
# Fix non-executable scripts # Fix non-executable scripts
sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py sed -i "s|^#!.*||" Cython/Debugger/{libpython,Cygdb}.py cython.py