python/elasticsearch: update to 8.16.0
[oi-userland.git] / components / python / dbus-python / Makefile
blob529ea888fe313f6513b9fbf19b191ee6ee81cd37
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL)". You may
4 # only use this file in accordance with the terms of the CDDL.
6 # A full copy of the text of the CDDL should have accompanied this
7 # source. A copy of the CDDL is also available via the Internet at
8 # http://www.illumos.org/license/CDDL.
12 # Copyright 2017 Alexander Pyhalov
13 # Copyright 2019 Michal Nowak
14 # Copyright 2022 Gary Mills
15 # Copyright 2023 Klaus Ziegler
18 BUILD_BITS= 64
19 BUILD_STYLE= setup.py
20 TEST_STYLE= pytest
21 USE_COMMON_TEST_MASTER= yes
22 include ../../../make-rules/shared-macros.mk
24 COMPONENT_NAME= dbus-python
25 COMPONENT_VERSION= 1.3.2
26 COMPONENT_REVISION= 1
27 COMPONENT_PROJECT_URL= https://www.freedesktop.org/wiki/Software/DBusBindings/
28 COMPONENT_SUMMARY= Python bindings for D-Bus
29 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
30 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
31 COMPONENT_ARCHIVE_HASH= sha256:ad67819308618b5069537be237f8e68ca1c7fcc95ee4a121fe6845b1418248f8
32 COMPONENT_ARCHIVE_URL= https://dbus.freedesktop.org/releases/dbus-python/$(COMPONENT_ARCHIVE)
33 COMPONENT_FMRI= library/python/python-dbus
34 COMPONENT_CLASSIFICATTION= Development/Python
35 COMPONENT_LICENSE= MIT
36 COMPONENT_LICENSE_FILE= COPYING
38 PATH= $(PATH.gnu)
40 include $(WS_MAKE_RULES)/common.mk
42 PYTHON_ENV += DBUS_PYTHON_USE_AUTOTOOLS=true
44 # Rename SO files to cpython names
45 COMPONENT_POST_INSTALL_ACTION += \
46 EXT_SUFFIX=$(shell $(PYTHON) -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))") ; \
47 $(MV) $(PROTO_DIR)$(PYTHON_LIB)/_dbus_bindings.so $(PROTO_DIR)$(PYTHON_LIB)/_dbus_bindings$$EXT_SUFFIX ; \
48 $(MV) $(PROTO_DIR)$(PYTHON_LIB)/_dbus_glib_bindings.so $(PROTO_DIR)$(PYTHON_LIB)/_dbus_glib_bindings$$EXT_SUFFIX ;
50 # Copy some uninstalled files to make way for symlinks
51 COMPONENT_POST_INSTALL_ACTION += \
52 $(MKDIR) $(PROTOUSRINCDIR)/dbus-1.0/dbus; \
53 $(CP) $(SOURCE_DIR)/include/dbus/dbus-python.h \
54 $(PROTOUSRINCDIR)/dbus-1.0/dbus/dbus-python.h-$(PYTHON_VERSION) ;
56 COMPONENT_POST_INSTALL_ACTION += \
57 $(MKDIR) $(PROTOUSRLIBDIR64)/pkgconfig; \
58 $(GSED) -e 's|^prefix=.*$$|prefix=$(USRDIR)|' \
59 $(SOURCE_DIR)/dbus-python.pc.in \
60 > $(PROTOUSRLIBDIR64)/pkgconfig/dbus-python.pc-$(PYTHON_VERSION) ;
61 COMPONENT_POST_INSTALL_ACTION += \
62 $(GSED) -i 's|^Version:.*$$|Version: $(COMPONENT_VERSION)|' \
63 $(PROTOUSRLIBDIR64)/pkgconfig/dbus-python.pc-$(PYTHON_VERSION) ;
64 COMPONENT_POST_INSTALL_ACTION += \
65 $(GSED) -i 's|^exec_prefix=.*$$|exec_prefix=$$\{prefix\}|' \
66 $(PROTOUSRLIBDIR64)/pkgconfig/dbus-python.pc-$(PYTHON_VERSION) ;
67 COMPONENT_POST_INSTALL_ACTION += \
68 $(GSED) -i 's|^includedir=.*$$|includedir=$$\{prefix\}/include/dbus-1.0/dbus/|' \
69 $(PROTOUSRLIBDIR64)/pkgconfig/dbus-python.pc-$(PYTHON_VERSION) ;
70 COMPONENT_POST_INSTALL_ACTION += \
71 $(GSED) -i 's|^datarootdir=.*$$|datarootdir=$$\{prefix\}/share/|' \
72 $(PROTOUSRLIBDIR64)/pkgconfig/dbus-python.pc-$(PYTHON_VERSION) ;
73 COMPONENT_POST_INSTALL_ACTION += \
74 $(GSED) -i 's|^datadir=.*$$|datadir=$$\{datarootdir\}|' \
75 $(PROTOUSRLIBDIR64)/pkgconfig/dbus-python.pc-$(PYTHON_VERSION) ;
77 COMPONENT_TEST_ENV= PYTHONPATH=$(PROTO_DIR)$(PYTHON_VENDOR_PACKAGES)
79 # Tests require packages: pytest benchmark pyparsing
80 COMPONENT_TEST_DIR= $(COMPONENT_SRC)/test
81 COMPONENT_TEST_CMD= /usr/bin/pytest-$(PYTHON_VERSION)
82 COMPONENT_TEST_ARGS= test-*.py
84 # Disable test files that have import failures or produce only errors.
85 COMPONENT_PRE_TEST_ACTION = \
86 ( cd $(COMPONENT_TEST_DIR); \
87 for F in test-unusable-main-loop.py test-client.py test-p2p.py \
88 test-signals.py test-service.py; \
89 do \
90 test -f $$F && $(MV) $$F $$F-not; \
91 true; \
92 done )
94 COMPONENT_TEST_TRANSFORMER = $(NAWK)
95 COMPONENT_TEST_TRANSFORMS = "'/passed/ {gsub(\"in.* =*\",\"\"); print $0}'"
97 # Added test dependencies for all python versions
98 TEST_REQUIRED_PACKAGES.python += library/python/pytest
99 TEST_REQUIRED_PACKAGES.python += library/python/pyparsing
100 TEST_REQUIRED_PACKAGES.python += library/python/pytest-benchmark
102 # Auto-generated dependencies
103 PYTHON_REQUIRED_PACKAGES += runtime/python
104 REQUIRED_PACKAGES += library/glib2
105 REQUIRED_PACKAGES += system/library
106 REQUIRED_PACKAGES += system/library/libdbus