#29 Don't build the Qt 4 backend in ELN/RHEL 9 as Qt 4 won't be available there
Merged 3 years ago by qulogic. Opened 3 years ago by tpopela.
rpms/ tpopela/python-matplotlib qt4-drop-eln-rhel9  into  master

file modified
+24 -4
@@ -3,6 +3,13 @@ 

  # https://fedorahosted.org/fpc/ticket/381

  %bcond_without bundled_fonts

  

+ # No qt4 for EL8/ELN/EL9

+ %if 0%{?rhel} >= 8

+ %bcond_with qt4

+ %else

+ %bcond_without qt4

+ %endif

+ 

  # the default backend; one of GTK3Agg GTK3Cairo MacOSX Qt4Agg Qt5Agg TkAgg

  # WXAgg Agg Cairo PS PDF SVG

  %global backend                 TkAgg
@@ -35,7 +42,7 @@ 

  Name:           python-matplotlib

  Version:        3.3.3

  %global Version 3.3.3

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Summary:        Python 2D plotting library

  # qt4_editor backend is MIT

  # ResizeObserver at end of lib/matplotlib/backends/web_backend/js/mpl.js is Public Domain
@@ -201,6 +208,7 @@ 

  You can generate plots, histograms, power spectra, bar charts,

  errorcharts, scatterplots, etc, with just a few lines of code.

  

+ %if %{with qt4}

  %package -n     python3-matplotlib-qt4

  Summary:        Qt4 backend for python3-matplotlib

  BuildRequires:  python3-PyQt4-devel
@@ -210,6 +218,7 @@ 

  

  %description -n python3-matplotlib-qt4

  %{summary}

+ %endif

  

  %package -n     python3-matplotlib-qt5

  Summary:        Qt5 backend for python3-matplotlib
@@ -375,7 +384,9 @@ 

  %exclude %{python3_sitearch}/mpl_toolkits/tests/baseline_images/*

  %pycached %{python3_sitearch}/pylab.py

  %pycached %exclude %{python3_sitearch}/matplotlib/backends/backend_qt4*.py

- #pycached #exclude #{python3_sitearch}/matplotlib/backends/backend_qt5*.py

+ %if %{without qt4}

+ %pycached %exclude %{python3_sitearch}/matplotlib/backends/backend_qt5*.py

+ %endif

  %pycached %exclude %{python3_sitearch}/matplotlib/backends/backend_gtk*.py

  %pycached %exclude %{python3_sitearch}/matplotlib/backends/_backend_tk.py

  %pycached %exclude %{python3_sitearch}/matplotlib/backends/backend_tk*.py
@@ -387,15 +398,19 @@ 

  %{python3_sitearch}/matplotlib/tests/baseline_images/

  %{python3_sitearch}/mpl_toolkits/tests/baseline_images/

  

+ %if %{with qt4}

  %files -n python3-matplotlib-qt4

  %pycached %{python3_sitearch}/matplotlib/backends/backend_qt4.py

  %pycached %{python3_sitearch}/matplotlib/backends/backend_qt4agg.py

+ %endif

  

  # This subpackage is empty because the Qt4 backend imports it, so we leave

  # these files in the default package, and only use this one for dependencies.

  %files -n python3-matplotlib-qt5

- #pycached #{python3_sitearch}/matplotlib/backends/backend_qt5.py

- #pycached #{python3_sitearch}/matplotlib/backends/backend_qt5agg.py

+ %if %{without qt4}

+ %pycached %{python3_sitearch}/matplotlib/backends/backend_qt5.py

+ %pycached %{python3_sitearch}/matplotlib/backends/backend_qt5agg.py

+ %endif

  

  %files -n python3-matplotlib-gtk3

  %pycached %{python3_sitearch}/matplotlib/backends/backend_gtk*.py
@@ -410,6 +425,11 @@ 

  

  

  %changelog

+ * Wed Dec 02 2020 Tomas Popela <tpopela@redhat.com> - 3.3.3-2

+ - Don't build the Qt 4 backend in ELN/RHEL 9 as Qt 4 won't be available there

+   (reuse

+   https://src.fedoraproject.org/rpms/python-matplotlib/c/588e490738b06d525910f05bc1ba3f3f05ec7d50?branch=epel8)

+ 

  * Thu Nov 12 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 3.3.3-1

  - Update to latest version (#1897021)

  

no initial comment

Instead fo repeating the comment several times, I would recommend to create a with_qt4 bcond. That also makes it easier to test the build with and without qt4 on Fedora itself.

Excluding should work even if the files don't exist.

Suggestion: As a matter of making things nicer, I recommend to add the qt5 files to the python3-matplotlib-qt5 package when building without qt4.

ELN scratchbuild: https://koji.fedoraproject.org/koji/taskinfo?taskID=56587086

Note that this package is also built on EPEL8 and the conditionals are already there. I suggest reusing them: https://src.fedoraproject.org/rpms/python-matplotlib/c/588e490738b06d525910f05bc1ba3f3f05ec7d50?branch=epel8

https://tiny.distro.builders/view-srpm--view-eln--python-matplotlib.html seem to indicate that all the non-tk backends are not needed in RHEL 9.

(I would also argue that matplotlib is not needed either.)

Suggestion: As a matter of making things nicer, I recommend to add the qt5 files to the python3-matplotlib-qt5 package when building without qt4.

I don't know what you mean Miro. The qt5 files are already part of the python3-matplotlib-qt5 package.

ELN scratchbuild: https://koji.fedoraproject.org/koji/taskinfo?taskID=56587086

Note that this package is also built on EPEL8 and the conditionals are already there. I suggest reusing them: https://src.fedoraproject.org/rpms/python-matplotlib/c/588e490738b06d525910f05bc1ba3f3f05ec7d50?branch=epel8

Ah, nice! Let me me reuse it (only the qt4 part).

rebased onto 638dc03ab761c5319593b2d1e76c45344ec7e8ac

3 years ago

The qt5 files are already part of the python3-matplotlib-qt5 package.

Except that they are not. See the comment in the %files section.

https://src.fedoraproject.org/rpms/python-matplotlib/blob/master/f/python-matplotlib.spec#_394

%{eln} is only going to be defined on %{rhel} >= 9, so the || 0%{eln} part is redundant.

Also, question marks are missing.

rebased onto 8780f78a9cfa3622843e91734cfc244dbffb80b7

3 years ago

The qt5 files are already part of the python3-matplotlib-qt5 package.

Except that they are not. See the comment in the %files section.

https://src.fedoraproject.org/rpms/python-matplotlib/blob/master/f/python-matplotlib.spec#_394

Completely missed that part. Thanks!

https://src.fedoraproject.org/fork/tpopela/rpms/python-matplotlib/blob/f9eb03af07968244efc627cace4fc7c798d40cee/f/python-matplotlib.spec#_387

This needs to be ifed for %{without qt4}, otherwise the files end up co-owned (not a huge disaster, but weird).

I also think that since EPEL8 has the wx bcond, ELN would benefit from disabling that one as well. However, I leave that up to the primary maintainer.

rebased onto 4cdf22e

3 years ago

Pull-Request has been merged by qulogic

3 years ago