Solved Linux: build QtWebKit against a specific version of ICU?
-
Hi,
I build my project using
Qt 5.9.5 LTS
. I needQtWebKit
, so I build it myself using the latest commit from https://github.com/qt/qtwebkit.It all works fine on Windows and macOS, but I am having problems on Linux. Basically, I am using Ubuntu
16.04 LTS
to buildQtWebKit
. That version of Ubuntu comes with version55.1
of theICU
library while I need to use version56.1
(i.e. the same version as the one shipped with Qt).So, I decided to build
ICU
myself and modifiedSource/cmake/OptionsQt.cmake
so thatICU_INCLUDE_DIRS
,ICU_I18N_LIBRARIES
andICU_LIBRARIES
point to my copy ofICU
, i.e. version56.1
. Sure enough,QtWebKit
gets built against version56.1
ofICU
. However, it also gets linked against version55.1
:$ ldd libQt5WebKit.so | grep libicu libicuuc.so.56 => /home/alan/OpenCOR/distrib/linux/icu/ext/lib/libicuuc.so.56 (0x00007f8b24615000) libicui18n.so.56 => /home/alan/OpenCOR/distrib/linux/icu/ext/lib/libicui18n.so.56 (0x00007f8b23f16000) libicudata.so.56 => /home/alan/OpenCOR/distrib/linux/icu/ext/lib/libicudata.so.56 (0x00007f8b1e2fd000) libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f8b1df69000) libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f8b19711000)
So, what can be done to prevent QtWebKit from linking against version
55.1
ofICU
(or whatever version is available on one's Ubuntu system) and just link against my copy ofICU
?FWIW, I checked the Linux binaries for
QtWebKit 5.212.0 Alpha 2
and anldd
on it shows that it is also built against (or needs, rather) both versions55.1
and56.1
ofICU
...?!So, any help on this would be much appreciated as I am clearly missing something. @Konstantin-Tokarev?
Cheers, Alan.
-
Ok, it's actually working. A colleague and I had a closer look at the "problem" and he suggested checking the dependencies of the other libraries needed by
QtWebKit
. As it happens,QtWebKit
depends on several system libraries, some of which depending on the system version ofICU
, i.e.55.1
on Ubuntu16.04 LTS
while60.2
on Ubuntu18.04 LTS
. Fair enough. Problem solved. Yeah! :) -
@agarny said in Linux: build QtWebKit against a specific version of ICU?:
So, I decided to build ICU myself and modified Source/cmake/OptionsQt.cmake so that ICU_INCLUDE_DIRS, ICU_I18N_LIBRARIES and ICU_LIBRARIES point to my copy of ICU, i.e. version 56.1
FWIW, you could just pass this variables to cmake command line without modifying sources, or even point PKG_CONFIG_PATH environment variable to pkgconfig directory of your ICU
-
@agarny said in Linux: build QtWebKit against a specific version of ICU?:
QtWebKit depends on several system libraries, some of which depending on the system version of ICU
Out of curiosity, which library depends on system ICU in your case?
-
@Konstantin-Tokarev said in Linux: build QtWebKit against a specific version of ICU?:
FWIW, you could just pass this variables to cmake command line without modifying sources, or even point PKG_CONFIG_PATH environment variable to pkgconfig directory of your ICU
Yes, I imagine and this is what I am planning on doing today (rely on
PKG_CONFIG_PATH
that is). I was just testing things and therefore just wanted to be 100% sure that the right information was used by the QtWebKit build.Out of curiosity, which library depends on system ICU in your case?
From what I can tell, both
libQt5Core.so.5
andlibQt5WebKitWidgets.so.5
depend on the following two system libraries, which themselves depend on the system version of ICU:/usr/lib/x86_64-linux-gnu/libxml2.so.2
; and/usr/lib/x86_64-linux-gnu/libxslt.so.1
.
-
@agarny said in Linux: build QtWebKit against a specific version of ICU?:
From what I can tell, both libQt5Core.so.5 and libQt5WebKitWidgets.so.5 depend on the following two system libraries, which themselves depend on the system version of ICU
Oh. QtWebKit binaries are provided for use with official Qt builds, not system libraries
-
@Konstantin-Tokarev said in Linux: build QtWebKit against a specific version of ICU?:
@agarny said in Linux: build QtWebKit against a specific version of ICU?:
From what I can tell, both libQt5Core.so.5 and libQt5WebKitWidgets.so.5 depend on the following two system libraries, which themselves depend on the system version of ICU
Oh. QtWebKit binaries are provided for use with official Qt builds, not system libraries
First, I obviously meant
libQt5WebKit.so.5
and notlibQt5Core.so.5
.Second, sure, it's just that when you do an
ldd
on the QtWebKit binaries, you get told that both the system version ofICU
and the version you requested (56.1
in my case) are needed. So, I got a bit confused back then, although I now understand the reasoning for it.