perl-cross: bump to version 1.1.4
[buildroot-gz.git] / package / python-pyqt / python-pyqt.mk
blob50e835170f215430dee2f9dd68b4dcc3be1dc3c0
1 ################################################################################
3 # python-pyqt
5 ################################################################################
7 PYTHON_PYQT_VERSION = 4.11.3
8 PYTHON_PYQT_SOURCE = PyQt-x11-gpl-$(PYTHON_PYQT_VERSION).tar.gz
9 PYTHON_PYQT_SITE = http://downloads.sourceforge.net/project/pyqt/PyQt4/PyQt-$(PYTHON_PYQT_VERSION)
10 PYTHON_PYQT_LICENSE = GPLv2 or GPLv3
11 PYTHON_PYQT_LICENSE_FILES = LICENSE.GPL2 LICENSE.GPL3
13 PYTHON_PYQT_DEPENDENCIES = python-sip host-python-sip qt
15 ifeq ($(BR2_PACKAGE_PYTHON),y)
16 PYTHON_PYQT_PYTHON_DIR = python$(PYTHON_VERSION_MAJOR)
17 PYTHON_PYQT_RM_PORT_BASE = port_v3
18 else ifeq ($(BR2_PACKAGE_PYTHON3),y)
19 PYTHON_PYQT_PYTHON_DIR = python$(PYTHON3_VERSION_MAJOR)
20 PYTHON_PYQT_RM_PORT_BASE = port_v2
21 endif
23 ifeq ($(BR2_PACKAGE_QT_EMBEDDED),y)
24 PYTHON_PYQT_QTFLAVOR = WS_QWS
25 else
26 PYTHON_PYQT_QTFLAVOR = WS_X11
27 endif
29 PYTHON_PYQT_QTDETAIL_LICENSE = Open Source
31 ifeq ($(BR2_PACKAGE_QT_SHARED),y)
32 PYTHON_PYQT_QTDETAIL_TYPE = shared
33 endif
35 # Turn off features that aren't available in QWS and current qt
36 # configuration.
37 PYTHON_PYQT_QTDETAIL_DISABLE_FEATURES = \
38 PyQt_Accessibility PyQt_SessionManager \
39 PyQt_Shortcut PyQt_RawFont
41 ifeq ($(BR2_PACKAGE_QT_OPENSSL),)
42 PYTHON_PYQT_QTDETAIL_DISABLE_FEATURES += PyQt_OpenSSL
43 endif
45 # Yes, this looks a bit weird: when OpenGL ES is available, we have to
46 # disable the feature that consists in not having OpenGL ES support.
47 ifeq ($(BR2_PACKAGE_QT_OPENGL_ES),y)
48 PYTHON_PYQT_QTDETAIL_DISABLE_FEATURES += PyQt_NoOpenGLES
49 endif
51 # PyQt_qreal_double must be disabled on a number of architectures that
52 # use float for qreal.
53 ifeq ($(BR2_PACKAGE_PYTHON_PYQT_ARCH_USES_QREAL_FLOAT),y)
54 PYTHON_PYQT_QTDETAIL_DISABLE_FEATURES += PyQt_qreal_double
55 endif
57 define PYTHON_PYQT_QTDETAIL
58 echo $(1) >> $(2)/qtdetail.out
59 endef
61 # Since we can't run generate qtdetail.out by running qtdetail on target device
62 # we must generate the configuration.
63 define PYTHON_PYQT_GENERATE_QTDETAIL
64 $(RM) -f $(1)/qtdetail.out
65 $(call PYTHON_PYQT_QTDETAIL,$(PYTHON_PYQT_QTDETAIL_LICENSE),$(1))
66 $(call PYTHON_PYQT_QTDETAIL,$(PYTHON_PYQT_QTDETAIL_TYPE),$(1))
67 $(foreach f,$(PYTHON_PYQT_QTDETAIL_DISABLE_FEATURES),
68 $(call PYTHON_PYQT_QTDETAIL,$(f),$(1)) \
70 endef
72 PYTHON_PYQT_CONF_OPTS = \
73 --bindir $(TARGET_DIR)/usr/bin \
74 --destdir $(TARGET_DIR)/usr/lib/$(PYTHON_PYQT_PYTHON_DIR)/site-packages \
75 --qmake $(HOST_DIR)/usr/bin/qmake \
76 --sysroot $(STAGING_DIR)/usr \
77 -w --confirm-license \
78 --no-designer-plugin \
79 --no-docstrings \
80 --no-sip-files \
81 --qt-flavor=$(PYTHON_PYQT_QTFLAVOR)
83 # The VendorID related information is only needed for Python 2.x, not
84 # Python 3.x.
85 ifeq ($(BR2_PACKAGE_PYTHON),y)
86 PYTHON_PYQT_CONF_OPTS += \
87 --vendorid-incdir $(STAGING_DIR)/usr/include/$(PYTHON_PYQT_PYTHON_DIR) \
88 --vendorid-libdir $(STAGING_DIR)/usr/lib/$(PYTHON_PYQT_PYTHON_DIR)/config
89 endif
91 define PYTHON_PYQT_CONFIGURE_CMDS
92 $(call PYTHON_PYQT_GENERATE_QTDETAIL,$(@D))
93 (cd $(@D); \
94 $(TARGET_MAKE_ENV) \
95 $(TARGET_CONFIGURE_OPTS) \
96 $(HOST_DIR)/usr/bin/python configure-ng.py \
97 $(PYTHON_PYQT_CONF_OPTS) \
99 endef
101 define PYTHON_PYQT_BUILD_CMDS
102 $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
103 endef
105 # __init__.py is needed to import PyQt4
106 # __init__.pyc is needed if BR2_PACKAGE_PYTHON_PYC_ONLY is set
107 define PYTHON_PYQT_INSTALL_TARGET_CMDS
108 $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) install
109 touch $(TARGET_DIR)/usr/lib/$(PYTHON_PYQT_PYTHON_DIR)/site-packages/PyQt4/__init__.py
110 $(RM) -rf $(TARGET_DIR)/usr/lib/$(PYTHON_PYQT_PYTHON_DIR)/site-packages/PyQt4/uic/$(PYTHON_PYQT_RM_PORT_BASE)
111 endef
113 $(eval $(generic-package))