qt5base: activate iconv support when libiconv-full is avaliable
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 6 Dec 2015 23:04:02 +0000 (00:04 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 6 Dec 2015 23:13:15 +0000 (00:13 +0100)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
frameworks/qt5base/Makefile
frameworks/qt5base/patches/010-iconv-cast.patch [new file with mode: 0644]

index 810ae54800a9410cf87ed08ae060d0c0150dc8fa..f77cca2c059a0cb80654bdd715abc32665a5a0cf 100644 (file)
@@ -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 (file)
index 0000000..c44daf1
--- /dev/null
@@ -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<iconv_t>(-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<iconv_t>(-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<iconv_t>(-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<iconv_t>(-1);
++                cd = (iconv_t)-1;
+                 return QString(uc, len).toLatin1();
+             }
+         }
+         state = new IconvState(cd);
+     }
+-    if (state->cd == reinterpret_cast<iconv_t>(-1)) {
++    if (state->cd == (iconv_t)-1) {
+         static int reported = 0;
+         if (!reported++) {
+             fprintf(stderr,