Commit ef3d7b35 authored by Marko Käning's avatar Marko Käning
Browse files

MacPorts: add Ian's patches for KCrash as variant kcrashpatches

parent 2569639b
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 121378 2014-06-24 16:23:44Z nicos@macports.org $
# $Id: Portfile 122038 2014-07-13 11:29:03Z nicos@macports.org $
PortSystem 1.0
PortGroup kde4 1.1
name kdelibs4
version 4.12.5
revision 3
revision 4
categories kde kde4
maintainers nicos
license LGPL-2+ GPL-2+ BSD
......@@ -53,16 +53,23 @@ depends_skip_archcheck aspell-dict-en
conflicts kdelibs3
patchfiles add-bundles-to-path.patch \
default-kde4-xdg-menu-prefix.patch \
workaround-kdeinit4-crash.patch \
patch-cmake-modules-FindKDE4-Internal.cmake.diff \
patch-cmake-modules-FindPhonon.cmake.diff \
patch-cmake-modules-FindQt4.cmake.diff \
patch-cmake-modules-KDE4Macros.cmake.diff \
patch-removeFindFlex.diff \
patch-kapplications-raster.diff \
patch-avoid-kwindowinfo-destructor.diff \
#workaround-kdeinit4-crash: Mac-specific patch developed by Macports to circumvent some crashes.
#avoid-kwindowinfo-destructor: Prevent sending null pointer to CFRelease (see ticket #44258)
#default-kde4-xdg-menu-prefix: solves a conflict with a file from gnome-menus (see ticket #18914)
#add-bundles-to-path: improve support for KIO slaves by adding a search path
#kapplications-raster: ensures that kde applications start in raster (faster) mode, but also provides a switch for non-working applications
#removeFindFlex: remove FindFlex.cmake which may hide the working one of cmake (ticket #44119)
#patch-cmake-modules-FindKDE4-Internal.cmake: Fixes zlib detection (see ticket #24128)
#patch-cmake-modules-KDE4Macros.cmake: Ensures that compiled objects are properly detected during build (see ticket #43720)
patchfiles workaround-kdeinit4-crash.patch \
avoid-kwindowinfo-destructor.patch \
default-kde4-xdg-menu-prefix.patch \
add-bundles-to-path.patch \
patch-kapplications-raster.diff \
patch-removeFindFlex.diff \
patch-cmake-modules-FindKDE4-Internal.cmake.diff \
patch-cmake-modules-KDE4Macros.cmake.diff
patch.pre_args -p1
......@@ -163,5 +170,14 @@ if { [variant_isset unifiedtoolbar] } {
patchfiles-append patch-unified-toolbar.diff
}
variant kcrashpatches description {Ian's patches to improve KCrash on OSX} {}
if { [variant_isset kcrashpatches] } {
patchfiles-append \
fixCrashInKCrash.patch \
fixInvokeBrowser.patch \
fixReportBug.patch
}
livecheck.url http://kde.mirrors.hoobly.com/stable/
livecheck.regex (\\d+(\\.\\d+)+)
--- kdelibs-4.12.5/kdeui/windowmanagement/kwindowinfo_mac.cpp.orig 2014-07-06 11:45:50.000000000 +0200
+++ kdelibs-4.12.5/kdeui/windowmanagement/kwindowinfo_mac.cpp 2014-07-06 11:51:19.000000000 +0200
@@ -51,7 +51,10 @@
KWindowInfo::Private::~Private()
{
- CFRelease(m_axWin);
+ // RJVB 20140706: the argument to CFRelease may not be a NULL pointer
+ if( m_axWin ){
+ CFRelease(m_axWin);
+ }
}
void KWindowInfo::Private::updateData()
diff --git a/kdeui/util/kcrash.cpp b/kdeui/util/kcrash.cpp
index 45eb46b..9bb9f44 100644
--- a/kdeui/util/kcrash.cpp
+++ b/kdeui/util/kcrash.cpp
@@ -313,6 +313,10 @@ KCrash::defaultCrashHandler (int sig)
crashRecursionCounter++;
}
+#ifndef Q_OS_MAC
+ // On Apple OS X, closing all FDs now will cause a second (SIGILL) crash,
+ // ending with "Unable to start Dr. Konqi". This is because the libdispatch
+ // library, which can manage multi-threading, has some FDs of its own.
#if !defined(Q_OS_WIN)
if (!(s_flags & KeepFDs))
closeAllFDs();
@@ -321,6 +325,7 @@ KCrash::defaultCrashHandler (int sig)
close(ConnectionNumber(QX11Info::display()));
# endif
#endif
+#endif
if (crashRecursionCounter < 3)
{
diff --git a/kdecore/CMakeLists.txt b/kdecore/CMakeLists.txt
index 6715d07..deaa233 100644
--- a/kdecore/CMakeLists.txt
+++ b/kdecore/CMakeLists.txt
@@ -413,6 +413,12 @@ endif (NOT Q_WS_X11 AND NOT Q_WS_QWS)
kde4_add_library(kdecore ${LIBRARY_TYPE} ${kdecore_LIB_SRCS})
target_link_libraries(kdecore ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTXML_LIBRARY} ${ZLIB_LIBRARY} ${kdecore_OPTIONAL_LIBS})
+if(APPLE)
+ # This is regrettable, but needed for kdecore/kernel/ktoolinvocation_xll.cpp
+ # to link into QDesktopServices::openUrl() and thus get access to the user's
+ # preferrred browser wherever it is required in KDE 4 apps or libraries.
+ target_link_libraries(kdecore ${QT_QTGUI_LIBRARY})
+endif()
if(WINCE)
target_link_libraries(kdecore ${WCECOMPAT_LIBRARIES} Ceshell.lib)
diff --git a/kdecore/kernel/ktoolinvocation_x11.cpp b/kdecore/kernel/ktoolinvocation_x11.cpp
index 5168f2f..884f753 100644
--- a/kdecore/kernel/ktoolinvocation_x11.cpp
+++ b/kdecore/kernel/ktoolinvocation_x11.cpp
@@ -49,6 +49,12 @@
#include <QtCore/QFile>
#include <QtDBus/QtDBus>
+#ifdef Q_OS_MAC
+#include <QDesktopServices>
+// TODO - If there are more cases than invokeBrowser() requiring Apple OS X
+// treatment, consider adding a ktoolinvocation_mac.cpp module.
+#endif
+
static QStringList splitEmailAddressList( const QString & aStr )
{
// This is a copy of KPIM::splitEmailAddrList().
@@ -303,6 +309,16 @@ void KToolInvocation::invokeBrowser( const QString &url, const QByteArray& start
// otherwise xdg-open, otherwise kde-open (which does a mimetype check first though).
// Outside KDE, call xdg-open if present, otherwise fallback to the above logic.
+#ifdef Q_OS_MAC
+ // On Apple OS X, KDE's regular invokeBrowser() does not work easily and
+ // especially not in the critical Help->Report Bug dialog. The openUrl()
+ // method in class QDesktopServices method automatically gets you the user's
+ // preferred browser, as configured in Apple OS X preferences. There is a
+ // port of xdg-utils on MacPorts, but it adds extra dependencies, including
+ // the X11 emulator, so xdg-open has not been tried here.
+ QDesktopServices::openUrl (QUrl(url));
+ return;
+#endif
QString exe; // the binary we are going to launch.
# This patch is DEPRECATED. Use fixInvokeBrowser.patch instead. That one will
# take care of all invokeBrowser() calls in KDE 4 apps and libraries, not just
# the one in KBugReport (used in the Help->Report Bug... menu item).
#
diff --git a/kdeui/dialogs/kbugreport.cpp b/kdeui/dialogs/kbugreport.cpp
index f9bc296..23b5863 100644
--- a/kdeui/dialogs/kbugreport.cpp
+++ b/kdeui/dialogs/kbugreport.cpp
@@ -27,9 +27,14 @@
#include <QtGui/QGroupBox>
#include <QtGui/QCloseEvent>
+#ifdef Q_OS_MAC
+#include <QDesktopServices>
+#else
+#include <ktoolinvocation.h>
+#endif
+
#include <kaboutdata.h>
#include <kcombobox.h>
-#include <ktoolinvocation.h>
#include <kdebug.h>
#include <klineedit.h>
#include <klocale.h>
@@ -413,7 +418,16 @@ void KBugReportPrivate::_k_slotSetFrom()
void KBugReport::accept()
{
if ( d->submitBugWeb ) {
+#ifdef Q_OS_MAC
+ // KToolInvocation::invokeBrowser() does not work easily on Apple OS X
+ // and QDesktopServices::openUrl() automatically gets you the user's
+ // preferred browser, as configured in Apple OS X preferences. Maybe
+ // QDesktopServices should be used on all desktops, being more portable
+ // Note: d->url.url() is of type QString, which is correct for both.
+ QDesktopServices::openUrl( d->url.url() );
+#else
KToolInvocation::invokeBrowser( d->url.url() );
+#endif
return;
}
--- kdelibs-4.5.4/cmake/modules/FindPhonon.cmake.orig 2010-11-23 15:53:43.000000000 -0500
+++ kdelibs-4.5.4/cmake/modules/FindPhonon.cmake 2010-11-23 15:54:39.000000000 -0500
@@ -21,9 +21,16 @@
set(PHONON_VERSION "${CMAKE_MATCH_1}")
endmacro(_phonon_find_version)
+MESSAGE(STATUS "Looking for Phonon")
+message(STATUS " -> KDE4_INCLUDE_INSTALL_DIR is ${KDE4_INCLUDE_INSTALL_DIR}")
+message(STATUS " -> KDE4_LIB_INSTALL_DIR is ${KDE4_LIB_INSTALL_DIR}")
+message(STATUS " -> INCLUDE_INSTALL_DIR is ${INCLUDE_INSTALL_DIR}")
+message(STATUS " -> QT_LIBRARY_DIR is ${QT_LIBRARY_DIR}")
+message(STATUS " -> QT_INCLUDE_DIR is ${QT_INCLUDE_DIR}")
+
# the dirs listed with HINTS are searched before the default sets of dirs
-find_library(PHONON_LIBRARY NAMES phonon HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})
-find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR})
+find_library(PHONON_LIBRARY NAMES phonon HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})
@@ -31,6 +38,11 @@
_phonon_find_version()
endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
+MESSAGE(STATUS "Results of Search for Phonon")
+MESSAGE(STATUS " -> PHONON_VERSION is ${PHONON_VERSION}")
+MESSAGE(STATUS " -> PHONON_INCLUDE_DIR is ${PHONON_INCLUDE_DIR}")
+MESSAGE(STATUS " -> PHONON_LIBRARY is ${PHONON_LIBRARY}")
+
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Phonon DEFAULT_MSG PHONON_INCLUDE_DIR PHONON_LIBRARY)
--- kdelibs-4.5.4/cmake/modules/FindQt4.cmake.orig 2010-11-23 15:17:37.000000000 -0500
+++ kdelibs-4.5.4/cmake/modules/FindQt4.cmake 2010-11-23 15:30:23.000000000 -0500
@@ -1178,7 +1178,14 @@
QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
SET( QT4_FOUND "YES" )
IF( NOT Qt4_FIND_QUIETLY)
- MESSAGE(STATUS "Found Qt-Version ${QTVERSION} (using ${QT_QMAKE_EXECUTABLE})")
+ MESSAGE(STATUS "Found Qt-Version ${QTVERSION}")
+ MESSAGE(STATUS " -> QT_QMAKE_EXECUTABLE is ${QT_QMAKE_EXECUTABLE}")
+ MESSAGE(STATUS " -> QT_INCLUDE_DIR is ${QT_INCLUDE_DIR}")
+ MESSAGE(STATUS " -> QT_QTCORE_INCLUDE_DIR is ${QT_QTCORE_INCLUDE_DIR}")
+ MESSAGE(STATUS " -> QT_BINARY_DIR is ${QT_BINARY_DIR}")
+ MESSAGE(STATUS " -> QT_LIBRARY_DIR is ${QT_LIBRARY_DIR}")
+ MESSAGE(STATUS " -> QT_PLUGINS_DIR is ${QT_PLUGINS_DIR}")
+ MESSAGE(STATUS " -> QT_MKSPECS_DIR is ${QT_MKSPECS_DIR}")
ENDIF( NOT Qt4_FIND_QUIETLY)
ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment