xref: /OK3568_Linux_fs/buildroot/package/qt5/qt5webengine/qt5webengine.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# qt5webengine
4#
5################################################################################
6
7QT5WEBENGINE_VERSION = $(QT5_VERSION)
8QT5WEBENGINE_SITE = $(QT5_SITE)/qtwebengine/-/archive/v$(QT5WEBENGINE_VERSION)-lts
9QT5WEBENGINE_SOURCE = qtwebengine-v$(QT5WEBENGINE_VERSION)-lts.tar.bz2
10QT5WEBENGINE_DEPENDENCIES = qt5declarative qt5webchannel
11QT5WEBENGINE_PATCH_DEPENDENCIES = qt5webengine-chromium
12QT5WEBENGINE_INSTALL_STAGING = YES
13QT5WEBENGINE_SYNC_QT_HEADERS = YES
14
15QT5WEBENGINE_LICENSE = GPL-2.0 or LGPL-3.0 or GPL-3.0 or GPL-3.0 with exception
16QT5WEBENGINE_LICENSE_FILES = LICENSE.GPL2 LICENSE.GPL3 LICENSE.GPL3-EXCEPT \
17	LICENSE.GPLv3 LICENSE.LGPL3
18
19# command line argument separator
20QT5WEBENGINE_CONF_OPTS = --
21
22ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
23QT5WEBENGINE_DEPENDENCIES += qt5svg
24endif
25
26ifeq ($(BR2_PACKAGE_QT5BASE_XCB),y)
27QT5WEBENGINE_DEPENDENCIES += \
28	xlib_libXcomposite \
29	xlib_libXcursor \
30	xlib_libXi \
31	xlib_libxkbfile \
32	xlib_libXrandr \
33	xlib_libXScrnSaver \
34	xlib_libXtst
35QT5WEBENGINE_CONF_OPTS += \
36	-feature-webengine-ozone \
37	-feature-webengine-system-libdrm \
38	-feature-webengine-system-x11 \
39	-feature-webengine-system-xkbfile \
40	-feature-webengine-system-xcomposite \
41	-feature-webengine-system-xcursor \
42	-feature-webengine-system-xi \
43	-feature-webengine-system-xproto-gl \
44	-feature-webengine-system-xtst
45else
46QT5WEBENGINE_CONF_OPTS += \
47	-no-feature-webengine-ozone \
48	-no-feature-webengine-system-libdrm \
49	-no-feature-webengine-system-x11 \
50	-no-feature-webengine-system-xkbfile \
51	-no-feature-webengine-system-xcomposite \
52	-no-feature-webengine-system-xcursor \
53	-no-feature-webengine-system-xi \
54	-no-feature-webengine-system-xproto-gl \
55	-no-feature-webengine-system-xtst
56endif
57
58QT5WEBENGINE_DEPENDENCIES += \
59	host-bison \
60	host-flex \
61	host-freetype \
62	host-gperf \
63	host-harfbuzz \
64	host-icu \
65	host-ninja \
66	host-nodejs \
67	host-pkgconf \
68	host-libjpeg \
69	host-libnss \
70	host-libpng \
71	host-python3 \
72	host-webp \
73	host-zlib \
74	ffmpeg \
75	freetype \
76	jpeg \
77	lcms2 \
78	libevent \
79	libnss \
80	libvpx \
81	libxml2 \
82	libxslt \
83	re2 \
84	snappy \
85	webp
86
87QT5WEBENGINE_CONF_OPTS += \
88	-webengine-embedded-build \
89	-webengine-ffmpeg \
90	-webengine-icu \
91	-webengine-opus \
92	-webengine-webchannel \
93	-webengine-webp \
94	-feature-build-qtwebengine-core \
95	-feature-webengine-core-support \
96	-feature-webengine-system-dbus \
97	-feature-webengine-system-fontconfig \
98	-feature-webengine-system-freetype \
99	-feature-webengine-system-glib \
100	-feature-webengine-system-glibc \
101	-feature-webengine-system-harfbuzz \
102	-feature-webengine-system-jpeg \
103	-feature-webengine-system-khr \
104	-feature-webengine-system-lcms2 \
105	-feature-webengine-system-libevent \
106	-feature-webengine-system-libvpx \
107	-feature-webengine-system-libxml2 \
108	-feature-webengine-system-ninja \
109	-feature-webengine-system-nss \
110	-feature-webengine-system-png \
111	-feature-webengine-system-re2 \
112	-feature-webengine-system-snappy \
113	-feature-webengine-system-zlib
114
115QT5WEBENGINE_CONF_OPTS += \
116	-no-webengine-geolocation \
117	-no-webengine-kerberos \
118	-no-webengine-pepper-plugins \
119	-no-webengine-printing-and-pdf \
120	-no-webengine-spellchecker \
121	-no-webengine-webrtc-pipewire \
122	-no-feature-webengine-developer-build \
123	-no-feature-webengine-full-debug-info \
124	-no-feature-webengine-native-spellchecker \
125	-no-feature-webengine-noexecstack \
126	-no-feature-webengine-system-minizip \
127	-no-feature-webengine-system-gn
128
129ifeq ($(BR2_PACKAGE_QT5WEBENGINE_WEBRTC),y)
130QT5WEBENGINE_CONF_OPTS += -webengine-webrtc
131else
132QT5WEBENGINE_CONF_OPTS += -no-webengine-webrtc
133endif
134
135ifeq ($(BR2_PACKAGE_QT5WEBENGINE_PROPRIETARY_CODECS),y)
136QT5WEBENGINE_CONF_OPTS += -webengine-proprietary-codecs
137else
138QT5WEBENGINE_CONF_OPTS += -no-webengine-proprietary-codecs
139endif
140
141ifeq ($(BR2_PACKAGE_QT5WEBENGINE_ALSA),y)
142QT5WEBENGINE_DEPENDENCIES += alsa-lib
143QT5WEBENGINE_CONF_OPTS += -webengine-alsa
144else
145QT5WEBENGINE_CONF_OPTS += -no-webengine-alsa
146endif
147
148ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
149QT5WEBENGINE_DEPENDENCIES += pulseaudio
150QT5WEBENGINE_CONF_OPTS += -webengine-pulseaudio
151else
152QT5WEBENGINE_CONF_OPTS += -no-webengine-pulseaudio
153endif
154
155QT5WEBENGINE_ENV = \
156	PATH=$(@D)/host-bin:$(BR_PATH) \
157	PKG_CONFIG_SYSROOT_DIR="/"
158define QT5WEBENGINE_CREATE_HOST_PYTHON_WRAPPER
159	mkdir -p $(@D)/host-bin
160	sed s%@HOST_DIR@%$(HOST_DIR)%g $(QT5WEBENGINE_PKGDIR)/host-python-wrapper.in > $(@D)/host-bin/python
161	chmod +x $(@D)/host-bin/python
162endef
163QT5WEBENGINE_PRE_CONFIGURE_HOOKS += QT5WEBENGINE_CREATE_HOST_PYTHON_WRAPPER
164
165QT5WEBENGINE_ENV += NINJAFLAGS="-j$(PARALLEL_JOBS)"
166
167define QT5WEBENGINE_COPY_CHROMIUM
168	rm -rf $(@D)/src/3rdparty
169	cp -a $(QT5WEBENGINE_CHROMIUM_DIR) $(@D)/src/3rdparty
170endef
171QT5WEBENGINE_POST_PATCH_HOOKS += QT5WEBENGINE_COPY_CHROMIUM
172
173define QT5WEBENGINE_CREATE_HOST_PKG_CONFIG
174	mkdir -p $(@D)/host-bin
175	sed s%@HOST_DIR@%$(HOST_DIR)%g $(QT5WEBENGINE_PKGDIR)/host-pkg-config.in > $(@D)/host-bin/host-pkg-config
176	chmod +x $(@D)/host-bin/host-pkg-config
177endef
178QT5WEBENGINE_PRE_CONFIGURE_HOOKS += QT5WEBENGINE_CREATE_HOST_PKG_CONFIG
179QT5WEBENGINE_ENV += \
180	GN_PKG_CONFIG_HOST=$(@D)/host-bin/host-pkg-config \
181	GN_HOST_TOOLCHAIN_EXTRA_CPPFLAGS="$(HOST_CPPFLAGS)"
182
183QT5WEBENGINE_CONF_ENV = $(QT5WEBENGINE_ENV)
184QT5WEBENGINE_MAKE_ENV = $(QT5WEBENGINE_ENV)
185
186define QT5WEBENGINE_INSTALL_TARGET_ENV
187	$(INSTALL) -D -m 644 $(QT5WEBENGINE_PKGDIR)/qtwebengine.sh \
188		$(TARGET_DIR)/etc/profile.d/qtwebengine.sh
189endef
190QT5WEBENGINE_POST_INSTALL_TARGET_HOOKS += QT5WEBENGINE_INSTALL_TARGET_ENV
191
192ifeq ($(BR2_PACKAGE_LIBV4L_RKMPP),y)
193define QT5WEBENGINE_INSTALL_INIT_SYSV
194	$(INSTALL) -D -m 755 $(QT5WEBENGINE_PKGDIR)/S99qtwebengine.sh \
195		$(TARGET_DIR)/etc/init.d/S99qtwebengine.sh
196endef
197endif
198
199$(eval $(qmake-package))
200