aboutsummaryrefslogtreecommitdiffstats
path: root/x11
diff options
context:
space:
mode:
authortcberner <tcberner@FreeBSD.org>2018-01-07 19:57:50 +0800
committertcberner <tcberner@FreeBSD.org>2018-01-07 19:57:50 +0800
commit7d1943477906752b1d9a2ef692647c523cb6d7ce (patch)
tree822ca9566a975961a29cdb201b7115d818c9b323 /x11
parent146d457cf1fdeb44070a2fd0e622e56d1ac996c8 (diff)
downloadfreebsd-ports-gnome-7d1943477906752b1d9a2ef692647c523cb6d7ce.tar.gz
freebsd-ports-gnome-7d1943477906752b1d9a2ef692647c523cb6d7ce.tar.zst
freebsd-ports-gnome-7d1943477906752b1d9a2ef692647c523cb6d7ce.zip
x11/kdelibs4 fix build with clang6
PR: 224945
Diffstat (limited to 'x11')
-rw-r--r--x11/kdelibs4/Makefile2
-rw-r--r--x11/kdelibs4/files/patch-dnssd_servicemodel.cpp23
-rw-r--r--x11/kdelibs4/files/patch-kdeui_icons_kiconcache.cpp15
-rw-r--r--x11/kdelibs4/files/patch-khtml_misc_AtomicString.cpp40
-rw-r--r--x11/kdelibs4/files/patch-khtml_xml_dom__stringimpl.h31
-rw-r--r--x11/kdelibs4/files/patch-kinit_kinit.cpp15
6 files changed, 125 insertions, 1 deletions
diff --git a/x11/kdelibs4/Makefile b/x11/kdelibs4/Makefile
index c2f810b5454d..605a58131a3c 100644
--- a/x11/kdelibs4/Makefile
+++ b/x11/kdelibs4/Makefile
@@ -3,7 +3,7 @@
PORTNAME= kdelibs
PORTVERSION= ${KDE4_KDELIBS_VERSION}
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= x11 kde kde-applications
MAINTAINER= kde@FreeBSD.org
diff --git a/x11/kdelibs4/files/patch-dnssd_servicemodel.cpp b/x11/kdelibs4/files/patch-dnssd_servicemodel.cpp
new file mode 100644
index 000000000000..f169966bc5b2
--- /dev/null
+++ b/x11/kdelibs4/files/patch-dnssd_servicemodel.cpp
@@ -0,0 +1,23 @@
+Backport of
+
+rom 80b43aaae27cfdf543483cd55d9012e37219350a Mon Sep 17 00:00:00 2001
+From: Alex Richardson <arichardson.kde@gmail.com>
+Date: Wed, 29 Jan 2014 21:56:27 +0100
+Subject: [PATCH] Fix build with clang
+
+If we don't cast to unsigned int clang complains with following message:
+
+error: case value evaluates to 2690980318, which cannot be narrowed to
+type 'int'
+
+--- dnssd/servicemodel.cpp.orig 2018-01-07 11:07:50 UTC
++++ dnssd/servicemodel.cpp
+@@ -80,7 +80,7 @@ QVariant ServiceModel::data(const QModelIndex& index,
+ if (!index.isValid()) return QVariant();
+ if (!hasIndex(index.row(), index.column(), index.parent())) return QVariant();
+ const QList<RemoteService::Ptr> srv=d->m_browser->services();
+- switch (role) {
++ switch ((uint)role) {
+ case Qt::DisplayRole:
+ switch (index.column()) {
+ case ServiceName: return srv[index.row()]->serviceName();
diff --git a/x11/kdelibs4/files/patch-kdeui_icons_kiconcache.cpp b/x11/kdelibs4/files/patch-kdeui_icons_kiconcache.cpp
new file mode 100644
index 000000000000..f40cb0cfa196
--- /dev/null
+++ b/x11/kdelibs4/files/patch-kdeui_icons_kiconcache.cpp
@@ -0,0 +1,15 @@
+error: invalid suffix on literal; C++11 requires a space between literal and identifier
+[-Wreserved-user-defined-literal]
+ d->mUpdatesFile = KGlobal::dirs()->locateLocal("cache", "kpc/"KDE_ICONCACHE_NAME".updated");
+ ^
+--- kdeui/icons/kiconcache.cpp.orig 2018-01-07 10:31:47 UTC
++++ kdeui/icons/kiconcache.cpp
+@@ -103,7 +103,7 @@ class KIconCache::Private (public)
+ KIconCache::KIconCache()
+ : KPixmapCache(KDE_ICONCACHE_NAME), d(new Private(this))
+ {
+- d->mUpdatesFile = KGlobal::dirs()->locateLocal("cache", "kpc/"KDE_ICONCACHE_NAME".updated");
++ d->mUpdatesFile = KGlobal::dirs()->locateLocal("cache", "kpc/" KDE_ICONCACHE_NAME ".updated");
+ // Set limit to 10 MB
+ setCacheLimit(10 * 1024);
+ }
diff --git a/x11/kdelibs4/files/patch-khtml_misc_AtomicString.cpp b/x11/kdelibs4/files/patch-khtml_misc_AtomicString.cpp
new file mode 100644
index 000000000000..8617efeb135d
--- /dev/null
+++ b/x11/kdelibs4/files/patch-khtml_misc_AtomicString.cpp
@@ -0,0 +1,40 @@
+Backport of:
+
+From 7ed8ac1ae23a31d2eb227ffa15d68b2beaf8f37d Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Wed, 26 Feb 2014 22:37:29 +0100
+Subject: [PATCH] Fix compiler error when using clang:
+
+src/misc/AtomicString.cpp:175:28: error: non-constant-expression
+ cannot be narrowed from type 'int' to 'unsigned int' in initializer
+ list [-Wc++11-narrowing]
+ UCharBuffer buf = { s, length };
+ ^~~~~~
+src/misc/AtomicString.cpp:175:28: note: override this message by
+ inserting an explicit cast
+ UCharBuffer buf = { s, length };
+ ^~~~~~
+ static_cast<unsigned int>( )
+
+REVIEW: 116541
+
+--- khtml/misc/AtomicString.cpp.orig 2018-01-07 11:32:56 UTC
++++ khtml/misc/AtomicString.cpp
+@@ -160,7 +160,7 @@ DOMStringImpl* AtomicString::add(const QChar* s, int l
+ return DOMStringImpl::empty();
+
+ init();
+- UCharBuffer buf = { s, length };
++ UCharBuffer buf = { s, static_cast<uint>(length) };
+ std::pair<HashSet<DOMStringImpl*>::iterator, bool> addResult = stringTable->add<UCharBuffer, UCharBufferTranslator>(buf);
+ if (!addResult.second)
+ return *addResult.first;
+@@ -180,7 +180,7 @@ DOMStringImpl* AtomicString::add(const QChar* s)
+ return DOMStringImpl::empty();
+
+ init();
+- UCharBuffer buf = {s, length};
++ UCharBuffer buf = {s, static_cast<uint>(length) };
+ std::pair<HashSet<DOMStringImpl*>::iterator, bool> addResult = stringTable->add<UCharBuffer, UCharBufferTranslator>(buf);
+ if (!addResult.second)
+ return *addResult.first;
diff --git a/x11/kdelibs4/files/patch-khtml_xml_dom__stringimpl.h b/x11/kdelibs4/files/patch-khtml_xml_dom__stringimpl.h
new file mode 100644
index 000000000000..b20a6a5a16a3
--- /dev/null
+++ b/x11/kdelibs4/files/patch-khtml_xml_dom__stringimpl.h
@@ -0,0 +1,31 @@
+Backport of
+
+From 6c4f7f84dd1326853475d10e503f220e4555e5e2 Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Sun, 2 Mar 2014 21:48:20 +0100
+Subject: [PATCH] Fix clang compilation warning:
+
+khtml/src/xml/dom_stringimpl.h:60:13: warning: cast from 'char *'
+to 'QChar *' increases required alignment from 1 to 2 [-Wcast-align
+ s = (QChar*) new cha sizeof(QChar)*( havestr ? len : 1 ) ;
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Note that this line of code is pretty odd I have to say. It this
+supposed to be an optimization to prevent the default ctor/dtor of
+QChar to be called? Is it really worth it here?
+
+REVIEW: 116544
+
+--- khtml/xml/dom_stringimpl.h.orig 2018-01-07 11:19:19 UTC
++++ khtml/xml/dom_stringimpl.h
+@@ -32,8 +32,8 @@
+ #include "misc/khtmllayout.h"
+ #include "misc/shared.h"
+
+-#define QT_ALLOC_QCHAR_VEC( N ) (QChar*) new char[ sizeof(QChar)*( N ) ]
+-#define QT_DELETE_QCHAR_VEC( P ) delete[] ((char*)( P ))
++#define QT_ALLOC_QCHAR_VEC( N ) reinterpret_cast<QChar*>(new char[ sizeof(QChar)*( N ) ])
++#define QT_DELETE_QCHAR_VEC( P ) delete[] (reinterpret_cast<char*>( P ))
+
+ namespace DOM {
+
diff --git a/x11/kdelibs4/files/patch-kinit_kinit.cpp b/x11/kdelibs4/files/patch-kinit_kinit.cpp
new file mode 100644
index 000000000000..727b6e65bbff
--- /dev/null
+++ b/x11/kdelibs4/files/patch-kinit_kinit.cpp
@@ -0,0 +1,15 @@
+error: invalid suffix on literal; C++11 requires a space between literal and identifier
+[-Wreserved-user-defined-literal]
+ fprintf(stderr, "kdeinit4: Aborting. $"DISPLAY" is not set.\n");
+
+--- kinit/kinit.cpp.orig 2018-01-07 10:44:53 UTC
++++ kinit/kinit.cpp
+@@ -1478,7 +1478,7 @@ static void kdeinit_library_path()
+ if (display.isEmpty())
+ {
+ #if defined(Q_WS_X11) || defined(Q_WS_QWS)
+- fprintf(stderr, "kdeinit4: Aborting. $"DISPLAY" is not set.\n");
++ fprintf(stderr, "kdeinit4: Aborting. $" DISPLAY " is not set.\n");
+ exit(255);
+ #endif
+ }