0004-fix-icu-build-for-qt5webkit.patch 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. From: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
  2. Date: Mon, 23 Nov 2015 03:54:00 +0000
  3. Subject: [PATCH 1/1] When UChar is defined as char16_t in ICU, then qtbase fails to detect ICU.
  4. Build fails with following error:
  5. ICU auto-detection... ()
  6. x86_64-pc-linux-gnu-g++ -c -march=core2 -O2 -fno-ident \
  7. -frecord-gcc-switches -pipe -Wall -O2 -Wall -W -fPIC -I. \
  8. -I/var/tmp/portage/dev-qt/qtcore-5.5.1/work/qtbase-opensource-src-5.5.1/mkspecs/linux-g++ -o icu.o icu.cpp
  9. In file included from /usr/include/unicode/utypes.h:36:0,
  10. from icu.cpp:34:
  11. /usr/include/unicode/umachine.h:306:13: error: 'char16_t' does not name a type
  12. typedef char16_t UChar;
  13. ^
  14. In file included from /usr/include/unicode/utypes.h:37:0,
  15. from icu.cpp:34:
  16. /usr/include/unicode/uversion.h:165:55: error: 'UChar' does not name a type
  17. u_versionFromUString(UVersionInfo versionArray, const UChar *versionString);
  18. ^
  19. ...
  20. Makefile:177: recipe for target 'icu.o' failed
  21. gmake: *** [icu.o] Error 1
  22. ICU disabled.
  23. The ICU library support cannot be enabled.
  24. This change isn't needed for new Qt versions, because c++11 is mandatory since 5.7.
  25. Upstream desided not to merge this change into old branches, like 5.6.
  26. Original patch was slightly modified to apply cleanly on Qt 5.6.3.
  27. Fetch from: https://bugreports.qt.io/secure/attachment/52478/qtbase-5.5.1-icu.patch
  28. Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
  29. Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
  30. ---
  31. diff -purN qt5base-5.6.3.orig/config.tests/unix/compile.test qt5base-5.6.3/config.tests/unix/compile.test
  32. --- qt5base-5.6.3.orig/config.tests/unix/compile.test 2019-08-11 00:35:33.181545706 +0300
  33. +++ qt5base-5.6.3/config.tests/unix/compile.test 2017-09-06 15:13:54.000000000 +0300
  34. @@ -47,7 +47,7 @@ while [ "$#" -gt 0 ]; do
  35. INC=`echo $PARAM | sed -e 's/^-I//'`
  36. INCLUDEPATH="$INCLUDEPATH \"$INC\""
  37. ;;
  38. - -f*|-D*)
  39. + -f*|-D*|-std=*)
  40. CFLAGS="$CFLAGS \"$PARAM\""
  41. CXXFLAGS="$CXXFLAGS \"$PARAM\""
  42. ;;
  43. diff -purN qt5base-5.6.3.orig/configure qt5base-5.6.3/configure
  44. --- qt5base-5.6.3.orig/configure 2019-08-11 00:57:45.488214036 +0300
  45. +++ qt5base-5.6.3/configure 2017-09-06 15:13:54.000000000 +0300
  46. @@ -5183,8 +5183,10 @@ fi
  47. # auto-detect libicu support
  48. if [ "$CFG_ICU" != "no" ]; then
  49. - if compileTest unix/icu "ICU"; then
  50. + QT_CXXFLAGS_ICU=`icu-config --cxxflags 2>/dev/null`
  51. + if compileTest unix/icu "ICU" $QT_CXXFLAGS_ICU; then
  52. [ "$CFG_ICU" = "auto" ] && CFG_ICU=yes
  53. + QMakeVar set QT_CXXFLAGS_ICU "$QT_CXXFLAGS_ICU"
  54. else
  55. if [ "$CFG_ICU" = "auto" ]; then
  56. CFG_ICU=no
  57. diff -purN qt5base-5.6.3.orig/doc/Makefile qt5base-5.6.3/doc/Makefile
  58. diff -purN qt5base-5.6.3.orig/src/corelib/tools/tools.pri qt5base-5.6.3/src/corelib/tools/tools.pri
  59. --- qt5base-5.6.3.orig/src/corelib/tools/tools.pri 2019-08-11 00:45:45.073818635 +0300
  60. +++ qt5base-5.6.3/src/corelib/tools/tools.pri 2017-09-06 15:13:54.000000000 +0300
  61. @@ -169,6 +169,7 @@ contains(QT_CONFIG,icu) {
  62. tools/qcollator_icu.cpp \
  63. tools/qtimezoneprivate_icu.cpp
  64. DEFINES += QT_USE_ICU
  65. + QMAKE_CXXFLAGS += $$QT_CXXFLAGS_ICU
  66. } else: win32 {
  67. SOURCES += tools/qcollator_win.cpp
  68. } else: macx {