gst1-plugins-base: bump to version 1.10.4
[buildroot-gz.git] / package / qt5 / qt5base / qt5base.mk
blob7a335736db21c40097295058a6ba88545937c6f1
1 ################################################################################
3 # qt5base
5 ################################################################################
7 QT5BASE_VERSION = $(QT5_VERSION)
8 QT5BASE_SITE = $(QT5_SITE)
9 QT5BASE_SOURCE = qtbase-opensource-src-$(QT5BASE_VERSION).tar.xz
11 QT5BASE_DEPENDENCIES = host-pkgconf zlib pcre
12 QT5BASE_INSTALL_STAGING = YES
14 # A few comments:
15 # * -no-pch to workaround the issue described at
16 # http://comments.gmane.org/gmane.comp.lib.qt.devel/5933.
17 # * -system-zlib because zlib is mandatory for Qt build, and we
18 # want to use the Buildroot packaged zlib
19 # * -system-pcre because pcre is mandatory to build Qt, and we
20 # want to use the one packaged in Buildroot
21 QT5BASE_CONFIGURE_OPTS += \
22 -optimized-qmake \
23 -no-cups \
24 -no-iconv \
25 -system-zlib \
26 -system-pcre \
27 -no-pch \
28 -shared
30 QT5BASE_CONFIGURE_OPTS += $(call qstrip,$(BR2_PACKAGE_QT5BASE_CUSTOM_CONF_OPTS))
32 # Uses libgbm from mesa3d
33 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
34 QT5BASE_CONFIGURE_OPTS += -kms -gbm
35 QT5BASE_DEPENDENCIES += mesa3d
36 else
37 QT5BASE_CONFIGURE_OPTS += -no-kms
38 endif
40 ifeq ($(BR2_ENABLE_DEBUG),y)
41 QT5BASE_CONFIGURE_OPTS += -debug
42 else
43 QT5BASE_CONFIGURE_OPTS += -release
44 endif
46 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
47 QT5BASE_CONFIGURE_OPTS += -largefile
48 endif
50 ifeq ($(BR2_PACKAGE_QT5BASE_LICENSE_APPROVED),y)
51 QT5BASE_CONFIGURE_OPTS += -opensource -confirm-license
52 ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
53 QT5BASE_LICENSE = GPLv2+ or LGPLv3, GPLv3 with exception(tools), GFDLv1.3 (docs)
54 QT5BASE_LICENSE_FILES = LICENSE.GPL2 LICENSE.GPLv3 LICENSE.GPL3-EXCEPT LICENSE.LGPLv3 LICENSE.FDL
55 else
56 QT5BASE_LICENSE = GPLv3 or LGPLv2.1 with exception or LGPLv3, GFDLv1.3 (docs)
57 QT5BASE_LICENSE_FILES = LICENSE.GPLv3 LICENSE.LGPLv21 LGPL_EXCEPTION.txt LICENSE.LGPLv3 LICENSE.FDL
58 endif
59 ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
60 QT5BASE_LICENSE := $(QT5BASE_LICENSE), BSD-3c (examples)
61 QT5BASE_LICENSE_FILES += header.BSD
62 endif
63 else
64 QT5BASE_LICENSE = Commercial license
65 QT5BASE_REDISTRIBUTE = NO
66 endif
68 QT5BASE_CONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_QT5BASE_CONFIG_FILE))
70 ifneq ($(QT5BASE_CONFIG_FILE),)
71 QT5BASE_CONFIGURE_OPTS += -qconfig buildroot
72 endif
74 ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
75 QT5BASE_DEPENDENCIES += udev
76 endif
78 # Qt5 SQL Plugins
79 ifeq ($(BR2_PACKAGE_QT5BASE_SQL),y)
80 ifeq ($(BR2_PACKAGE_QT5BASE_MYSQL),y)
81 QT5BASE_CONFIGURE_OPTS += -plugin-sql-mysql -mysql_config $(STAGING_DIR)/usr/bin/mysql_config
82 QT5BASE_DEPENDENCIES += mysql
83 else
84 QT5BASE_CONFIGURE_OPTS += -no-sql-mysql
85 endif
87 ifeq ($(BR2_PACKAGE_QT5BASE_PSQL),y)
88 QT5BASE_CONFIGURE_OPTS += -plugin-sql-psql -psql_config $(STAGING_DIR)/usr/bin/pg_config
89 QT5BASE_DEPENDENCIES += postgresql
90 else
91 QT5BASE_CONFIGURE_OPTS += -no-sql-psql
92 endif
94 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_QT),-plugin-sql-sqlite)
95 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),-system-sqlite)
96 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_SYSTEM),sqlite)
97 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_SQLITE_NONE),-no-sql-sqlite)
98 endif
100 ifeq ($(BR2_PACKAGE_QT5BASE_GUI),y)
101 QT5BASE_CONFIGURE_OPTS += -gui -system-freetype
102 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5_VERSION_5_6),-I$(STAGING_DIR)/usr/include/freetype2)
103 QT5BASE_DEPENDENCIES += freetype
104 else
105 QT5BASE_CONFIGURE_OPTS += -no-gui -no-freetype
106 endif
107 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_WIDGETS),-widgets,-no-widgets)
108 # We have to use --enable-linuxfb, otherwise Qt thinks that -linuxfb
109 # is to add a link against the "inuxfb" library.
110 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_LINUXFB),--enable-linuxfb,-no-linuxfb)
111 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),-directfb,-no-directfb)
112 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),directfb)
114 ifeq ($(BR2_PACKAGE_QT5BASE_XCB),y)
115 QT5BASE_CONFIGURE_OPTS += -xcb -system-xkbcommon
116 QT5BASE_DEPENDENCIES += \
117 libxcb \
118 xcb-util-wm \
119 xcb-util-image \
120 xcb-util-keysyms \
121 xlib_libX11 \
122 libxkbcommon
123 ifeq ($(BR2_PACKAGE_QT5BASE_WIDGETS),y)
124 QT5BASE_DEPENDENCIES += xlib_libXext
125 endif
126 else
127 QT5BASE_CONFIGURE_OPTS += -no-xcb
128 endif
130 ifeq ($(BR2_PACKAGE_QT5BASE_OPENGL_DESKTOP),y)
131 QT5BASE_CONFIGURE_OPTS += -opengl desktop
132 QT5BASE_DEPENDENCIES += libgl
133 else ifeq ($(BR2_PACKAGE_QT5BASE_OPENGL_ES2),y)
134 QT5BASE_CONFIGURE_OPTS += -opengl es2
135 QT5BASE_DEPENDENCIES += libgles
136 else
137 QT5BASE_CONFIGURE_OPTS += -no-opengl
138 endif
140 QT5BASE_DEFAULT_QPA = $(call qstrip,$(BR2_PACKAGE_QT5BASE_DEFAULT_QPA))
141 QT5BASE_CONFIGURE_OPTS += $(if $(QT5BASE_DEFAULT_QPA),-qpa $(QT5BASE_DEFAULT_QPA))
143 ifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y)
144 QT5BASE_CONFIGURE_OPTS += -eglfs
145 QT5BASE_DEPENDENCIES += libegl
146 else
147 QT5BASE_CONFIGURE_OPTS += -no-eglfs
148 endif
150 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_OPENSSL),-openssl,-no-openssl)
151 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_OPENSSL),openssl)
153 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_FONTCONFIG),-fontconfig,-no-fontconfig)
154 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_FONTCONFIG),fontconfig)
155 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_GIF),,-no-gif)
156 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_JPEG),-system-libjpeg,-no-libjpeg)
157 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_JPEG),jpeg)
158 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_PNG),-system-libpng,-no-libpng)
159 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_PNG),libpng)
161 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DBUS),-dbus,-no-dbus)
162 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_DBUS),dbus)
164 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_TSLIB),-tslib,-no-tslib)
165 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_TSLIB),tslib)
167 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_LIBGLIB2),-glib,-no-glib)
168 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBGLIB2),libglib2)
170 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_ICU),-icu,-no-icu)
171 QT5BASE_DEPENDENCIES += $(if $(BR2_PACKAGE_QT5BASE_ICU),icu)
173 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_EXAMPLES),-make,-nomake) examples
175 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
176 # gstreamer 0.10 support is broken in qt5multimedia
177 ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BASE),y)
178 QT5BASE_CONFIGURE_OPTS += -gstreamer 1.0
179 QT5BASE_DEPENDENCIES += gst1-plugins-base
180 else
181 QT5BASE_CONFIGURE_OPTS += -no-gstreamer
182 endif
183 endif
185 ifeq ($(BR2_PACKAGE_LIBINPUT),y)
186 QT5BASE_CONFIGURE_OPTS += -libinput
187 QT5BASE_DEPENDENCIES += libinput
188 else
189 QT5BASE_CONFIGURE_OPTS += -no-libinput
190 endif
192 # Build the list of libraries to be installed on the target
193 QT5BASE_INSTALL_LIBS_y += Qt5Core
194 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_XCB) += Qt5XcbQpa
195 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_NETWORK) += Qt5Network
196 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_CONCURRENT) += Qt5Concurrent
197 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_SQL) += Qt5Sql
198 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_TEST) += Qt5Test
199 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_XML) += Qt5Xml
200 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_OPENGL_LIB) += Qt5OpenGL
201 ifeq ($(BR2_PACKAGE_QT5_VERSION_LATEST),y)
202 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS) += Qt5EglFSDeviceIntegration
203 else
204 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_EGLFS) += Qt5EglDeviceIntegration
205 endif
207 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_GUI) += Qt5Gui
208 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_WIDGETS) += Qt5Widgets
209 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_PRINTSUPPORT) += Qt5PrintSupport
211 QT5BASE_INSTALL_LIBS_$(BR2_PACKAGE_QT5BASE_DBUS) += Qt5DBus
213 ifneq ($(QT5BASE_CONFIG_FILE),)
214 define QT5BASE_CONFIGURE_CONFIG_FILE
215 cp $(QT5BASE_CONFIG_FILE) $(@D)/src/corelib/global/qconfig-buildroot.h
216 endef
217 endif
219 define QT5BASE_CONFIGURE_CMDS
220 $(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qmake.conf \
221 $(@D)/mkspecs/devices/linux-buildroot-g++/qmake.conf
222 $(INSTALL) -m 0644 -D $(QT5BASE_PKGDIR)/qplatformdefs.h \
223 $(@D)/mkspecs/devices/linux-buildroot-g++/qplatformdefs.h
224 $(QT5BASE_CONFIGURE_CONFIG_FILE)
225 (cd $(@D); \
226 $(TARGET_MAKE_ENV) \
227 PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
228 PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \
229 PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
230 MAKEFLAGS="$(MAKEFLAGS) -j$(PARALLEL_JOBS)" \
231 ./configure \
232 -v \
233 -prefix /usr \
234 -hostprefix $(HOST_DIR)/usr \
235 -headerdir /usr/include/qt5 \
236 -sysroot $(STAGING_DIR) \
237 -plugindir /usr/lib/qt/plugins \
238 -examplesdir /usr/lib/qt/examples \
239 -no-rpath \
240 -nomake tests \
241 -device buildroot \
242 -device-option CROSS_COMPILE="$(TARGET_CROSS)" \
243 -device-option BR_COMPILER_CFLAGS="$(TARGET_CFLAGS) $(QT5BASE_EXTRA_CFLAGS)" \
244 -device-option BR_COMPILER_CXXFLAGS="$(TARGET_CXXFLAGS) $(QT5BASE_EXTRA_CFLAGS)" \
245 $(QT5BASE_CONFIGURE_OPTS) \
247 endef
249 define QT5BASE_BUILD_CMDS
250 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
251 endef
253 define QT5BASE_INSTALL_STAGING_CMDS
254 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
255 $(QT5_LA_PRL_FILES_FIXUP)
256 endef
258 define QT5BASE_INSTALL_TARGET_LIBS
259 for lib in $(QT5BASE_INSTALL_LIBS_y); do \
260 cp -dpf $(STAGING_DIR)/usr/lib/lib$${lib}.so.* $(TARGET_DIR)/usr/lib || exit 1 ; \
261 done
262 endef
264 define QT5BASE_INSTALL_TARGET_PLUGINS
265 if [ -d $(STAGING_DIR)/usr/lib/qt/plugins/ ] ; then \
266 mkdir -p $(TARGET_DIR)/usr/lib/qt/plugins ; \
267 cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/* $(TARGET_DIR)/usr/lib/qt/plugins ; \
269 endef
271 ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
272 define QT5BASE_INSTALL_TARGET_FONTS
273 if [ -d $(STAGING_DIR)/usr/lib/fonts/ ] ; then \
274 mkdir -p $(TARGET_DIR)/usr/lib/fonts ; \
275 cp -dpfr $(STAGING_DIR)/usr/lib/fonts/* $(TARGET_DIR)/usr/lib/fonts ; \
277 endef
278 endif
280 define QT5BASE_INSTALL_TARGET_EXAMPLES
281 if [ -d $(STAGING_DIR)/usr/lib/qt/examples/ ] ; then \
282 mkdir -p $(TARGET_DIR)/usr/lib/qt/examples ; \
283 cp -dpfr $(STAGING_DIR)/usr/lib/qt/examples/* $(TARGET_DIR)/usr/lib/qt/examples ; \
285 endef
287 ifeq ($(BR2_STATIC_LIBS),y)
288 define QT5BASE_INSTALL_TARGET_CMDS
289 $(QT5BASE_INSTALL_TARGET_FONTS)
290 $(QT5BASE_INSTALL_TARGET_EXAMPLES)
291 endef
292 else
293 define QT5BASE_INSTALL_TARGET_CMDS
294 $(QT5BASE_INSTALL_TARGET_LIBS)
295 $(QT5BASE_INSTALL_TARGET_PLUGINS)
296 $(QT5BASE_INSTALL_TARGET_FONTS)
297 $(QT5BASE_INSTALL_TARGET_EXAMPLES)
298 endef
299 endif
301 $(eval $(generic-package))