From f8cd9c3589534a57f265543f9c58e6ad40c1ff32 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 7 Dec 2015 00:04:02 +0100 Subject: [PATCH] qt5base: activate iconv support when libiconv-full is avaliable Signed-off-by: Hauke Mehrtens --- frameworks/qt5base/Makefile | 7 +-- .../qt5base/patches/010-iconv-cast.patch | 43 +++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 frameworks/qt5base/patches/010-iconv-cast.patch diff --git a/frameworks/qt5base/Makefile b/frameworks/qt5base/Makefile index 810ae54..f77cca2 100644 --- a/frameworks/qt5base/Makefile +++ b/frameworks/qt5base/Makefile @@ -38,7 +38,8 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_qt5base-gui \ CONFIG_PACKAGE_qt5base-plugin-imageformats-gif \ CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb \ - CONFIG_PACKAGE_qt5base-plugin-platforms-minimal + CONFIG_PACKAGE_qt5base-plugin-platforms-minimal \ + CONFIG_PACKAGE_libiconv-full define Package/qt5base/Default SECTION:=video-frameworks @@ -65,7 +66,7 @@ endef define Package/qt5base-core $(call Package/qt5base/Default) TITLE+=core - DEPENDS+=+libpthread +zlib +libpcre16 +libstdcpp +librt + DEPENDS+=+libpthread +zlib +libpcre16 +libstdcpp +librt +PACKAGE_libiconv-full:libiconv-full endef define Package/qt5base-gui @@ -304,7 +305,7 @@ define Build/Configure -widgets \ -no-optimized-qmake \ -no-cups \ - -no-iconv \ + $(if $(CONFIG_PACKAGE_libiconv-full),-iconv,-no-iconv) \ -evdev \ -no-icu \ -fontconfig \ diff --git a/frameworks/qt5base/patches/010-iconv-cast.patch b/frameworks/qt5base/patches/010-iconv-cast.patch new file mode 100644 index 0000000..c44daf1 --- /dev/null +++ b/frameworks/qt5base/patches/010-iconv-cast.patch @@ -0,0 +1,43 @@ +--- a/src/corelib/codecs/qiconvcodec.cpp ++++ b/src/corelib/codecs/qiconvcodec.cpp +@@ -137,7 +137,7 @@ QIconvCodec::IconvState::IconvState(icon + + QIconvCodec::IconvState::~IconvState() + { +- if (cd != reinterpret_cast(-1)) ++ if (cd != (iconv_t)-1) + iconv_close(cd); + if (buffer != array) + delete[] buffer; +@@ -200,7 +200,7 @@ QString QIconvCodec::convertToUnicode(co + if (!*pstate) { + // first time, create the state + iconv_t cd = createIconv_t(UTF16, 0); +- if (cd == reinterpret_cast(-1)) { ++ if (cd == (iconv_t)-1) { + static int reported = 0; + if (!reported++) { + fprintf(stderr, +@@ -345,19 +345,19 @@ QByteArray QIconvCodec::convertFromUnico + IconvState *&state = ts ? ts->localData() : temporaryState; + if (!state) { + iconv_t cd = createIconv_t(0, UTF16); +- if (cd != reinterpret_cast(-1)) { ++ if (cd != (iconv_t)-1) { + if (!setByteOrder(cd)) { + perror("QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv failed for BOM"); + + iconv_close(cd); +- cd = reinterpret_cast(-1); ++ cd = (iconv_t)-1; + + return QString(uc, len).toLatin1(); + } + } + state = new IconvState(cd); + } +- if (state->cd == reinterpret_cast(-1)) { ++ if (state->cd == (iconv_t)-1) { + static int reported = 0; + if (!reported++) { + fprintf(stderr, -- 2.30.2