[59488] trunk/dports/kde/kdelibs4

sharky at macports.org sharky at macports.org
Thu Oct 15 10:51:07 PDT 2009


Revision: 59488
          http://trac.macports.org/changeset/59488
Author:   sharky at macports.org
Date:     2009-10-15 10:51:05 -0700 (Thu, 15 Oct 2009)
Log Message:
-----------
kdelibs4 : improve support for KIO slaves

Modified Paths:
--------------
    trunk/dports/kde/kdelibs4/Portfile
    trunk/dports/kde/kdelibs4/files/workaround-kdeinit4-crash.patch

Added Paths:
-----------
    trunk/dports/kde/kdelibs4/files/add-bundles-to-path.patch

Modified: trunk/dports/kde/kdelibs4/Portfile
===================================================================
--- trunk/dports/kde/kdelibs4/Portfile	2009-10-15 17:16:42 UTC (rev 59487)
+++ trunk/dports/kde/kdelibs4/Portfile	2009-10-15 17:51:05 UTC (rev 59488)
@@ -6,7 +6,7 @@
 
 name                kdelibs4
 version             4.3.2
-revision            2
+revision            3
 categories          kde kde4
 maintainers         snc sharky
 description         KDE4 core libraries
@@ -37,7 +37,8 @@
                     port:aspell port:aspell-dict-en
                     #port:phonon \
 
-patchfiles          default-kde4-xdg-menu-prefix.patch \
+patchfiles          add-bundles-to-path.patch \
+                    default-kde4-xdg-menu-prefix.patch \
                     dont-use-fdatasync.patch \
                     dont-use-carbon-keyboard.patch \
                     fix-bundle-icons.patch \

Added: trunk/dports/kde/kdelibs4/files/add-bundles-to-path.patch
===================================================================
--- trunk/dports/kde/kdelibs4/files/add-bundles-to-path.patch	                        (rev 0)
+++ trunk/dports/kde/kdelibs4/files/add-bundles-to-path.patch	2009-10-15 17:51:05 UTC (rev 59488)
@@ -0,0 +1,27 @@
+Index: kdelibs-4.3.2/kdecore/CMakeLists.txt
+===================================================================
+--- kdelibs-4.3.2.orig/kdecore/CMakeLists.txt	2009-08-27 10:19:05.000000000 +0200
++++ kdelibs-4.3.2/kdecore/CMakeLists.txt	2009-10-15 14:17:22.000000000 +0200
+@@ -59,6 +59,7 @@
+ endif (HAVE_RESOLV_LIBRARY)
+ 
+ if (APPLE)
++   add_definitions(-DBUNDLE_INSTALL_DIR="\\"${BUNDLE_INSTALL_DIR}\\"")
+    set(kdecore_OPTIONAL_SRCS ${kdecore_OPTIONAL_SRCS}
+       kernel/kkernel_mac.cpp
+    )
+Index: kdelibs-4.3.2/kdecore/kernel/kstandarddirs.cpp
+===================================================================
+--- kdelibs-4.3.2.orig/kdecore/kernel/kstandarddirs.cpp	2009-05-06 12:14:38.000000000 +0200
++++ kdelibs-4.3.2/kdecore/kernel/kstandarddirs.cpp	2009-10-15 14:21:57.000000000 +0200
+@@ -1204,6 +1204,10 @@
+         exePaths << KShell::tildeExpand( tokens[ i ] );
+     }
+ 
++#ifdef Q_WS_MAC
++    exePaths << QString::fromLatin1(BUNDLE_INSTALL_DIR);
++#endif
++
+     return exePaths;
+ }
+ 

Modified: trunk/dports/kde/kdelibs4/files/workaround-kdeinit4-crash.patch
===================================================================
--- trunk/dports/kde/kdelibs4/files/workaround-kdeinit4-crash.patch	2009-10-15 17:16:42 UTC (rev 59487)
+++ trunk/dports/kde/kdelibs4/files/workaround-kdeinit4-crash.patch	2009-10-15 17:51:05 UTC (rev 59488)
@@ -1,22 +1,23 @@
 Index: kdelibs-4.3.2/kinit/kinit.cpp
 ===================================================================
---- kdelibs-4.3.2.orig/kinit/kinit.cpp	2009-10-13 07:31:16.000000000 +0200
-+++ kdelibs-4.3.2/kinit/kinit.cpp	2009-10-13 07:31:52.000000000 +0200
-@@ -489,6 +489,13 @@
+--- kdelibs-4.3.2.orig/kinit/kinit.cpp	2009-10-14 18:47:04.000000000 +0200
++++ kdelibs-4.3.2/kinit/kinit.cpp	2009-10-14 19:10:14.000000000 +0200
+@@ -489,6 +489,14 @@
        init_startup_info( startup_id, name, envc, envs );
  #endif
  
 +  // Don't run this inside the child process, it crashes on OS/X 10.6
 +  const QByteArray docPath = QFile::encodeName(KGlobalSettings::documentPath());
++  const QString helperpath = s_instance->dirs()->findExe(QString::fromLatin1("kdeinit4_helper"));
 +#ifdef Q_WS_MAC
