Subject: openSUSE Tumbleweed RPM builds against obsolete (and nowadays missing) libssh
From: Tristan Miller <[email-masked]>
To: [email-masked]
Date: Sun, 28 Oct 2018 21:15:15 +0100

Package: x2goclient
Version: 4.1.2.2
Tag: patch

The openSUSE Tumbleweed RPM for x2goclient at
<https://wiki.x2go.org/doku.php/wiki:repositories:suse> cannot be built
or installed on recent versions of Tumbleweed because it depends on an
obsolete version of libssh that is no longer distributed with
Tumbleweed.

However, updating the dependency to a modern libssh requires changing
not only the RPM spec file but also the x2goclient source code. This is
because recent versions of libssh install both the standard and
threaded libraries in the same library, whereas the existing source
code attempts to link them as two unique libraries.

Attached is a patch to the spec file that fixes the libssh dependency
for Tumbleweed, and applies a patch (also attached) to the x2goclient
source code that stops it from trying to link to the nowadays missing
ssh_threads library.  (Maybe the latter patch should be merged into the
official x2goclient source, though of course this depends on what
version(s) of libssh the x2goclient developers intend to support.)

Attachment: x2goclient.spec.patch
Attachment: x2goclient-libssh.patch
--- /usr/src/packages/SPECS/x2goclient.spec	2018-09-05 15:02:44.000000000 +0200
+++ x2goclient.spec	2018-10-28 20:30:41.606190285 +0100
@@ -14,6 +14,7 @@
 URL:            https://www.x2go.org
 Source0:        https://code.x2go.org/releases/source/%{name}/%{name}-%{version}.tar.gz
 Source1:        x2goclient-rpmlintrc
+Patch0:         x2goclient-libssh.patch
 
 BuildRequires:  cups-devel
 BuildRequires:  desktop-file-utils
@@ -45,10 +46,15 @@
 
 %if "%{?_vendor}" == "suse"
 BuildRequires:  fdupes update-desktop-files
+%if 0%{?suse_version} >= 1500
+BuildRequires:  libssh-devel >= 0.8.0
+BuildRequires:  pkgconfig(x11) pkgconfig(xpm) pkgconfig(xproto)
+%else
 %if 0%{?suse_version} >= 1130
 BuildRequires:  pkgconfig(libssh) >= 0.6.3
 BuildRequires:  pkgconfig(x11) pkgconfig(xpm) pkgconfig(xproto)
 %endif
+%endif
 %if 0%{?suse_version} && 0%{?suse_version} < 1130
 BuildRequires:  libssh-devel >= 0.6.3
 BuildRequires:  xorg-x11-libXpm-devel xorg-x11-proto-devel
@@ -110,7 +116,9 @@
 sed -i -e '/^QMAKE_BINARY=/s@qmake-qt4@%{_bindir}/qmake@' Makefile
 sed -i -e '/^LRELEASE_BINARY=/s@lrelease-qt4@%{_bindir}/lrelease@' Makefile
 %endif
-
+%if 0%{?suse_version} > 1500
+%patch0 -p1
+%endif
 
 %build
 export PATH=%{_qt4_bindir}:$PATH
--- x2goclient-4.1.2.2/x2goclient.pro	2018-09-05 15:02:43.000000000 +0200
+++ x2goclient-4.1.2.2.new/x2goclient.pro	2018-10-28 20:08:50.893643887 +0100
@@ -132,7 +132,7 @@
            src/compat.cpp \
            src/pulsemanager.cpp
 
-LIBS += -lssh -lssh_threads
+LIBS += -lssh
 win32:LIBS += -lAdvAPI32 -lshell32 -lUser32
 
 RC_FILE = res/x2goclient.rc