2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # This file was automatically generated using the following command:
14 # $WS_TOOLS/python-integrate-project pycairo
17 BUILD_STYLE
= pyproject
18 # Force setup.py build style - see https://github.com/pygobject/pycairo/issues/312
19 BUILD_STYLE
= setup.py
21 include ..
/..
/..
/make-rules
/shared-macros.mk
23 COMPONENT_NAME
= pycairo
24 HUMAN_VERSION
= 1.26.1
25 COMPONENT_SUMMARY
= Python interface for cairo
26 COMPONENT_PROJECT_URL
= https
://pycairo.readthedocs.io
27 COMPONENT_ARCHIVE_HASH
= \
28 sha256
:a11b999ce55b798dbf13516ab038e0ce8b6ec299b208d7c4e767a6f7e68e8430
29 COMPONENT_LICENSE
= LGPL-2.1
-only OR MPL-1.1
33 # We cannot obsolete pycairo-27 yet because it is needed by pygtk2-27 and
34 # pygtk2-27 is needed by gimp.
35 PYTHON_VERSIONS_OBSOLETING
:= $(filter-out 2.7, $(PYTHON_VERSIONS_OBSOLETING
))
37 # Install common files to /usr
38 PYTHON_DATA
= $(USRDIR
)
40 include $(WS_MAKE_RULES
)/common.mk
42 # The pkgconfig file should go to proper place
43 COMPONENT_INSTALL_ARGS
+= install_pkgconfig
--pkgconfigdir
=$(PKG_CONFIG_PATH.
$(BITS
))
45 # Rename headers and pkgconfig files to contain version number
46 COMPONENT_POST_INSTALL_ACTION
+= \
47 for f in
$(PROTOUSRINCDIR
)/pycairo
/* $(PROTO_DIR
)$(PKG_CONFIG_PATH.
$(BITS
))/* ; do \
48 [ -f
$$f ] || continue
; \
49 for v in
$(PYTHON_VERSIONS
) ; do \
50 [ "$$f" == "$${f%%$$v}" ] || continue
2 ; \
52 $(MV
) $$f $$f-$(PYTHON_VERSION
) ; \
55 # Tests are run from build directory which contains cloned copy of sdist. We
56 # try to ask Python to find tested modules in the proto area (the PYTHONPATH is
57 # set accordingly), but Python (< 3.11) always adds the current directory to
58 # sys.path and there is no known (simple) way how to avoid that. Except -I,
59 # but that would cause Python to ignore PYTHONPATH too so we would not have
60 # access to the proto area either. The -P option together with PYTHONSAFEPATH
61 # environment variable were added to Python 3.11 only so we cannot use them yet
62 # for all Python versions we support.
64 # Since sdist for this project contains the main module in the top-level
65 # directory we cannot force Python to skip it. But, unfortunately, this module
66 # does not contain built dynamic libraries, so Python cannot find them while
69 # To workaround this we rename the main module in the build directory during
70 # testing so Python will need to defer to PYTHONPATH.
71 COMPONENT_PRE_TEST_ACTION
+= \
72 $(MV
) $(@D
)/cairo
$(@D
)/cairo-RENAMED
;
73 COMPONENT_POST_TEST_ACTION
+= \
74 $(MV
) $(@D
)/cairo-RENAMED
$(@D
)/cairo
;
76 # Replace Python version in header and pkgconfig file names
77 GENERATE_EXTRA_CMD
+= | \
78 $(GSED
) -e
's/\(py3cairo\.[hpc]*-\)3\.[0-9]*$$/\1$$(PYVER)/' | uniq
80 # Auto-generated dependencies
81 PYTHON_REQUIRED_PACKAGES
+= runtime
/python
82 REQUIRED_PACKAGES
+= library
/desktop
/cairo
83 REQUIRED_PACKAGES
+= system
/library