-+  QString bundlepath = s_instance->dirs()->findExe(QFile::decodeName(execpath));
-+  QString argvexe = s_instance->dirs()->findExe(QString::fromLatin1(_name));
++  const QString bundlepath = s_instance->dirs()->findExe(QFile::decodeName(execpath));
++  const QString argvexe = s_instance->dirs()->findExe(QString::fromLatin1(_name));
 +#endif
 +
    d.errorMsg = 0;
    d.fork = fork();
    switch(d.fork) {
-@@ -513,7 +520,6 @@
+@@ -513,7 +521,6 @@
       if (cwd && *cwd) {
           (void)chdir(cwd);
       } else {
@@ -24,15 +25,19 @@
           (void)chdir(docPath.constData());
       }
  
-@@ -552,7 +558,6 @@
-        d.argv = (char **) malloc(sizeof(char *) * (argc+1));
+@@ -549,10 +556,9 @@
+      {
+        int r;
+        QByteArray procTitle;
+-       d.argv = (char **) malloc(sizeof(char *) * (argc+1));
++       d.argv = (char **) malloc(sizeof(char *) * (argc+2));
         d.argv[0] = (char *) _name;
  #ifdef Q_WS_MAC
 -       QString argvexe = s_instance->dirs()->findExe(QString::fromLatin1(d.argv[0]));
         if (!argvexe.isEmpty()) {
            QByteArray cstr = argvexe.toLocal8Bit();
            kDebug(7016) << "kdeinit4: launch() setting argv: " << cstr.data();
-@@ -628,7 +633,6 @@
+@@ -628,7 +634,6 @@
  
          QByteArray executable = execpath;
  #ifdef Q_WS_MAC
@@ -40,3 +45,122 @@
          if (!bundlepath.isEmpty())
             executable = QFile::encodeName(bundlepath);
  #endif
+@@ -642,25 +647,13 @@
+         exit(255);
+      }
+ 
+-     void * sym = l.resolve( "kdeinitmain");
+-     if (!sym )
+-        {
+-        sym = l.resolve( "kdemain" );
+-        if ( !sym )
+-           {
+-            QString ltdlError = l.errorString();
+-            fprintf(stderr, "Could not find kdemain: %s\n", qPrintable(ltdlError) );
+-              QString errorMsg = i18n("Could not find 'kdemain' in '%1'.\n%2",
+-                                      libpath, ltdlError);
+-              exitWithErrorMsg(errorMsg);
+-           }
+-        }
+-
+-     d.result = 0; // Success
++     d.result = 2; // Try execing
+      write(d.fd[1], &d.result, 1);
+-     close(d.fd[1]);
+ 
+-     d.func = (int (*)(int, char *[])) sym;
++     // We set the close on exec flag.
++     // Closing of d.fd[1] indicates that the execvp succeeded!
++     fcntl(d.fd[1], F_SETFD, FD_CLOEXEC);
++
+      if (d.debug_wait)
+      {
+         fprintf(stderr, "kdeinit4: Suspending process\n"
+@@ -674,8 +667,18 @@
+         setup_tty( tty );
+      }
+ 
+-     exit( d.func(argc, d.argv)); /* Launch! */
++     QByteArray helperexe = QFile::encodeName(helperpath);
++     QByteArray libpathbytes = QFile::encodeName(libpath);
++     d.argv[argc] = libpathbytes.data();
++     d.argv[argc+1] = 0;
++
++     if (!helperexe.isEmpty())
++        execvp(helperexe, d.argv);
+ 
++     d.result = 1; // Error
++     write(d.fd[1], &d.result, 1);
++     close(d.fd[1]);
++     exit(255);
+      break;
+   }
+   default:
+Index: kdelibs-4.3.2/kinit/CMakeLists.txt
+===================================================================
+--- kdelibs-4.3.2.orig/kinit/CMakeLists.txt	2009-10-14 18:47:04.000000000 +0200
++++ kdelibs-4.3.2/kinit/CMakeLists.txt	2009-10-14 19:10:14.000000000 +0200
+@@ -53,6 +53,16 @@
+ 
+ install(TARGETS kdeinit4 ${INSTALL_TARGETS_DEFAULT_ARGS} )
+ 
++########### kdeinit4_helper ###############
++
++set(kdeinit4_helper_SRCS helper.cpp)
++
++kde4_add_executable(kdeinit4_helper NOGUI ${kdeinit4_helper_SRCS})
++
++target_link_libraries(kdeinit4_helper ${QT_QTCORE_LIBRARY})
++
++install(TARGETS kdeinit4_helper DESTINATION ${LIBEXEC_INSTALL_DIR} )
++
+ ########### kwrapper4 ###############
+ if (WIN32)
+   set(kwrapper_SRCS kwrapper_win.cpp  )
+Index: kdelibs-4.3.2/kinit/helper.cpp
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ kdelibs-4.3.2/kinit/helper.cpp	2009-10-14 19:11:06.000000000 +0200
+@@ -0,0 +1,42 @@
++#include <stdio.h>
++#include <stdlib.h>
++
++#include <QFile>
++#include <QLibrary>
++
++typedef int (*handler) (int, char *[]);
++
++int main(int argc, char *argv[])
++{
++    if (argc < 2)
++    {
++        fprintf(stderr, "Too few arguments\n");
++        exit(1);
++    }
++
++    QString libpath = QFile::decodeName(argv[argc-1]);
++    QLibrary l(libpath);
++
++    if (!libpath.isEmpty() && (!l.load() || !l.isLoaded()))
++    {
++        QString ltdlError = l.errorString();
++        fprintf(stderr, "Could not open library %s: %s\n", qPrintable(libpath), qPrintable(ltdlError) );
++        exit(1);
++    }
++
++    void * sym = l.resolve( "kdeinitmain");
++    if (!sym)
++    {
++        sym = l.resolve( "kdemain" );
++        if ( !sym )
++        {
++            QString ltdlError = l.errorString();
++            fprintf(stderr, "Could not find kdemain: %s\n", qPrintable(ltdlError) );
++            exit(1);
++        }
++    }
++
++    handler func = (int (*)(int, char *[])) sym;
++    exit( func(argc - 1, argv)); /* Launch! */
++}
++
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091015/4672f9fb/attachment-0001.html>


More information about the macports-changes mailing list