Sync from SUSE:SLFO:Main python-pycairo revision 8f12557688cb5a8e21a3ff64f751f243

This commit is contained in:
Adrian Schröter 2024-05-03 22:02:14 +02:00
commit ebb6e5909f
4 changed files with 689 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

BIN
pycairo-1.24.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

554
python-pycairo.changes Normal file
View File

@ -0,0 +1,554 @@
-------------------------------------------------------------------
Tue Jul 25 18:29:50 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 1.24.0:
* Dropped Python 3.7 support
* Bumped meson version requirement from 0.53.0 to 0.56.0
* Various cairo dependency updates for the Windows wheel build
* Various code cleanups :pr:`306`
* Added Python 3.12 Windows wheels
-------------------------------------------------------------------
Tue Apr 25 12:00:14 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Switch to single spec version build for PSP
-------------------------------------------------------------------
Wed Dec 7 20:50:28 UTC 2022 - Yogalakshmi Arunachalam <yarunachalam@suse.com>
- Update to version 1.23.0
* Reminder to distro packagers: Building/installing pycairo using setup.py is deprecated, please use meson instead.
* git: changed default branch from “master” to “main”
* Windows: Update the cairo version included in the wheels from 1.17.2 to 1.17.6 #pr-243
* docs: Document how to look up pycairo headers without loading the module #pr-300
* tests: dont error out if cairo wasnt built with all features #pr-293
New APIs:
* Status.DWRITE_ERROR #pr-294
* Format.RGB96F, Format.RGBA128F #pr-295
* PDFVersion.VERSION_1_6, PDFVersion.VERSION_1_7 #pr-296
* HAS_DWRITE_FONT #pr-297
* Context.set_hairline(), Context.get_hairline() #pr-298
* PDFSurface.set_custom_metadata() #pr-299
-------------------------------------------------------------------
Mon Nov 28 12:32:35 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org>
- Updtae to version 1.22.0:
* Officially support Python 3.11.
* PDFSurface.version_to_string(): Fix crash with negative
versions.
* typing: ImageSurface.get_stride() returns an int.
* typing: Fix incorrect interface for Matrix constructor.
* typing: Use Generic for Context.
* docs: some cairo.Context fixes.
* docs: try to make create_from_png/write_to_png more clear.
* docs: add an example for how to convert a surface to pillow.
* docs: cairo.Format.RGB24: document that unused bytes may be
overwritten.
* tests: dont depend on specific ref counts.
* tests: compatibility fixes for cairo 1.17.6.
- Drop f5a795ea.patch: fixed upstream.
-------------------------------------------------------------------
Tue Sep 13 15:10:32 UTC 2022 - Bjørn Lie <bjorn.lie@gmail.com>
- Update to version 1.21.0:
* Require Python 3.7+
* Require meson 0.53+
* Using setup.py directly to build/install pycairo is deprecated.
Use meson instead.
* setup.py now requires setuptools. Previously it was optional.
* The complete API reference is now included in the typing stubs,
so it can be consumed/shown by IDEs.
- Add f5a795ea.patch: Some test improvements for cairo 1.17.6
-------------------------------------------------------------------
Sat Jul 16 22:51:05 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Work around vendored distutils in setuptools >= 60 incorrectly
installing pkgconfig files into the wrong libdir
- Deduplicate files in python_sitearch
-------------------------------------------------------------------
Thu Aug 12 08:07:16 UTC 2021 - Frederic Crozat <fcrozat@suse.com>
- Add Obsoletes/Provides for python3-cairo-devel.
-------------------------------------------------------------------
Sat Jul 17 07:00:12 UTC 2021 - Dirk Müller <dmueller@suse.com>
- update to 1.20.1
* setup.py: Respect the PKG_CONFIG environment variable
* Make import_cairo inline in addition to static
* docs: Fix example in Pattern.set_filter() docs _pr_`221`
* docs: Fix build with newer sphinx
* docs: Fix NumPy width, height-conventions in examples
* docs: Last parameter of rel_curve_to should be dy3, not dy4
* mypy: Fixes for mypy 0.800+
* mypy: Don't run mypy via pytest
-------------------------------------------------------------------
Thu Dec 3 10:46:14 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Update to 1.20.0
* Require Python 3.6+ #pr-201
* Require cairo 1.15.10+ #pr-204
* docs: support Sphinx 3.0 #pr-207
* meson: add tests option to skip tests #pr-188
* Windows: build wheels #pr-197
* Add support for Python 3.9 and 3.10 #pr-198 #pr-202
* examples: add a Jupyter Notebook example #pr-181
* Raise an error early when being passed a file object not opened
in binary mode #pr-205
* Add a pyproject.toml file #pr-206
- move header file in sitearch to devel package (rpmlint error)
header is packaged twice: gh#pygobject/pycairo#98
-------------------------------------------------------------------
Wed Dec 2 22:46:52 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Move the pkgconfig file to the common package
gh#openSUSE/python-rpm-macros#66
-------------------------------------------------------------------
Mon Mar 16 09:47:12 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Add missing dep on setuptools
-------------------------------------------------------------------
Mon Mar 16 09:33:07 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 1.19.1:
* support for new python
* remove support for python 2.x
- Remove patch python38.patch
-------------------------------------------------------------------
Mon Oct 7 09:01:40 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Add patch to fix build on python 3.8:
* python38.patch
-------------------------------------------------------------------
Tue May 21 20:22:58 UTC 2019 - Todd R <toddrme2178@gmail.com>
- Fixed conflicts with old python-cario-common-devel
-------------------------------------------------------------------
Tue May 21 16:14:32 UTC 2019 - Todd R <toddrme2178@gmail.com>
- Fix typos
-------------------------------------------------------------------
Sun May 19 16:44:42 UTC 2019 - Todd R <toddrme2178@gmail.com>
- Update to version 1.18.1
* meson: install .egg-info to platlib
* meson: fix configure error with meson 0.50 re absolute paths
* PyPy: dont use PyOS_FSPath() with PyPy3.6
- Rename to python-pycario to conform to python package naming
guidelines
- Expand summaries and descriptions.
-------------------------------------------------------------------
Sat Feb 9 23:45:30 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Update to version 1.18.0:
+ typing: Add missing annotations for __enter__/__exit__
+ New API:
- CAIRO_VERSION, CAIRO_VERSION_STRING, CAIRO_VERSION_MAJOR,
CAIRO_VERSION_MINOR, CAIRO_VERSION_MICRO
- Status.TAG_ERROR, Status.FREETYPE_ERROR, Status.PNG_ERROR,
Status.WIN32_GDI_ERROR
- SVGUnit, PDFMetadata, PDFOutlineFlags
- FontOptions.set_variations(), FontOptions.get_variations()
- Context.tag_begin(), Context.tag_end(), TAG_DEST, TAG_LINK
- PDFSurface.set_page_label(), PDFSurface.set_metadata(),
PDFSurface.set_thumbnail_size(), PDFSurface.add_outline(),
PDF_OUTLINE_ROOT
- SVGSurface.set_document_unit(),
SVGSurface.get_document_unit()
- MIME_TYPE_CCITT_FAX, MIME_TYPE_CCITT_FAX_PARAMS,
MIME_TYPE_EPS, MIME_TYPE_EPS_PARAMS, MIME_TYPE_JBIG2,
MIME_TYPE_JBIG2_GLOBAL, MIME_TYPE_JBIG2_GLOBAL_ID
+ docs: Remove a broken link
+ Various meson build fixes
+ setup.py: Support specifying custom --pkgconfigdir
+ Dropped Python 3.3 support
- Changes from version 1.17.1:
+ Meson build support
- Changes from version 1.17.0:
+ cairo.Surface and cairo.Device can now be used as context
managers
+ Fix a leak when a cairo error was raised
+ Fix a leak when a mapped surface was GCed instead of unmapped
+ Make it possible to use the C API with Python 3 outside of the
compilation unit doing the import by defining PYCAIRO_NO_IMPORT
+ Implement PEP 561
- Changes from version 1.16.3:
+ Ship Python type annotation stubs.
- Changes from version 1.16.2:
+ setup.py: Some fixes for Debian pybuild quirks
- Changes from version 1.16.1:
+ setup.py: correctly install pkgconfig into /usr/lib* again
- Changes from version 1.16.0:
+ Add a get_include() function which returns the compiler include
path needed for interfacing with the Pycairo C API
- Changes from version 1.15.6:
+ Experimental PyPy and PyPy3 support
- Changes from version 1.15.5:
+ Support Unicode paths under Windows with cairo 1.15.10+
+ Dont include the pkg-config file when building a wheel
- Changes from version 1.15.4:
+ Fix some enum conversation errors with (unused) large and
negative values
+ tests: Fix a rare test error
- Changes from version 1.15.3:
+ setup.py: Install pkgconfig file into /usr/share/pkgconfig to
work around JHBuild on Fedora not picking it up.
+ tests: Fix tests on big endian machines.
+ Support building with MSVC
- Changes from version 1.15.2:
+ setup.py: Install pkgconfig file to the same library prefix
that Python uses (replaces logic in spec file)
- Activate test suite.
- Use license macro.
- Requires cairo >= 1.13.1.
-------------------------------------------------------------------
Thu Aug 24 17:51:35 UTC 2017 - zaitor@opensuse.org
- Update to version 1.15.1:
+ Fixes:
- Improved support for Python filesystem paths including
os.PathLike. See pathlike for details.
- Various minor fixes.
+ Changes: Expose cairo.Path.
+ Tests: Improved test coverage from ~70% to ~90%.
- Changes from version 1.15.0:
+ New Features:
- Add Surface.map_to_image() and Surface.unmap_image().
- Add RasterSourcePattern.
- Add Glyph.
- Add Rectangle.
- Add TextCluster.
- Add ScaledFont.text_to_glyphs() and
ScaledFont.glyph_extents().
- Add Context.show_text_glyphs().
- Add TextExtents.
+ Changes:
- Pycairo instances wrapping the same underlying cairo object
now hash and compare equally e.g. context.get_target() ==
context.get_target().
- Functions which returned a cairo error with Status.NO_MEMORY
no longer raise MemoryError, but a subclass of Error and
MemoryError. Similarly errors with Status.READ_ERROR and
Status.WRITE_ERROR no longer raise IOError, but a subclass of
Error and IOError.
- Some functions which previously returned a tuple now return a
tuple subclass like Rectangle, Glyph, TextCluster and
TextExtents.
- Changes from version 1.14.1:
+ Fixes: Fix a crash with Surface.get_device().
- Changes from version 1.14.0:
+ General: Requires at least cairo 1.13.1.
+ Tests: Optional Hypothesis tests.
+ New Features:
- Add Surface.set_device_scale() and
Surface.get_device_scale().
- Add Device.
- Add Surface.get_device().
- Add ScriptDevice and ScriptMode.
- Add ScriptSurface.
- Add Status.JBIG2_GLOBAL_MISSING.
- Add Format.stride_for_width().
- Add TextClusterFlags and SurfaceObserverMode.
- Add Gradient.get_color_stops_rgba().
- Add TeeSurface.
- Add MeshPattern.
- Changes from version 1.13.4:
+ Fixes: Fix a rare crash with get_data() under Python 3 (1.13.3
regression).
-------------------------------------------------------------------
Fri Jun 23 18:12:06 UTC 2017 - jmatejek@suse.com
- fix requires for devel subpackage
-------------------------------------------------------------------
Sun Jun 18 13:11:04 UTC 2017 - dimstar@opensuse.org
- Update to version 1.13.3:
+ Fix ImageSurface leaking in case
:meth:`get_data() <ImageSurface.get_data>` is used under
Python 3 (gh#pygobject/pycairo#43).
- Changes from version 1.13.2:
+ Fix pip failing to install pycairo in some cases
(gh#pygobject/pycairo#39).
- Changes from version 1.13.1:
+ setup.py install: Fix generated pkg-config file if ``--home``
or ``--user`` is specified (gh#pygobject/pycairo#34).
+ Fix a build error on macOS Sierra (gh#pygobject/pycairo#36)
+ examples: Fix snippet examples when .pyc files are present
(gh#pygobject/pycairo#35).
- For more changes since the last package update, see NEWS inside.
- Implement python single-spec packaging: since pycairo 1.11.0, the
sources for python2 and python3 based bindings have been merged
again.
-------------------------------------------------------------------
Sat Feb 25 05:43:51 UTC 2017 - toddrme2178@gmail.com
- Add python2-cairo and python2-cairo-devel provides for
compatibility with the new multipython spec file macros.
-------------------------------------------------------------------
Fri Apr 5 13:23:54 UTC 2013 - idonmez@suse.com
- Add Source URL, see https://en.opensuse.org/SourceUrls
-------------------------------------------------------------------
Mon Oct 8 13:34:23 UTC 2012 - schwab@linux-m68k.org
- Build with %{optflags}
-------------------------------------------------------------------
Wed Feb 1 11:17:32 UTC 2012 - saschpe@suse.de
- Add group to devel package
-------------------------------------------------------------------
Tue Jan 10 07:51:57 UTC 2012 - coolo@suse.com
- trying to get the license right for spdx
-------------------------------------------------------------------
Fri Jun 17 06:22:03 CEST 2011 - vuntz@opensuse.org
- Update to version 1.10.0:
+ New Constants:
- cairo.FORMAT_RGB16_565
+ Bug Fixes:
- context.get_source().get_surface() fails (fdo#33013)
+ Improve/simplify unicode filename and text support.
+ Build related changes.
- Move to using waf for the build as the autotools support is
broken.
- Recompile the generated byte-code with %py_compile, as the
waf-generated byte-code references the build root. This is a bug
in waf, see http://code.google.com/p/waf/issues/detail?id=986
-------------------------------------------------------------------
Sat Sep 18 16:00:21 CEST 2010 - vuntz@opensuse.org
- Update to version 1.8.10:
+ New Classes/Types:
- Win32PrintingSurface
- XCBSurface - add XCB support using xpyb
+ Bug Fixes:
- Fix for libtool 2.2 (fdo#27974).
- Mingw32 and pypy fixes (fdo#25203).
+ Other Changes:
- Tests updated.
-------------------------------------------------------------------
Thu Dec 3 00:31:49 CET 2009 - vuntz@opensuse.org
- Update to version 1.8.8:
+ General Changes:
- Pycairo 1.8.8 requires cairo 1.8.8 (or later).
- Move from CVS to git.
- Add support for the waf build tool.
+ Updated methods
- The PDF/PS/SVGSurface constructors now accept None as a
filename.
-------------------------------------------------------------------
Tue Jul 21 13:16:50 CEST 2009 - lmedinas@gmail.com
- Update to version 1.8.6:
+ Bug Fixes:
- ImageSurface.create_from_png _read_func fix
- ToyFontFace type fix
- fdo#19221: restore cairo.Matrix '*' operator to the way it
originally worked.
+ Documentation completed
-------------------------------------------------------------------
Fri Mar 20 00:02:49 CET 2009 - vuntz@novell.com
- Update to version 1.8.4:
+ General Changes:
- Pycairo 1.8.4 requires cairo 1.8.4 (or later) and Python 2.6
+ Bug Fixes:
- fdo#20674: Add get/set_extend for Gradient Patterns
+ New Classes:
- cairo.ToyFontFace
+ New Methods:
- Pattern.get_extend
- Pattern.set_extend
- ToyFontFace.get_family
- ToyFontFace.get_slant
- ToyFontFace.get_weight
+ Deleted Methods:
- SurfacePattern.get_extend
- SurfacePattern.set_extend
+ Other Changes:
- Threading for surfaces with stream functions has been
reenabled.
- Documentation updates.
- Stop re-defining _prefix.
- Remove unneeded BuildRequires: gtk2-devel, libjpeg-devel,
python-numeric, update-desktop-files.
- Add BuildRequires: cairo-devel, fdupes.
- Remove Suggests on python-numeric (Numeric support was removed).
- Remove Suggests on python-gtk since, well, there's no real reason
to put it.
- Stop running suse_update_config.
- Use fdupes.
-------------------------------------------------------------------
Sun Feb 1 18:20:30 EST 2009 - mboman@suse.de
- Update to version 1.8.2:
+ bfo#19287: Threading support results in crashes in
cairo.ImageSurface
+ Context.set_scaled_font
+ API changes
* Matrix multiplication:
* old code: matrix3 = matrix1 * matrix2
* new equivalent code: matrix3 = matrix1.multiply(matrix2)
* matrix3 = matrix1 * matrix2
is now equivalent to matrix3 = matrix2.multiply(matrix1)
which is consistent with standard matrix multiplication.
-------------------------------------------------------------------
Wed Dec 24 08:01:28 EST 2008 - mboman@suse.de
- Update to version 1.8.0:
+ General Changes:
- Pycairo 1.8.0 requires cairo 1.8.0 (or later).
- Add documentation (available separately)
+ Bug Fixes:
- bfo#18101: Add support for threading
- bfo#18947: cairo.SurfacePattern should INCREF the used surface
+ New Methods:
- ScaledFont.get_scale_matrix
- Surface.mark_dirty_rectangle
- Surface.set_fallback_resolution
+ New Constants:
- cairo.EXTEND_PAD
- cairo.HAS_IMAGE_SURFACE
- cairo.HAS_USER_FONT
+ API Changes:
- Surface.mark_dirty: no longer accepts keyword arguments with default
values.
- PycairoPattern_FromPattern (C API): has a new 'base' argument
+ Other Changes:
- Allow unknown cairo Pattern/Surface types to use the pycairo base
- Pattern/Surface type.
-------------------------------------------------------------------
Fri Sep 12 08:55:06 CDT 2008 - maw@suse.de
- Update to version 1.6.4:
+ Bugs fixed: bfo#16112
+ New methods: Context.has_current_point, Context.path_extents,
ImageSurface.format_stride_for_width, PSSurface.get_eps,
PSSurface.set_eps, PSSurface.ps_level_to_string,
PSSurface.restrict_to_level, Surface.copy_page, and
Surface.show_page
+ New Constants: cairo.PS_LEVEL_2, cairo.PS_LEVEL_3
+ Updated examples.
-------------------------------------------------------------------
Fri Jul 18 15:55:44 CEST 2008 - jpr@suse.de
- Remove libsvg-cairo-devel from BuildRequires, it hasn't been
needed for a long time
-------------------------------------------------------------------
Thu Apr 3 07:11:28 CEST 2008 - hpj@suse.de
- Upgraded to version 1.4.12:
* mingw32 compiler fixes.
* New methods added.
* The module cairo.gtk has been removed.
* Allow cairo.Context to be subclassed.
-------------------------------------------------------------------
Mon Feb 26 13:44:44 CST 2007 - maw@suse.de
- Don't package _cairo.la (#223703).
-------------------------------------------------------------------
Mon Sep 25 18:45:37 CEST 2006 - jhargadon@suse.de
- update to version 1.2.2
- setup.py has been updated to allow installation by executing
$ python setup.py install
- examples/cairo_snippets/snippets/gradient_mask.py
A new example to demonstrate pattern masks.
- The cairo.svg module has been removed because:
1) Cairo does not include SVG parsing, so this module does not belong
in pycairo.
2) libsvg-cairo (the underlying C library) is unmaintained.
- Pycairo requires cairo 1.2.2 (or later)
-------------------------------------------------------------------
Wed Aug 16 11:16:58 CEST 2006 - cthiel@suse.de
- split of -devel package
-------------------------------------------------------------------
Thu Aug 10 17:51:02 CEST 2006 - cthiel@suse.de
- turn Requires to python-gtk and python-numeric into Suggests, as they are
optional anyway
- update to version 1.2.0 (fixes #198391)
* pycairo has been updated to work with cairo 1.2.0.
* new methods: Surface.set_fallback_resolution, Surface_get_content
ImageSurface_get_format, Image_surface_get_stride
* deleted methods: PDFSurface.set_dpi, PSSurface.set_dpi,
SVGSurface.set_dpi
- replaced by Surface.set_fallback_resolution
* cairo.FORMAT_RGB16_565 added
- overview of changes from pycairo 1.0.2 to pycairo 1.1.6
* pycairo has been updated to work with cairo 1.1.6.
* SVGSurface
* new methods: Context.get_group_target, Context.new_sub_path,
Context.pop_group, Context.pop_group_to_source, Context.push_group,
Context.push_group_with_content, FontOptions.get_antialias,
FontOptions.get_hint_metrics, FontOptions.get_hint_style,
FontOptions.get_subpixel_order, FontOptions.set_antialias,
FontOptions.set_hint_metrics, FontOptions.set_hint_style,
FontOptions.set_subpixel_order, PDFSurface.set_size,
PSSurface.dsc_begin_page_setup, PSSurface.dsc_begin_setup,
PSSurface.dsc_comment, PSSurface.set_size, ScaledFont.get_font_face,
ScaledFont.text_extents, Surface.get_device_offset,
XlibSurface.get_depth
* updated methods:
- PDFSurface()/PSSurface() - can now write to file-like objects (like
StringIO).
- surface.write_to_png() and ImageSurface.create_from_png() can now
write to file-like objects (like StringIO).
- select_font_face, show_text, text_extents and text_path now accept
unicode objects.
* misc bug fixes.
* new examples:
- examples/cairo_snippets/snippets_svg.py
- examples/cairo_snippets/snippets/ellipse.py
- examples/cairo_snippets/snippets/group.py
- examples/svg/svgconvert.py
-------------------------------------------------------------------
Wed Jan 25 21:40:46 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Wed Nov 2 17:25:16 CET 2005 - sbrabec@suse.cz
- New SuSE package, version 1.0.2 (#120043).

109
python-pycairo.spec Normal file
View File

@ -0,0 +1,109 @@
#
# spec file for package python-pycairo
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
%define oldpython python
Name: python-pycairo
Version: 1.24.0
Release: 0
Summary: Python Bindings for Cairo
License: LGPL-2.1-or-later OR MPL-1.1
URL: https://github.com/pygobject/pycairo
Source: %{url}/releases/download/v%{version}/pycairo-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: cairo-devel >= 1.15.10
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Provides: python-cairo = %{version}
Obsoletes: python-cairo < %{version}
%python_subpackages
%description
Pycairo is a Python module providing bindings for the cairo graphics library.
%package devel
Summary: Development files for the Cairo Python bindings
Requires: python-devel
Requires: python-pycairo = %{version}
Requires: python-pycairo-common-devel = %{version}
Provides: python-cairo-devel = %{version}
Obsoletes: python-cairo-devel < %{version}
%description devel
Pycairo is a Python module providing bindings for the cairo graphics library.
This package provides the development files needed to build
packages that depend on Pycairo.
%package -n python-pycairo-common-devel
Summary: Headers for the Cairo Python bindings
Requires: cairo-devel
Provides: %{python_module cairo-common-devel = %{version}}
Provides: %{python_module pycairo-common-devel = %{version}}
Obsoletes: %{python_module cairo-common-devel < %{version}}
Provides: %{python_module cairo-devel = %{version}}
Obsoletes: %{python_module cairo-devel < %{version}}
Provides: python-cairo-common-devel = %{version}
Obsoletes: python-cairo-common-devel < %{version}
%description -n python-pycairo-common-devel
Pycairo is a Python module providing bindings for the cairo graphics library.
This package provides the headers and development files needed to build
packages that depend on Pycairo.
%prep
%autosetup -n pycairo-%{version} -p1
%build
%python_build
%install
%python_install
# Incorrectly installed by a python38-setuptools vendored distutils
# which does not play well with the distro patched python38.
# Later flavors installed the correct files into lib64 as well
if [ "%{_libdir}" != "%{_prefix}/lib" -a -d %{buildroot}%{_prefix}/lib/pkgconfig ]; then
rm -r %{buildroot}%{_prefix}/lib/pkgconfig
fi
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
# this is not the deprecated setuptools test call but a custom setup compiling stuff and running pytest
%python_exec setup.py test
%files %{python_files}
%doc NEWS docs
%license COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1
%{python_sitearch}/cairo/
%exclude %{python_sitearch}/cairo/include
%{python_sitearch}/pycairo-*.egg-info
%files %{python_files devel}
%license COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1
%{python_sitearch}/cairo/include
%files -n python-pycairo-common-devel
%license COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1
%{_includedir}/pycairo/
%{_libdir}/pkgconfig/py3cairo.pc
%changelog