summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDror Levin <spatz@gentoo.org>2010-06-27 20:08:25 +0000
committerDror Levin <spatz@gentoo.org>2010-06-27 20:08:25 +0000
commitb812af80b8b0130478f39c162093b5b34c802803 (patch)
treec23225a8bb52fb5421a40d3406d7cf2d9e027a82 /dev-libs/libdbusmenu-qt/files
parentx86 stable, bug 322791 (diff)
downloadgentoo-2-b812af80b8b0130478f39c162093b5b34c802803.tar.gz
gentoo-2-b812af80b8b0130478f39c162093b5b34c802803.tar.bz2
gentoo-2-b812af80b8b0130478f39c162093b5b34c802803.zip
Add patch to fix building with Qt 4.7.0-beta1, bug 324843. Thanks to Alec Moskvin for patch from upstream.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'dev-libs/libdbusmenu-qt/files')
-rw-r--r--dev-libs/libdbusmenu-qt/files/libdbusmenu-qt-0.3.5-qt-4.7.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/dev-libs/libdbusmenu-qt/files/libdbusmenu-qt-0.3.5-qt-4.7.patch b/dev-libs/libdbusmenu-qt/files/libdbusmenu-qt-0.3.5-qt-4.7.patch
new file mode 100644
index 000000000000..6e29787fed34
--- /dev/null
+++ b/dev-libs/libdbusmenu-qt/files/libdbusmenu-qt-0.3.5-qt-4.7.patch
@@ -0,0 +1,81 @@
+From f3c2fb90e1c2b94e561ccf33e4c2049f96ce45e2 Mon Sep 17 00:00:00 2001
+From: Aurelien Gateau <aurelien.gateau@canonical.com>
+Date: Thu, 24 Jun 2010 10:04:35 +0200
+Subject: [PATCH] Better build check for QIcon::name()
+
+---
+ src/CMakeLists.txt | 21 +++++++++++++++++++++
+ src/dbusmenu_config.h.in | 2 ++
+ src/dbusmenuexporter.cpp | 3 ++-
+ 3 files changed, 25 insertions(+), 1 deletions(-)
+ create mode 100644 src/dbusmenu_config.h.in
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 2f4f5fd..ef555a3 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -1,4 +1,7 @@
++include(CheckCXXSourceCompiles)
+ include (CheckCXXCompilerFlag)
++
++# Check some compiler flags
+ check_cxx_compiler_flag(-fvisibility=hidden __DBUSMENU_HAVE_GCC_VISIBILITY)
+ if (__DBUSMENU_HAVE_GCC_VISIBILITY AND NOT WIN32)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+@@ -18,6 +21,24 @@ if (MSVC)
+ add_definitions(-D__PRETTY_FUNCTION__=__FUNCTION__)
+ endif (MSVC)
+
++# Check whether QIcon::name() exists. It was added in late Qt 4.7 cycle, and is
++# not present in betas.
++set(CMAKE_REQUIRED_INCLUDES "${QT_INCLUDE_DIR}")
++set(CMAKE_REQUIRED_LIBRARIES "QtGui")
++check_cxx_source_compiles("
++#include <QtGui/QIcon>
++int main() {
++ QIcon icon;
++ icon.name();
++ return 0;
++}
++" HAVE_QICON_NAME)
++if (NOT HAVE_QICON_NAME)
++ message(STATUS "QIcon::name() does not exist, DBusMenuExporter will not export icon names by itself")
++endif()
++configure_file(dbusmenu_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/dbusmenu_config.h @ONLY)
++
++
+ set(dbusmenu_qt_SRCS
+ dbusmenu_p.cpp
+ dbusmenuexporter.cpp
+diff --git a/src/dbusmenu_config.h.in b/src/dbusmenu_config.h.in
+new file mode 100644
+index 0000000..c884fb7
+--- /dev/null
++++ b/src/dbusmenu_config.h.in
+@@ -0,0 +1,2 @@
++/* Whether QIcon::name() exists */
++#cmakedefine HAVE_QICON_NAME
+diff --git a/src/dbusmenuexporter.cpp b/src/dbusmenuexporter.cpp
+index af37eaa..e77681c 100644
+--- a/src/dbusmenuexporter.cpp
++++ b/src/dbusmenuexporter.cpp
+@@ -30,6 +30,7 @@
+ #include <QXmlStreamWriter>
+
+ // Local
++#include "dbusmenu_config.h"
+ #include "dbusmenu_p.h"
+ #include "dbusmenuexporterdbus_p.h"
+ #include "dbusmenuexporterprivate_p.h"
+@@ -277,7 +278,7 @@ void DBusMenuExporter::doEmitLayoutUpdated()
+ QString DBusMenuExporter::iconNameForAction(QAction *action)
+ {
+ DMRETURN_VALUE_IF_FAIL(action, QString());
+-#if QT_VERSION >= 0x040700
++#ifdef HAVE_QICON_NAME
+ QIcon icon = action->icon();
+ return icon.isNull() ? QString() : icon.name();
+ #else
+--
+1.6.1
+