From cddae7d2e914ee96275136cb17edf1ee618b9ae8 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Jul 25 2018 21:53:52 +0000 Subject: Initial import (#1555225). --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2b4bde2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/mplcairo-0.1.tar.gz diff --git a/0001-Don-t-hardcode-march-native.patch b/0001-Don-t-hardcode-march-native.patch new file mode 100644 index 0000000..6c72df4 --- /dev/null +++ b/0001-Don-t-hardcode-march-native.patch @@ -0,0 +1,30 @@ +From 925a50e692de3df5837cb6f6767b08eba9039681 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Sun, 22 Jul 2018 23:22:31 -0400 +Subject: [PATCH 1/2] Don't hardcode -march=native. + +It's not available on all arches and we pass the relevant optimization +flags ourselves anyway. + +Signed-off-by: Elliott Sales de Andrade +--- + setup.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/setup.py b/setup.py +index 8b1ffac..e7ed33b 100644 +--- a/setup.py ++++ b/setup.py +@@ -108,9 +108,6 @@ class build_ext(build_ext): + if os.environ.get("MANYLINUX"): + ext.extra_link_args += ( + ["-static-libgcc", "-static-libstdc++"]) +- else: +- ext.extra_compile_args += ( +- ["-march=native"]) + + elif sys.platform == "darwin": + import cairo +-- +2.17.1 + diff --git a/0002-Remove-extra-requirements.patch b/0002-Remove-extra-requirements.patch new file mode 100644 index 0000000..9ad1af6 --- /dev/null +++ b/0002-Remove-extra-requirements.patch @@ -0,0 +1,27 @@ +From f60c1df1ac542d590ec9b41d85a31bda44070d84 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Sun, 22 Jul 2018 23:23:46 -0400 +Subject: [PATCH 2/2] Remove extra requirements. + +pybind11 is only needed at build time. + +Signed-off-by: Elliott Sales de Andrade +--- + setup.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/setup.py b/setup.py +index e7ed33b..5c4a331 100644 +--- a/setup.py ++++ b/setup.py +@@ -216,7 +216,6 @@ setup( + }, + install_requires=[ + "matplotlib>=2.2", +- "pybind11>=2.2.3", + "pycairo>=1.16.0; os_name == 'posix'", + ], + ) +-- +2.17.1 + diff --git a/README.md b/README.md deleted file mode 100644 index f78e1a8..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# python-mplcairo - -The python-mplcairo package \ No newline at end of file diff --git a/python-mplcairo.spec b/python-mplcairo.spec new file mode 100644 index 0000000..4c9bbc0 --- /dev/null +++ b/python-mplcairo.spec @@ -0,0 +1,122 @@ +%global srcname mplcairo + +Name: python-%{srcname} +Version: 0.1 +Release: 1%{?dist} +Summary: A (new) cairo backend for Matplotlib + +License: MIT +URL: https://github.com/anntzer/mplcairo +Source0: https://files.pythonhosted.org/packages/source/m/%{srcname}/%{srcname}-%{version}.tar.gz +# Fedora-specific patches. +Patch0001: 0001-Don-t-hardcode-march-native.patch +Patch0002: 0002-Remove-extra-requirements.patch + +BuildRequires: gcc-c++ + +%description +This is a new, essentially complete implementation of a cairo backend for +Matplotlib. It can be used in combination with a Qt5, GTK3, Tk, wx, or macOS +UI, or noninteractively (i.e., to save figure to various file formats). +Noteworthy points include: + - Improved accuracy (e.g., with marker positioning, quad meshes, and text + kerning). + - Support for a wider variety of font formats, such as otf and pfb, for vector + (PDF, PS, SVG) backends (Matplotlib's Agg backend also supports such fonts). + - Optional support for complex text layout (right-to-left languages, etc.) + using Raqm. + - Support for embedding URLs in PDF (but not SVG) output. + - Support for multi-page output both for PDF and PS (Matplotlib only supports + multi-page PDF). + - Support for custom blend modes (see `examples/operators.py`). + + +%package -n python3-%{srcname} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{srcname}} + +BuildRequires: cairo-devel >= 1.15.4 +BuildRequires: freetype-devel +BuildRequires: libraqm-devel >= 0.2.0 +BuildRequires: python3-devel +BuildRequires: python3dist(matplotlib) >= 2.2 +BuildRequires: python3-matplotlib-test-data >= 2.2 +BuildRequires: python3dist(pybind11) >= 2.2.3 +BuildRequires: python3dist(pycairo) >= 1.16.0 +BuildRequires: python3dist(pytest) >= 3.2.2 +BuildRequires: python3dist(setuptools) +BuildRequires: python3dist(setuptools-scm) +BuildRequires: python3dist(sphinx) +BuildRequires: texlive-cm + +Requires: cairo >= 1.15.4 +Requires: python3dist(matplotlib) >= 2.2 +Requires: python3dist(pycairo) >= 1.16.0 +Requires: libraqm >= 0.2.0 + +%description -n python3-%{srcname} +This is a new, essentially complete implementation of a cairo backend for +Matplotlib. It can be used in combination with a Qt5, GTK3, Tk, wx, or macOS +UI, or noninteractively (i.e., to save figure to various file formats). +Noteworthy points include: + - Improved accuracy (e.g., with marker positioning, quad meshes, and text + kerning). + - Support for a wider variety of font formats, such as otf and pfb, for vector + (PDF, PS, SVG) backends (Matplotlib's Agg backend also supports such fonts). + - Optional support for complex text layout (right-to-left languages, etc.) + using Raqm. + - Support for embedding URLs in PDF (but not SVG) output. + - Support for multi-page output both for PDF and PS (Matplotlib only supports + multi-page PDF). + - Support for custom blend modes (see `examples/operators.py`). + + +%prep +%autosetup -n %{srcname}-%{version} -p1 + +# Remove bundled egg-info and vendoring +rm -rf %{srcname}.egg-info vendor + + +%build +MPLCAIRO_USE_LIBRAQM=true %py3_build + + +%install +%py3_install + + +%check +export PYTHONPATH="%{buildroot}%{python3_sitearch}" PYTHONDONTWRITEBYTECODE=1 + +%{__python3} -c 'import mplcairo.base' + +MPLBACKEND=module://mplcairo.base %{__python3} - < - 0.1-1 +- Update to final release + +* Mon Apr 16 2018 Elliott Sales de Andrade - 0.1-0.2.a1 +- Remove bundled eggs. +- Add checks and missing Requires. + +* Tue Mar 13 2018 Elliott Sales de Andrade - 0.1-0.1.a1 +- Initial package. diff --git a/sources b/sources new file mode 100644 index 0000000..4dd91dc --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (mplcairo-0.1.tar.gz) = 8e0439446d98216dec5e4c20cc67a7db1a78010cf657a0ac45bf24df79069a4e93a6c3297a539725c9c5daf8403ebfdead96e808edb90245c66e259c44691739