mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-10 08:14:09 -09:00
The configure flag -feature-webengine-system-jpeg[1] checks if a jpeg
library is in the sysroot.
It compiles a test file linked against the symbols jpeg_crop_scanline()
and jpeg_skip_scanlines()[2] that are specific to jpep-turbo.
As a consequence, the configure scripts fails if the libjpeg is selected
as the jpeg variant as the symbols mentionend above are not part of the
jpeg library installed in the sysroots.
ERROR: Feature 'webengine-system-jpeg' was enabled, but the pre-condition 'config.unix && features.system-jpeg && libs.webengine-jpeglib' failed.
Additionally, see the log below, extracted from config.log:
> /home/gportay/src/buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-g++ -c -pipe -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g0 -D_FORTIFY_SOURCE=1 -mtune=arm1176jzf-s -march=armv6 --sysroot=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot -w -fPIC -I. -I/home/gportay/src/buildroot/output/host/mkspecs/devices/linux-buildroot-g++ -o main.o main.cpp
> main.cpp: In function ‘int main(int, char**)’:
> main.cpp:12:5: error: ‘jpeg_crop_scanline’ was not declared in this scope; did you mean ‘jpeg_write_scanlines’?
> 12 | jpeg_crop_scanline(nullptr, &dummy, &dummy);
> | ^~~~~~~~~~~~~~~~~~
> | jpeg_write_scanlines
> main.cpp:13:5: error: ‘jpeg_skip_scanlines’ was not declared in this scope; did you mean ‘jpeg_write_scanlines’?
> 13 | jpeg_skip_scanlines(nullptr, dummy);
> | ^~~~~~~~~~~~~~~~~~~
> | jpeg_write_scanlines
> make[1]: *** [Makefile:334: main.o] Error 1
> make[1]: Leaving directory '/home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib'
We could build some complicated logic to make sure what qt5webengine is
only used with jpeg-turbo. However, Chromium bundles jpeg-turbo[3][4]
and uses it if not using the system jpeg library or qt-jpeg[5]. It is
simpler to just always use that version instead of the system jpeg
library.
This sets the configure option -nofeature-webengine-system-jpeg and
removes jpeg from the dependencies.
Note that host-libjpeg and qt-jpeg (and therefore, system libjpeg or
jpeg-turbo) are still needed for the Qt integration layer, even if
chromium uses the bundled jpeg-turbo.
[1]: https://github.com/qt/qtwebengine/blob/v5.15.14-lts/src/buildtools/configure.json#L609-L613
[2]: https://github.com/qt/qtwebengine/blob/v5.15.14-lts/src/buildtools/configure.json#L95-L116
[3]: 18c9261dc5/chromium/third_party/libjpeg_turbo
[4]: 18c9261dc5/chromium/third_party/libjpeg.gni
[5]: https://github.com/qt/qtwebengine/blob/v5.15.14-lts/src/buildtools/configure.json#L614-618
Fixes:
looking for library webengine-jpeglib
Trying source 0 (type pkgConfig) of library webengine-jpeglib ...
+ PKG_CONFIG_SYSROOT_DIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot PKG_CONFIG_LIBDIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/share/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/arm-buildroot-linux-gnueabihf/pkgconfig /home/gportay/src/buildroot/output/host/bin/pkg-config --exists --silence-errors libjpeg
+ PKG_CONFIG_SYSROOT_DIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot PKG_CONFIG_LIBDIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/share/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/arm-buildroot-linux-gnueabihf/pkgconfig /home/gportay/src/buildroot/output/host/bin/pkg-config --modversion libjpeg
> 9.6.0
+ PKG_CONFIG_SYSROOT_DIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot PKG_CONFIG_LIBDIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/share/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/arm-buildroot-linux-gnueabihf/pkgconfig /home/gportay/src/buildroot/output/host/bin/pkg-config --libs-only-L libjpeg
> -L/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib
+ PKG_CONFIG_SYSROOT_DIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot PKG_CONFIG_LIBDIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/share/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/arm-buildroot-linux-gnueabihf/pkgconfig /home/gportay/src/buildroot/output/host/bin/pkg-config --libs-only-l libjpeg
> -ljpeg
+ PKG_CONFIG_SYSROOT_DIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot PKG_CONFIG_LIBDIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/share/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/arm-buildroot-linux-gnueabihf/pkgconfig /home/gportay/src/buildroot/output/host/bin/pkg-config --cflags libjpeg
> -I/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/include
+ cd /home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib && PKG_CONFIG_SYSROOT_DIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot PKG_CONFIG_LIBDIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/share/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/arm-buildroot-linux-gnueabihf/pkgconfig /home/gportay/src/buildroot/output/host/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" -early "CONFIG += cross_compile" 'QMAKE_USE += webengine-jpeglib' 'QMAKE_LIBS_WEBENGINE_JPEGLIB = -L/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -ljpeg' /home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib
+ cd /home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib && MAKEFLAGS= make
> make[1]: Entering directory '/home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib'
> /home/gportay/src/buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-g++ -c -pipe -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g0 -D_FORTIFY_SOURCE=1 -mtune=arm1176jzf-s -march=armv6 --sysroot=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot -w -fPIC -I. -I/home/gportay/src/buildroot/output/host/mkspecs/devices/linux-buildroot-g++ -o main.o main.cpp
> main.cpp: In function ‘int main(int, char**)’:
> main.cpp:12:5: error: ‘jpeg_crop_scanline’ was not declared in this scope; did you mean ‘jpeg_write_scanlines’?
> 12 | jpeg_crop_scanline(nullptr, &dummy, &dummy);
> | ^~~~~~~~~~~~~~~~~~
> | jpeg_write_scanlines
> main.cpp:13:5: error: ‘jpeg_skip_scanlines’ was not declared in this scope; did you mean ‘jpeg_write_scanlines’?
> 13 | jpeg_skip_scanlines(nullptr, dummy);
> | ^~~~~~~~~~~~~~~~~~~
> | jpeg_write_scanlines
> make[1]: *** [Makefile:334: main.o] Error 1
> make[1]: Leaving directory '/home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib'
=> source failed verification.
Trying source 1 (type inline) of library webengine-jpeglib ...
+ cd /home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib && PKG_CONFIG_SYSROOT_DIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot PKG_CONFIG_LIBDIR=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/share/pkgconfig:/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/arm-buildroot-linux-gnueabihf/pkgconfig /home/gportay/src/buildroot/output/host/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" -early "CONFIG += cross_compile" 'QMAKE_USE += webengine-jpeglib' 'QMAKE_LIBS_WEBENGINE_JPEGLIB = -ljpeg' /home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib
+ cd /home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib && MAKEFLAGS= make clean && MAKEFLAGS= make
> make[1]: Entering directory '/home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib'
> rm -f main.o
> rm -f *~ core *.core
> make[1]: Leaving directory '/home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib'
> make[1]: Entering directory '/home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib'
> /home/gportay/src/buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-g++ -c -pipe -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g0 -D_FORTIFY_SOURCE=1 -mtune=arm1176jzf-s -march=armv6 --sysroot=/home/gportay/src/buildroot/output/host/arm-buildroot-linux-gnueabihf/sysroot -w -fPIC -I. -I/home/gportay/src/buildroot/output/host/mkspecs/devices/linux-buildroot-g++ -o main.o main.cpp
> main.cpp: In function ‘int main(int, char**)’:
> main.cpp:12:5: error: ‘jpeg_crop_scanline’ was not declared in this scope; did you mean ‘jpeg_write_scanlines’?
> 12 | jpeg_crop_scanline(nullptr, &dummy, &dummy);
> | ^~~~~~~~~~~~~~~~~~
> | jpeg_write_scanlines
> main.cpp:13:5: error: ‘jpeg_skip_scanlines’ was not declared in this scope; did you mean ‘jpeg_write_scanlines’?
> 13 | jpeg_skip_scanlines(nullptr, dummy);
> | ^~~~~~~~~~~~~~~~~~~
> | jpeg_write_scanlines
> make[1]: *** [Makefile:334: main.o] Error 1
> make[1]: Leaving directory '/home/gportay/src/buildroot/output/build/qt5webengine-5.15.14/config.tests/webengine-jpeglib'
=> source failed verification.
test config.qtwebengine_buildtools.libraries.webengine-jpeglib FAILED
Signed-off-by: Gaël PORTAY <gael.portay@rtone.fr>
[Arnout: always use the bundled jpeg-turbo]
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
(cherry picked from commit 3271ce10f2)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
176 lines
5.0 KiB
Makefile
176 lines
5.0 KiB
Makefile
################################################################################
|
|
#
|
|
# qt5webengine
|
|
#
|
|
################################################################################
|
|
|
|
QT5WEBENGINE_VERSION = $(QT5_VERSION)
|
|
QT5WEBENGINE_SITE = $(QT5_SITE)/qtwebengine/-/archive/v$(QT5WEBENGINE_VERSION)-lts
|
|
QT5WEBENGINE_SOURCE = qtwebengine-v$(QT5WEBENGINE_VERSION)-lts.tar.bz2
|
|
QT5WEBENGINE_DEPENDENCIES = qt5declarative qt5webchannel
|
|
QT5WEBENGINE_PATCH_DEPENDENCIES = qt5webengine-chromium
|
|
QT5WEBENGINE_INSTALL_STAGING = YES
|
|
QT5WEBENGINE_SYNC_QT_HEADERS = YES
|
|
|
|
QT5WEBENGINE_LICENSE = GPL-2.0 or LGPL-3.0 or GPL-3.0 or GPL-3.0 with exception
|
|
QT5WEBENGINE_LICENSE_FILES = LICENSE.GPL2 LICENSE.GPL3 LICENSE.GPL3-EXCEPT \
|
|
LICENSE.GPLv3 LICENSE.LGPL3
|
|
|
|
# command line argument separator
|
|
QT5WEBENGINE_CONF_OPTS = --
|
|
|
|
ifeq ($(BR2_PACKAGE_QT5BASE_EXAMPLES),y)
|
|
QT5WEBENGINE_DEPENDENCIES += qt5svg
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_QT5BASE_XCB),y)
|
|
QT5WEBENGINE_DEPENDENCIES += \
|
|
xlib_libXcomposite \
|
|
xlib_libXcursor \
|
|
xlib_libXi \
|
|
xlib_libxkbfile \
|
|
xlib_libXrandr \
|
|
xlib_libXScrnSaver \
|
|
xlib_libXtst
|
|
QT5WEBENGINE_CONF_OPTS += \
|
|
-feature-webengine-ozone \
|
|
-feature-webengine-system-libdrm \
|
|
-feature-webengine-system-x11 \
|
|
-feature-webengine-system-xkbfile \
|
|
-feature-webengine-system-xcomposite \
|
|
-feature-webengine-system-xcursor \
|
|
-feature-webengine-system-xi \
|
|
-feature-webengine-system-xproto-gl \
|
|
-feature-webengine-system-xtst
|
|
else
|
|
QT5WEBENGINE_CONF_OPTS += \
|
|
-no-feature-webengine-ozone \
|
|
-no-feature-webengine-system-libdrm \
|
|
-no-feature-webengine-system-x11 \
|
|
-no-feature-webengine-system-xkbfile \
|
|
-no-feature-webengine-system-xcomposite \
|
|
-no-feature-webengine-system-xcursor \
|
|
-no-feature-webengine-system-xi \
|
|
-no-feature-webengine-system-xproto-gl \
|
|
-no-feature-webengine-system-xtst
|
|
endif
|
|
|
|
QT5WEBENGINE_DEPENDENCIES += \
|
|
host-bison \
|
|
host-flex \
|
|
host-freetype \
|
|
host-gperf \
|
|
host-harfbuzz \
|
|
host-ninja \
|
|
host-nodejs \
|
|
host-pkgconf \
|
|
host-libjpeg \
|
|
host-libnss \
|
|
host-libpng \
|
|
host-python3 \
|
|
host-webp \
|
|
host-zlib \
|
|
freetype \
|
|
lcms2 \
|
|
libevent \
|
|
libnss \
|
|
libvpx \
|
|
libxml2 \
|
|
libxslt \
|
|
opus \
|
|
snappy \
|
|
webp
|
|
|
|
QT5WEBENGINE_CONF_OPTS += \
|
|
-webengine-embedded-build \
|
|
-webengine-opus \
|
|
-webengine-webchannel \
|
|
-webengine-webp \
|
|
-feature-build-qtwebengine-core \
|
|
-feature-webengine-core-support \
|
|
-feature-webengine-noexecstack \
|
|
-feature-webengine-system-dbus \
|
|
-feature-webengine-system-fontconfig \
|
|
-feature-webengine-system-freetype \
|
|
-feature-webengine-system-glib \
|
|
-feature-webengine-system-glibc \
|
|
-feature-webengine-system-harfbuzz \
|
|
-feature-webengine-system-khr \
|
|
-feature-webengine-system-lcms2 \
|
|
-feature-webengine-system-libevent \
|
|
-feature-webengine-system-libvpx \
|
|
-feature-webengine-system-libxml2 \
|
|
-feature-webengine-system-ninja \
|
|
-feature-webengine-system-nss \
|
|
-feature-webengine-system-png \
|
|
-feature-webengine-system-snappy \
|
|
-feature-webengine-system-zlib
|
|
|
|
QT5WEBENGINE_CONF_OPTS += \
|
|
-no-webengine-geolocation \
|
|
-no-webengine-kerberos \
|
|
-no-webengine-pepper-plugins \
|
|
-no-webengine-printing-and-pdf \
|
|
-no-webengine-spellchecker \
|
|
-no-webengine-webrtc \
|
|
-no-webengine-webrtc-pipewire \
|
|
-no-feature-webengine-developer-build \
|
|
-no-feature-webengine-full-debug-info \
|
|
-no-feature-webengine-native-spellchecker \
|
|
-no-feature-webengine-system-jpeg \
|
|
-no-feature-webengine-system-minizip \
|
|
-no-feature-webengine-system-gn
|
|
|
|
ifeq ($(BR2_PACKAGE_QT5WEBENGINE_PROPRIETARY_CODECS),y)
|
|
QT5WEBENGINE_CONF_OPTS += -webengine-proprietary-codecs
|
|
else
|
|
QT5WEBENGINE_CONF_OPTS += -no-webengine-proprietary-codecs
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_QT5WEBENGINE_ALSA),y)
|
|
QT5WEBENGINE_DEPENDENCIES += alsa-lib
|
|
QT5WEBENGINE_CONF_OPTS += -webengine-alsa
|
|
else
|
|
QT5WEBENGINE_CONF_OPTS += -no-webengine-alsa
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_PULSEAUDIO),y)
|
|
QT5WEBENGINE_DEPENDENCIES += pulseaudio
|
|
QT5WEBENGINE_CONF_OPTS += -webengine-pulseaudio
|
|
else
|
|
QT5WEBENGINE_CONF_OPTS += -no-webengine-pulseaudio
|
|
endif
|
|
|
|
QT5WEBENGINE_ENV = \
|
|
PATH=$(@D)/host-bin:$(BR_PATH) \
|
|
PKG_CONFIG_SYSROOT_DIR="/"
|
|
define QT5WEBENGINE_CREATE_HOST_PYTHON_WRAPPER
|
|
mkdir -p $(@D)/host-bin
|
|
sed s%@HOST_DIR@%$(HOST_DIR)%g $(QT5WEBENGINE_PKGDIR)/host-python-wrapper.in > $(@D)/host-bin/python
|
|
chmod +x $(@D)/host-bin/python
|
|
endef
|
|
QT5WEBENGINE_PRE_CONFIGURE_HOOKS += QT5WEBENGINE_CREATE_HOST_PYTHON_WRAPPER
|
|
|
|
QT5WEBENGINE_ENV += NINJAFLAGS="-j$(PARALLEL_JOBS)"
|
|
|
|
define QT5WEBENGINE_COPY_CHROMIUM
|
|
rm -rf $(@D)/src/3rdparty
|
|
cp -a $(QT5WEBENGINE_CHROMIUM_DIR) $(@D)/src/3rdparty
|
|
endef
|
|
QT5WEBENGINE_POST_PATCH_HOOKS += QT5WEBENGINE_COPY_CHROMIUM
|
|
|
|
define QT5WEBENGINE_CREATE_HOST_PKG_CONFIG
|
|
mkdir -p $(@D)/host-bin
|
|
sed s%@HOST_DIR@%$(HOST_DIR)%g $(QT5WEBENGINE_PKGDIR)/host-pkg-config.in > $(@D)/host-bin/host-pkg-config
|
|
chmod +x $(@D)/host-bin/host-pkg-config
|
|
endef
|
|
QT5WEBENGINE_PRE_CONFIGURE_HOOKS += QT5WEBENGINE_CREATE_HOST_PKG_CONFIG
|
|
QT5WEBENGINE_ENV += \
|
|
GN_PKG_CONFIG_HOST=$(@D)/host-bin/host-pkg-config \
|
|
GN_HOST_TOOLCHAIN_EXTRA_CPPFLAGS="$(HOST_CPPFLAGS)"
|
|
|
|
QT5WEBENGINE_CONF_ENV = $(QT5WEBENGINE_ENV)
|
|
QT5WEBENGINE_MAKE_ENV = $(QT5WEBENGINE_ENV)
|
|
|
|
$(eval $(qmake-package))
|