diff --git a/0003-close-clang-lto.patch b/0003-close-clang-lto.patch new file mode 100644 index 0000000000000000000000000000000000000000..62803719658b6c325f0e0416090ea8cd76c7a8ea --- /dev/null +++ b/0003-close-clang-lto.patch @@ -0,0 +1,25 @@ +From d9223b1d6703cfb65e8f26353377a6e5e37f113c Mon Sep 17 00:00:00 2001 +From: hleft +Date: Tue, 31 Oct 2023 11:11:14 +0800 +Subject: [PATCH] fix clang build error: lto + +--- + setup.py | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/setup.py b/setup.py +index 490850a..dceba6b 100644 +--- a/setup.py ++++ b/setup.py +@@ -154,8 +154,6 @@ class BuildExtraLibraries(setuptools.command.build_ext.build_ext): + else: + ranlib = shutil.which('llvm-ranlib') + if ranlib and has_flag(self.compiler, '-flto'): +- for ext in self.extensions: +- ext.extra_compile_args.append('-flto') + cppflags.append('-flto') + ldflags.append('-flto') + # Needed so FreeType static library doesn't lose its LTO objects. +-- +2.42.0 + diff --git a/python-matplotlib.spec b/python-matplotlib.spec index aae407d780d9a69a84a6814788fb425826efdccd..cf30a9a94987c95543d33d2b34cb321326976a30 100644 --- a/python-matplotlib.spec +++ b/python-matplotlib.spec @@ -1,6 +1,6 @@ Name: python-matplotlib Version: 3.7.1 -Release: 2 +Release: 3 Summary: A comprehensive library for creating static, animated, and interactive visualizations License: Python and MIT and OFL-1.1 and Public Domain URL: https://github.com/matplotlib/matplotlib @@ -10,6 +10,7 @@ Source1: mplsetup.cfg Source1000: https://github.com/QuLogic/mpl-images/archive/v3.7.1-with-freetype-2.12.1/matplotlib-3.7.1-with-freetype-2.12.1.tar.gz Patch0001: 0001-matplotlibrc-path-search-fix.patch Patch0002: 0002-Set-FreeType-version-to-2.12.1-and-update-tolerances.patch +Patch0003: 0003-close-clang-lto.patch BuildRequires: freetype-devel libpng-devel qhull-devel texlive-cm xorg-x11-server-Xvfb zlib-devel BuildRequires: python3-certifi python3-pybind11 gcc-c++ python3-setuptools_scm @@ -92,6 +93,9 @@ Test data for python3-matplotlib. %autosetup -n matplotlib-%{version} -N %patch0001 -p1 %patch0002 -p1 +%if "%toolchain" == "clang" +%patch0003 -p1 +%endif gzip -dc %SOURCE1000 | tar xvf - --transform='s~^mpl-images-3.7.1-with-freetype-2.12.1/\([^/]\+\)/~lib/\1/tests/baseline_images/~' # Copy setup.cfg to the builddir @@ -147,6 +151,9 @@ mv %{buildroot}%{python3_sitearch}/matplotlib/mpl-data %{buildroot}%{_datadir}/m %{python3_sitearch}/matplotlib/backends/{tkagg.*,__pycache__/tkagg.*,_tkagg.*} %changelog +* Tue Oct 31 2023 yoo - 3.7.1-3 +- fix clang build error: lto + * Wed May 10 2023 wulei - 3.7.1-2 - Fix the version cannot be detected