Add -script patch to silence deprecation warnings.

This commit is contained in:
Jerry James 2019-08-06 09:20:17 -06:00
parent 39820012a1
commit 85b603cc14
2 changed files with 49 additions and 2 deletions

View File

@ -0,0 +1,39 @@
Remove deprecated use of script_files
Fixes sphinx-doc/sphinx#6088
* Add script block
* Fix build error
--- sphinx_rtd_theme/layout.html.orig 2019-02-12 12:37:47.000000000 -0700
+++ sphinx_rtd_theme/layout.html 2019-08-06 09:02:26.103136905 -0600
@@ -29,6 +29,7 @@
{% endif %}
{# JAVASCRIPTS #}
+ {%- block scripts %}
<script type="text/javascript" src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
{%- if not embedded %}
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
@@ -62,6 +63,7 @@
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
{%- endif %}
{%- endif %}
+ {%- endblock %}
{# CSS #}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
--- sphinx_rtd_theme/search.html.orig 2019-02-12 12:37:47.000000000 -0700
+++ sphinx_rtd_theme/search.html 2019-08-06 09:03:25.597117851 -0600
@@ -9,7 +9,10 @@
#}
{%- extends "layout.html" %}
{% set title = _('Search') %}
-{% set script_files = script_files + ['_static/searchtools.js'] %}
+{%- block scripts %}
+ {{ super() }}
+ <script type="text/javascript" src="{{ pathto('_static/searchtools.js', 1) }}"></script>
+{%- endblock %}
{% block footer %}
<script type="text/javascript">
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });

View File

@ -5,12 +5,17 @@
Name: python-%{srcname}
Version: 0.4.3
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Sphinx theme for readthedocs.org
License: MIT
URL: https://github.com/rtfd/%{srcname}
Source0: https://github.com/rtfd/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz
# Remove deprecated use of script_files. See:
# - https://github.com/readthedocs/sphinx_rtd_theme/pull/728
# - https://github.com/readthedocs/sphinx_rtd_theme/commit/a49a812c8821123091166fae1897d702cdc2d627
Patch0: %{name}-script.patch
BuildArch: noarch
BuildRequires: python3-devel
@ -43,7 +48,7 @@ can be ignored if you're just trying to use it on your project outside
of that site.
%prep
%setup -q -n %{srcname}-%{version}
%autosetup -p0 -n %{srcname}-%{version}
%build
%py3_build
@ -96,6 +101,9 @@ cp -a %{buildroot}%{python3_sitelib}/%{srcname}/static/fonts \
%{python3_sitelib}/%{srcname}*
%changelog
* Tue Aug 6 2019 Jerry James <loganjerry@gmail.com> - 0.4.3-4
- Add -script patch to silence deprecation warnings
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild