libunibreak: update to 6.1
[oi-userland.git] / components / python / compizconfig-python / Makefile
blob88d44874ea28a289372260c4713d43b0eeaa6315
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 (c) 2014 Alexander Pyhalov
13 # Copyright (c) 2018 Michal Nowak
16 include ../../../make-rules/shared-macros.mk
18 COMPONENT_NAME= compizconfig-python
19 COMPONENT_VERSION= 0.8.18
20 COMPONENT_REVISION= 2
21 COMPONENT_SUMMARY= compizconfig libraries - is an alternative configuration system for compiz
22 COMPONENT_CLASSIFICATION= Development/Python
23 COMPONENT_PROJECT_URL= http://www.northfield.ws
24 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
25 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
26 COMPONENT_ARCHIVE_HASH= \
27 sha256:9a8bd0adb7e9a3893f9499fcfdaa354952f7ec2eb2eb4f39c43318f5b4cfc908
28 COMPONENT_ARCHIVE_URL= http://www.northfield.ws/projects/compiz/releases/$(COMPONENT_VERSION)/$(COMPONENT_SRC).tar.xz
29 COMPONENT_FMRI= library/python/python-compizconfig
30 COMPONENT_LICENSE= GPL-2.0-only
31 COMPONENT_LICENSE_FILE= COPYING
33 SINGLE_PYTHON_VERSION = no
35 define python-variant-rule
36 VARIANT_PYTHON.$(1) = $(BUILD_DIR)/python-$(1)
37 endef
38 $(foreach pyver, $(PYTHON_VERSIONS), $(eval $(call python-variant-rule,$(pyver))))
40 VARIANTS_64 =
41 define variants-rule
42 VARIANTS_64 += $(VARIANT_PYTHON.$(1))
43 $(VARIANT_PYTHON.$(1))/$(MACH64)/.configured: BITS=64
44 $(VARIANT_PYTHON.$(1))/$(MACH64)/.configured: PYTHON_VERSION=$(1)
45 $(VARIANT_PYTHON.$(1))/$(MACH64)/.built: BITS=64
46 $(VARIANT_PYTHON.$(1))/$(MACH64)/.built: PYTHON_VERSION=$(1)
47 $(VARIANT_PYTHON.$(1))/$(MACH64)/.installed: BITS=64
48 $(VARIANT_PYTHON.$(1))/$(MACH64)/.installed: PYTHON_VERSION=$(1)
49 endef
50 $(foreach pyver, $(PYTHON_VERSIONS), $(eval $(call variants-rule,$(pyver))))
52 BUILD_64 = $(VARIANTS_64:%=%/$(MACH64)/.built)
53 INSTALL_64 = $(VARIANTS_64:%=%/$(MACH64)/.installed)
55 TEST_TARGET = $(NO_TESTS)
57 include $(WS_MAKE_RULES)/common.mk
59 CONFIGURE_ENV += PATH=$(PATH)
60 CONFIGURE_ENV += PYTHON=$(PYTHON)
61 CONFIGURE_ENV += am_cv_python_pythondir="$(PYTHON_LIB)"
62 CONFIGURE_ENV += am_cv_python_pyexecdir="$(PYTHON_LIB)"
64 CONFIGURE_OPTIONS += --disable-static
65 CONFIGURE_OPTIONS += --with-cython=cython-$(PYTHON_VERSION)
67 # Rename pkgconfig files in PKG_CONFIG_PATH to contain version number
68 COMPONENT_POST_INSTALL_ACTION += \
69 for f in $(PROTO_DIR)$(PKG_CONFIG_PATH.$(BITS))/* ; do \
70 [[ -f $$f ]] || continue ; \
71 for v in $(PYTHON_VERSIONS) ; do \
72 [[ "$$f" == "$${f%%$$v}" ]] || continue 2 ; \
73 done ; \
74 $(MV) $$f $$f-$(PYTHON_VERSION) ; \
75 done ;
76 # Rename the generated library to follow Python SOABI naming scheme
77 COMPONENT_POST_INSTALL_ACTION += \
78 EXT_SUFFIX=$(shell $(PYTHON) -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))") ; \
79 $(MV) $(PROTO_DIR)$(PYTHON_LIB)/compizconfig.so $(PROTO_DIR)$(PYTHON_LIB)/compizconfig$$EXT_SUFFIX ;
81 # We need to add -$(PYV) to package fmri
82 GENERATE_EXTRA_CMD += | \
83 $(GSED) -e 's/^\(set name=pkg.fmri [^@]*\)\(.*\)$$/\1-$$(PYV)\2/'
84 # Replace Python version in pkgconfig file names
85 GENERATE_EXTRA_CMD += | \
86 $(GSED) -e 's|\(pkgconfig/compizconfig-python\.pc-\)3\.[0-9]*$$|\1$$(PYVER)|' | uniq
88 # Manually added dependencies
89 PYTHON_REQUIRED_PACKAGES += library/python/cython
90 PYTHON_REQUIRED_PACKAGES += runtime/python
92 # Auto-generated dependencies
93 REQUIRED_PACKAGES += desktop/compiz/library/libcompizconfig
94 REQUIRED_PACKAGES += system/library