[arch-commits] Commit in kdenetwork-krdc/trunk (PKGBUILD freerdp12.patch)

Andrea Scarpino andrea at archlinux.org
Sun Jan 4 09:18:13 UTC 2015


    Date: Sunday, January 4, 2015 @ 10:18:11
  Author: andrea
Revision: 228411

upgpkg: kdenetwork-krdc 4.14.3-2

Freerdp 1.2 rebuild

Added:
  kdenetwork-krdc/trunk/freerdp12.patch
Modified:
  kdenetwork-krdc/trunk/PKGBUILD

-----------------+
 PKGBUILD        |   16 +-
 freerdp12.patch |  345 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 357 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-01-04 09:15:11 UTC (rev 228410)
+++ PKGBUILD	2015-01-04 09:18:11 UTC (rev 228411)
@@ -3,7 +3,7 @@
 
 pkgname=kdenetwork-krdc
 pkgver=4.14.3
-pkgrel=1
+pkgrel=2
 pkgdesc='Remote Desktop Client'
 url='http://kde.org/applications/internet/krdc/'
 arch=('i686' 'x86_64')
@@ -14,11 +14,19 @@
 optdepends=('libvncserver: VNC support'
             'freerdp: RDP support'
             'kdebase-keditbookmarks: to edit bookmarks')
-source=("http://download.kde.org/stable/${pkgver}/src/krdc-${pkgver}.tar.xz")
-sha1sums=('e18b48757ab35b51520fd2972e498fc24f6b62ad')
+source=("http://download.kde.org/stable/${pkgver}/src/krdc-${pkgver}.tar.xz"
+        'freerdp12.patch')
+sha1sums=('e18b48757ab35b51520fd2972e498fc24f6b62ad'
+          'fe7478f60d9b4d8fa71cec104669abb6802efc1a')
 
