machinekoder / QRemoteControl-Client

QRemoteControl is a remote control application for your mobile phone.
17 stars 5 forks source link

Update QRemoteControl-Server #4

Open Kabouik opened 5 years ago

Kabouik commented 5 years ago

Hi,

QRemoteControl hasn't seen any update in 5 years (3 for the Sailfish client), and yet I believe it is still, by far, the best Wifi remote control software out there. The touchpad is better than that of KDEConnect because it allows maintaining mouse buttons down, the full size keyboard is extremely useful when in need of certain key combinations or shortcuts, and the remote itself features most useful functions while alternative applications will most likely only offer play/pause/next/previous.

Unfortunately, while the client still installs properly on the target devices (at least for Sailfish), the server seems to require old libraries that are not easy to find in all Linux distributions. I remember that, one or two years ago, I could not compile it from sources on Solus because of a Qt issue (was it because QRemoteControl needs qt4, or something like that?). One of the Solus devs helped me editing the sources to use new libraries and it worked flawlessly, but I would now need to do the same on another computer and I don't remember what needs to be edited, nor do I have the edited sources anymore.

Are there any plans to update QRemoteControl-server sources so that they the server can be installed on modern distributions?

With the 2.4.1 version, the qmake step doesn't seem to be an issue, but make returns:

 ~/Downloads/Temporary/qremotecontrol-2.4.1 $ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DVERSION="\"2.4.1\"" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I. -Iqtsingleapplication -isystem /usr/include/QtWidgets -isystem /usr/include/QtGui -isystem /usr/include/QtNetwork -isystem /usr/include/QtConcurrent -isystem /usr/include/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o qtlocalpeer.o qtsingleapplication/qtlocalpeer.cpp
qtsingleapplication/qtlocalpeer.cpp: In member function ‘bool QtLocalPeer::sendMessage(const QString&, int)’:
qtsingleapplication/qtlocalpeer.cpp:161:19: error: variable ‘QDataStream ds’ has initializer but incomplete type
     QDataStream ds(&socket);
                   ^
qtsingleapplication/qtlocalpeer.cpp: In member function ‘void QtLocalPeer::receiveConnection()’:
qtsingleapplication/qtlocalpeer.cpp:181:26: error: variable ‘QDataStream ds’ has initializer but incomplete type
     QDataStream ds(socket);
                          ^
make: *** [Makefile:926: qtlocalpeer.o] Error 1

Adding the following lines in qtlocalpeer.cpp allows going further:

#include <QTextStream>
#include <QFile>
#include <QDataStream>

However, I still get another error at the make step:

~/Downloads/Temporary/qremotecontrol-2.4.1 $ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DVERSION="\"2.4.1\"" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I. -Iqtsingleapplication -isystem /usr/include/QtWidgets -isystem /usr/include/QtGui -isystem /usr/include/QtNetwork -isystem /usr/include/QtConcurrent -isystem /usr/include/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o qtlocalpeer.o qtsingleapplication/qtlocalpeer.cpp
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DVERSION="\"2.4.1\"" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I. -Iqtsingleapplication -isystem /usr/include/QtWidgets -isystem /usr/include/QtGui -isystem /usr/include/QtNetwork -isystem /usr/include/QtConcurrent -isystem /usr/include/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o qglobalfakekey_x11.o qglobalfakekey/qglobalfakekey_x11.cpp
qglobalfakekey/qglobalfakekey_x11.cpp:20:10: fatal error: QX11Info: No such file or directory
 #include <QX11Info>
          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:959: qglobalfakekey_x11.o] Error 1
Kabouik commented 5 years ago

For reference, here is what I had to do to successfully build Qremotecontrol-server on Solus 4.0 with qt5.

Prerequisites

Install required packages to build:

sudo eopkg it qt5-base-devel qt5-x11extras-devel libxtst-devel
sudo eopkg it -c system.devel

Solus uses eopkg, but of course adapt this to apt or any other package manager you might have on your distribution. Also, depending on distribution, the package names might change slightly, please find the equivalent names for yours.

Alter the files to include the proper qt5 libraries:

In QRemoteControl-Server.pro, replace:

QT += core \
      gui \

by:

QT += core \
      gui \
      x11extras \

In ui_qremotecontrolserver.h, make sure the following is included:

#include <QtWidgets/QWidget>

In .qtsingleapplication/qtlocalpeer.cpp, add:

#include "qdatastream.h" 

Installation

Run the normal installation instructions:

qmake
make
sudo make install

I'm not sure the .desktop file came with the installation or if I did it myself, since I had the files since years on my computer and just left them dormant for some months when I couldn't build (see message above). Just in case, here it is for reference:

[Desktop Entry]
Categories=Qt;Utility;
Comment[en_US]=QRemoteControl is a remote control application for your mobile phone. This is the server part of QRemoteControl.
Comment=QRemoteControl is a remote control application for your mobile phone. This is the server part of QRemoteControl.
Encoding=UTF-8
Exec=qremotecontrol-server
GenericName[en_US]=Remonte Control Application
GenericName=Remonte Control Application
Icon=qremotecontrol
MimeType=
Name[en_US]=QRemoteControl-Server
Name=QRemoteControl-Server
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
Version=1.0
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

Hopefully I did not forget step or file change. I cannot guarantee it because, again, I had all the files since a long time on my computer and can't remember if I had already altered them some years ago or not.