]>
Commit | Line | Data |
---|---|---|
dc3cc1b8 JB |
1 | # |
2 | # Conditional build: | |
a24c9bc5 JB |
3 | %bcond_with doc # Sphinx documentation |
4 | %bcond_with tests # unit tests [many failures as of 3.5.1, esp. with system freetype] | |
5 | %bcond_without system_freetype # system freetype library | |
6 | %bcond_without system_qhull # system qhull library | |
dc3cc1b8 JB |
7 | |
8 | # TODO: | |
a24c9bc5 | 9 | # - finish doc |
dc3cc1b8 JB |
10 | # - use system fonts (mpl-data/fonts/ttf/{STIX,cm}*.ttf) and metrics (mpl-data/fonts/{afm,pdfcorefonts}/*.afm) in mpl-data dir? |
11 | # - make sure all dependencies that are available for Python3 are build for Python3 | |
12 | # and included in BR when neccessary | |
13 | %define module matplotlib | |
14 | Summary: Matlab(TM) style Python plotting package | |
15 | Summary(pl.UTF-8): Pakiet do rysowania w Pythonie podobny do Matlaba(TM) | |
16 | Name: python3-%{module} | |
a24c9bc5 JB |
17 | Version: 3.5.1 |
18 | Release: 1 | |
dc3cc1b8 JB |
19 | License: PSF |
20 | Group: Libraries/Python | |
21 | #Source0Download: https://github.com/matplotlib/matplotlib/releases | |
22 | Source0: https://github.com/matplotlib/matplotlib/archive/v%{version}/matplotlib-%{version}.tar.gz | |
a24c9bc5 | 23 | # Source0-md5: 87af8f1bc31dbe2ea4cb54a8406aa6d6 |
dc3cc1b8 JB |
24 | Source1: https://jqueryui.com/resources/download/jquery-ui-1.12.1.zip |
25 | # Source1-md5: e0cfea21c9d1acd37fb58592f2c1f50d | |
dc3cc1b8 | 26 | URL: https://matplotlib.org/ |
a24c9bc5 | 27 | # currently internal agg is used |
dc3cc1b8 | 28 | #BuildRequires: agg-devel |
a24c9bc5 | 29 | %{?with_system_freetype:BuildRequires: freetype-devel >= 1:2.6.1} |
dc3cc1b8 | 30 | BuildRequires: libstdc++-devel |
dc3cc1b8 | 31 | BuildRequires: pkgconfig |
a24c9bc5 JB |
32 | BuildRequires: python3 >= 1:3.7 |
33 | BuildRequires: python3-certifi >= 2020.6.20 | |
34 | BuildRequires: python3-devel >= 1:3.7 | |
35 | BuildRequires: python3-numpy-devel >= 1:1.17 | |
36 | BuildRequires: python3-setuptools | |
37 | BuildRequires: python3-setuptools_scm >= 4 | |
38 | BuildRequires: python3-setuptools_scm_git_archive | |
39 | %{?with_system_qhull:BuildRequires: qhull-devel >= 2015.2} | |
40 | BuildRequires: rpm-pythonprov | |
41 | BuildRequires: rpmbuild(macros) >= 1.714 | |
42 | %if %{with tests} | |
43 | BuildRequires: ghostscript | |
44 | BuildRequires: gtk+3 >= 3.0 | |
dc3cc1b8 JB |
45 | # /usr/bin/pdftops |
46 | BuildRequires: poppler-progs | |
a24c9bc5 | 47 | # or PyQt6>=6.1, PySide6, PySide2 |
dc3cc1b8 JB |
48 | BuildRequires: python3-PyQt5 |
49 | BuildRequires: python3-cycler >= 0.10 | |
a24c9bc5 JB |
50 | BuildRequires: python3-dateutil >= 2.7 |
51 | BuildRequires: python3-fonttools >= 4.22.0 | |
dc3cc1b8 | 52 | BuildRequires: python3-kiwisolver >= 1.0.1 |
a24c9bc5 JB |
53 | BuildRequires: python3-packaging >= 20.0 |
54 | BuildRequires: python3-pillow >= 6.2.0 | |
55 | # or cairocffi >= 0.8 | |
56 | BuildRequires: python3-pycairo >= 1.11.0 | |
57 | BuildRequires: python3-pygobject3 >= 3.0 | |
58 | BuildRequires: python3-pyparsing >= 2.2.1 | |
dc3cc1b8 | 59 | BuildRequires: python3-pytest >= 3.6 |
a24c9bc5 JB |
60 | BuildRequires: python3-pytz |
61 | BuildRequires: python3-tkinter >= 1:3.7 | |
62 | BuildRequires: python3-tornado >= 5 | |
63 | #BuildRequires: python3-wxPython >= 4 | |
dc3cc1b8 JB |
64 | # /usr/bin/dvipng |
65 | BuildRequires: texlive | |
a24c9bc5 JB |
66 | BuildRequires: texlive-xetex |
67 | # Font EU1/lmr/m/n/10=[lmroman10-regular]:mapping=tex-text at 10.0pt | |
68 | #BuildRequires: texlive-??? | |
69 | %endif | |
70 | %if %{with doc} | |
71 | BuildRequires: python3-colorspacious | |
72 | BuildRequires: python3-ipython | |
73 | BuildRequires: python3-ipywidgets | |
74 | BuildRequires: python3-mpl-sphinx-theme | |
75 | BuildRequires: python3-numpydoc >= 0.8 | |
76 | BuildRequires: python3-packaging >= 20 | |
77 | BuildRequires: python3-scipy | |
78 | BuildRequires: python3-sphinx_copybutton | |
79 | BuildRequires: python3-sphinx_gallery >= 0.10 | |
80 | BuildRequires: python3-sphinx_panels | |
81 | BuildRequires: python3-sphinxcontrib-svg2pdfconverter >= 1.1.0 | |
82 | BuildRequires: sphinx-pdg >= 2.0.1 | |
83 | %endif | |
84 | %{?with_system_freetype:Requires: freetype >= 1:2.6.1} | |
85 | Requires: python3-modules >= 1:3.7 | |
dc3cc1b8 JB |
86 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
87 | ||
88 | %description | |
89 | matplotlib strives to produce publication quality 2D graphics using | |
90 | matlab plotting for inspiration. Although the main lib is object | |
91 | oriented, there is a functional interface "pylab" for people coming | |
92 | from Matlab. | |
93 | ||
94 | %description -l pl.UTF-8 | |
95 | matplotlib usiłuje tworzyć grafikę 2D o jakości publikacji przy użyciu | |
96 | wykresów matlaba jako inspiracji. Chociaż główna biblioteka jest | |
97 | zorientowana obiektowo, jest interfejs funkcyjny "pylab" dla ludzi | |
98 | przechodzących z Matlaba. | |
99 | ||
100 | %prep | |
101 | %setup -q -n %{module}-%{version} | |
dc3cc1b8 JB |
102 | |
103 | unzip -q %{SOURCE1} -d lib/matplotlib/backends/web_backend | |
104 | ||
a24c9bc5 JB |
105 | cat >mplsetup.cfg <<EOF |
106 | [libs] | |
107 | %if %{with system_freetype} | |
108 | system_freetype = True | |
109 | %endif | |
110 | %if %{with system_qhull} | |
111 | system_qhull = True | |
112 | %endif | |
113 | EOF | |
114 | ||
dc3cc1b8 JB |
115 | %build |
116 | export CFLAGS="%{rpmcflags}" | |
117 | ||
118 | %py3_build | |
119 | ||
120 | %if %{with tests} | |
a24c9bc5 JB |
121 | LIB=$(readlink -f build-3/lib.*) |
122 | ln -sf $(readlink -f lib/matplotlib/tests/baseline_images) $LIB/matplotlib/tests/baseline_images | |
123 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
124 | PYTHONPATH=$LIB \ | |
125 | %{__python3} -m pytest $LIB/matplotlib/tests -m 'not network' | |
126 | %{__rm} $LIB/matplotlib/tests/baseline_images | |
dc3cc1b8 JB |
127 | %endif |
128 | ||
129 | %install | |
130 | rm -rf $RPM_BUILD_ROOT | |
131 | ||
132 | %py3_install | |
133 | ||
134 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/matplotlib/tests | |
135 | # matplotlib can use system fonts, so drop these copies | |
136 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/matplotlib/mpl-data/fonts/ttf/DejaVu*.ttf | |
137 | ||
138 | %clean | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
141 | %files | |
142 | %defattr(644,root,root,755) | |
143 | %doc README.rst LICENSE/LICENSE | |
144 | %dir %{py3_sitedir}/%{module} | |
145 | %{py3_sitedir}/%{module}/*.py | |
146 | %{py3_sitedir}/%{module}/__pycache__ | |
147 | %attr(755,root,root) %{py3_sitedir}/%{module}/*.so | |
a24c9bc5 | 148 | %{py3_sitedir}/%{module}/_api |
dc3cc1b8 JB |
149 | %{py3_sitedir}/%{module}/axes |
150 | %dir %{py3_sitedir}/%{module}/backends | |
151 | %{py3_sitedir}/%{module}/backends/*.py | |
152 | %{py3_sitedir}/%{module}/backends/__pycache__ | |
153 | %attr(755,root,root) %{py3_sitedir}/%{module}/backends/*.so | |
154 | %dir %{py3_sitedir}/%{module}/backends/qt_editor | |
155 | %{py3_sitedir}/%{module}/backends/qt_editor/*.py | |
156 | %{py3_sitedir}/%{module}/backends/qt_editor/__pycache__ | |
157 | %{py3_sitedir}/%{module}/backends/web_backend | |
158 | %{py3_sitedir}/%{module}/cbook | |
dc3cc1b8 JB |
159 | %{py3_sitedir}/%{module}/mpl-data |
160 | %{py3_sitedir}/%{module}/projections | |
161 | %{py3_sitedir}/%{module}/sphinxext | |
162 | %{py3_sitedir}/%{module}/style | |
163 | %{py3_sitedir}/%{module}/testing | |
164 | %{py3_sitedir}/%{module}/tri | |
165 | %{py3_sitedir}/mpl_toolkits | |
166 | %{py3_sitedir}/pylab.py | |
167 | %{py3_sitedir}/__pycache__ | |
168 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info | |
169 | %{py3_sitedir}/%{module}-%{version}-py*-nspkg.pth |