+prepare() {
+  mkdir build
+
+  cd krdc-${pkgver}
+  patch -p1 -i "${srcdir}"/freerdp12.patch
+}
+
 build() {
-  mkdir build
   cd build
   cmake ../krdc-${pkgver} \
     -DCMAKE_BUILD_TYPE=Release \

Added: freerdp12.patch
===================================================================
--- freerdp12.patch	                        (rev 0)
+++ freerdp12.patch	2015-01-04 09:18:11 UTC (rev 228411)
@@ -0,0 +1,345 @@
+From: Tony Murray <murraytony at gmail.com>
+Date: Fri, 02 Jan 2015 15:36:40 +0000
+Subject: Support for FreeRDP 1.0.2 and newer. Including 1.1 and 1.2.
+X-Git-Url: http://quickgit.kde.org/?p=krdc.git&a=commitdiff&h=a9e514b29b5611e01c2c024157d36eaf416e0c5a
+---
+Support for FreeRDP 1.0.2 and newer. Including 1.1 and 1.2.
+
+FEATURE:
+BUG: 341284
+FIXED-IN: 14.12.1
+REVIEW: 115059
+---
+
+
+--- a/rdp/rdpview.cpp
++++ b/rdp/rdpview.cpp
+@@ -146,102 +146,205 @@
+         }
+     }
+ 
++    // Check the version of FreeRDP so we can use pre-1.1 switches if needed
++    QProcess *xfreeRDPVersionCheck = new QProcess(this);
++    xfreeRDPVersionCheck->start("xfreerdp", QStringList("--version"));
++    xfreeRDPVersionCheck->waitForFinished();
++    QString versionOutput = xfreeRDPVersionCheck->readAllStandardOutput();
++    xfreeRDPVersionCheck->deleteLater();
++
+     m_process = new QProcess(m_container);
+ 
+     QStringList arguments;
+ 
+-    int width, height;
+-    if (m_hostPreferences->width() > 0) {
+-        width = m_hostPreferences->width();
+-        height = m_hostPreferences->height();
++    if (versionOutput.contains(QLatin1String(" 1.0"))) {
++        kDebug(5012) << "Use FreeRDP 1.0 compatible arguments";
++
++        int width, height;
++        if (m_hostPreferences->width() > 0) {
++            width = m_hostPreferences->width();
++            height = m_hostPreferences->height();
++        } else {
++            width = this->parentWidget()->size().width();
++            height = this->parentWidget()->size().height();
++        }
++        arguments << "-g" << QString::number(width) + 'x' + QString::number(height);
++
++        arguments << "-k" << keymapToXfreerdp(m_hostPreferences->keyboardLayout());
++
++        if (!m_url.userName().isEmpty()) {
++            // if username contains a domain, it needs to be set with another parameter
++            if (m_url.userName().contains('\\')) {
++                const QStringList splittedName = m_url.userName().split('\\');
++                arguments << "-d" << splittedName.at(0);
++                arguments << "-u" << splittedName.at(1);
++            } else {
++                arguments << "-u" << m_url.userName();
++            }
++        } else {
++            arguments << "-u" << "";
++        }
++
++        arguments << "-D";  // request the window has no decorations
++        arguments << "-X" << QString::number(m_container->winId());
++        arguments << "-a" << QString::number((m_hostPreferences->colorDepth() + 1) * 8);
++
++        switch (m_hostPreferences->sound()) {
++        case 1:
++            arguments << "-o";
++            break;
++        case 0:
++            arguments << "--plugin" << "rdpsnd";
++            break;
++        case 2:
++        default:
++            break;
++        }
++
++        if (!m_hostPreferences->shareMedia().isEmpty()) {
++            QStringList shareMedia;
++            shareMedia << "--plugin" << "rdpdr" << "--data" << "disk:media:" + m_hostPreferences->shareMedia() << "--";
++            arguments += shareMedia;
++        }
++
++        QString performance;
++        switch (m_hostPreferences->performance()) {
++        case 0:
++            performance = 'm';
++            break;
++        case 1:
++            performance = 'b';
++            break;
++        case 2:
++            performance = 'l';
++            break;
++        default:
++            break;
++        }
++
++        arguments << "-x" << performance;
++
++        if (m_hostPreferences->console()) {
++            arguments << "-0";
++        }
++
++        if (m_hostPreferences->remoteFX()) {
++            arguments << "--rfx";
++        }
++
++        if (!m_hostPreferences->extraOptions().isEmpty()) {
++            const QStringList additionalArguments = KShell::splitArgs(m_hostPreferences->extraOptions());
++            arguments += additionalArguments;
++        }
++
++        // krdc has no support for certificate management yet; it would not be possbile to connect to any host:
++        // "The host key for example.com has changed" ...
++        // "Add correct host key in ~/.freerdp/known_hosts to get rid of this message."
++        arguments << "--ignore-certificate";
++
++        // clipboard sharing is activated in KRDC; user can disable it at runtime
++        arguments << "--plugin" << "cliprdr";
++
++        arguments << "-t" << QString::number(m_port);
++        arguments << m_host;
++
++        kDebug(5012) << "Starting xfreerdp with arguments: " << arguments.join(" ");
++
++        arguments.removeLast(); // host must be last, remove and re-add it after the password
++        if (!m_url.password().isNull())
++            arguments << "-p" << m_url.password();
++        arguments << m_host;
++
+     } else {
+-        width = this->parentWidget()->size().width();
+-        height = this->parentWidget()->size().height();
+-    }
+-    arguments << "-g" << QString::number(width) + 'x' + QString::number(height);
+-
+-    arguments << "-k" << keymapToXfreerdp(m_hostPreferences->keyboardLayout());
+-
+-    if (!m_url.userName().isEmpty()) {
+-        // if username contains a domain, it needs to be set with another parameter
+-        if (m_url.userName().contains('\\')) {
+-            const QStringList splittedName = m_url.userName().split('\\');
+-            arguments << "-d" << splittedName.at(0);
+-            arguments << "-u" << splittedName.at(1);
++        kDebug(5012) << "Use FreeRDP 1.1+ compatible arguments";
++
++        int width, height;
++        if (m_hostPreferences->width() > 0) {
++            width = m_hostPreferences->width();
++            height = m_hostPreferences->height();
+         } else {
+-            arguments << "-u" << m_url.userName();
+-        }
+-    } else {
+-        arguments << "-u" << "";
+-    }
+-
+-    if (!m_url.password().isNull())
+-        arguments << "-p" << m_url.password();
+-
+-    arguments << "-D";  // request the window has no decorations
+-    arguments << "-X" << QString::number(m_container->winId());
+-    arguments << "-a" << QString::number((m_hostPreferences->colorDepth() + 1) * 8);
+-
+-    switch (m_hostPreferences->sound()) {
+-    case 1:
+-        arguments << "-o";
+-        break;
+-    case 0:
+-        arguments << "--plugin" << "rdpsnd";
+-        break;
+-    case 2:
+-    default:
+-        break;
+-    }
+-
+-    if (!m_hostPreferences->shareMedia().isEmpty()) {
+-        QStringList shareMedia;
+-        shareMedia << "--plugin" << "rdpdr" << "--data" << "disk:media:" + m_hostPreferences->shareMedia() << "--";
+-        arguments += shareMedia;
+-    }
+-
+-    QString performance;
+-    switch (m_hostPreferences->performance()) {
+-    case 0:
+-        performance = 'm';
+-        break;
+-    case 1:
+-        performance = 'b';
+-        break;
+-    case 2:
+-        performance = 'l';
+-        break;
+-    default:
+-        break;
+-    }
+-
+-    arguments << "-x" << performance;
+-
+-    if (m_hostPreferences->console()) {
+-        arguments << "-0";
+-    }
+-
+-    if (m_hostPreferences->remoteFX()) {
+-        arguments << "--rfx";
+-    }
+-
+-    if (!m_hostPreferences->extraOptions().isEmpty()) {
+-        const QStringList additionalArguments = KShell::splitArgs(m_hostPreferences->extraOptions());
+-        arguments += additionalArguments;
+-    }
+-
+-    // krdc has no support for certificate management yet; it would not be possbile to connect to any host:
+-    // "The host key for example.com has changed" ...
+-    // "Add correct host key in ~/.freerdp/known_hosts to get rid of this message."
+-    arguments << "--ignore-certificate";
+-
+-    // clipboard sharing is activated in KRDC; user can disable it at runtime
+-    arguments << "--plugin" << "cliprdr";
+-
+-    arguments << "-t" << QString::number(m_port);
+-    arguments << m_host;
+-
+-    kDebug(5012) << "Starting xfreerdp with arguments:" << arguments;
++            width = this->parentWidget()->size().width();
++            height = this->parentWidget()->size().height();
++        }
++        arguments << "-decorations";
++        arguments << "/w:" + QString::number(width);
++        arguments << "/h:" + QString::number(height);
++
++        arguments << "/kbd:" + keymapToXfreerdp(m_hostPreferences->keyboardLayout());
++
++        if (!m_url.userName().isEmpty()) {
++            // if username contains a domain, it needs to be set with another parameter
++            if (m_url.userName().contains('\\')) {
++                const QStringList splittedName = m_url.userName().split('\\');
++                arguments << "/d:" + splittedName.at(0);
++                arguments << "/u:" + splittedName.at(1);
++            } else {
++                arguments << "/u:" + m_url.userName();
++            }
++        } else {
++            arguments << "/u:";
++        }
++
++        arguments << "/parent-window:" + QString::number(m_container->winId());
++        arguments << "/bpp:" + QString::number((m_hostPreferences->colorDepth() + 1) * 8);
++        arguments << "/audio-mode:" + QString::number(m_hostPreferences->sound());
++
++        if (!m_hostPreferences->shareMedia().isEmpty()) {
++            QStringList shareMedia;
++            shareMedia << "/drive:media," + m_hostPreferences->shareMedia();
++            arguments += shareMedia;
++        }
++
++        QString performance;
++        switch (m_hostPreferences->performance()) {
++        case 0:
++            performance = "modem";
++            break;
++        case 1:
++            performance = "broadband";
++            break;
++        case 2:
++            performance = "lan";
++            break;
++        default:
++            break;
++        }
++
++        arguments << "/network:" + performance;
++
++        if (m_hostPreferences->console()) {
++            arguments << "/admin";
++        }
++
++        if (m_hostPreferences->remoteFX()) {
++            arguments << "/rfx";
++        }
++
++        if (!m_hostPreferences->extraOptions().isEmpty()) {
++            const QStringList additionalArguments = KShell::splitArgs(m_hostPreferences->extraOptions());
++            arguments += additionalArguments;
++        }
++
++        // krdc has no support for certificate management yet; it would not be possbile to connect to any host:
++        // "The host key for example.com has changed" ...
++        // "Add correct host key in ~/.freerdp/known_hosts to get rid of this message."
++        arguments << "/cert-ignore";
++
++        // clipboard sharing is activated in KRDC; user can disable it at runtime
++        arguments << "+clipboard";
++
++        arguments << "/port:" + QString::number(m_port);
++        arguments << "/v:" + m_host;
++
++        kDebug(5012) << "Starting xfreerdp with arguments: " << arguments.join(" ");
++
++        //avoid printing the password in debug
++        if (!m_url.password().isNull()) {
++            arguments << "/p:" + m_url.password();
++        }
++        kDebug(5012) << "Starting xfreerdp with arguments: " << arguments.join(" ");
++
++    }
+ 
+     setStatus(Connecting);
+ 
+@@ -302,7 +405,7 @@
+ 
+ void RdpView::processError(QProcess::ProcessError error)
+ {
+-    kDebug(5012) << "processError:" << error;
++    kDebug(5012) << error;
+     if (m_quitFlag) // do not try to show error messages while quitting (prevent crashes)
+         return;
+ 
+@@ -319,11 +422,11 @@
+ void RdpView::receivedStandardError()
+ {
+     const QString output(m_process->readAllStandardError());
+-    kDebug(5012) << "receivedStandardError:" << output;
++    kDebug(5012) << output;
+     QString line;
+     int i = 0;
+     while (!(line = output.section('\n', i, i)).isEmpty()) {
+-        
++
+         // the following error is issued by freerdp because of a bug in freerdp 1.0.1 and below;
+         // see: https://github.com/FreeRDP/FreeRDP/pull/576
+         //"X Error of failed request:  BadWindow (invalid Window parameter)
+@@ -345,7 +448,7 @@
+ void RdpView::receivedStandardOutput()
+ {
+     const QString output(m_process->readAllStandardOutput());
+-    kDebug(5012) << "receivedStandardOutput:" << output;
++    kDebug(5012) << output;
+     QString line;
+     int i = 0;
+     while (!(line = output.section('\n', i, i)).isEmpty()) {
+



More information about the arch-commits mailing list