Compiling the NextCloud 3.0.3 desktop client with Qt 5.12.8 from Ubuntu 20.04

I try to build the NextCloud desktop client on Ubuntu 20.04, following the instructions how-to-compile-the-desktop-client

git clone https://github.com/nextcloud/desktop.git
cd desktop
git submodule update --init
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/nextcloud-desktop-client -DCMAKE_BUILD_TYPE=Debug

The last command errors out with

CMake Error at src/gui/CMakeLists.txt:3 (find_package):
  By not providing "FindKF5Archive.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "KF5Archive", but CMake did not find one.
 Could not find a package configuration file provided by "KF5Archive" with any of the following names:
    KF5ArchiveConfig.cmake
    kf5archive-config.cmake

Could you please help me to continue?

There is a github repo KDE / karchive which contains such a file
Shall I clone this repo and point CMAKE_MODULE_PATH to it?

Thank you,
Markus

See here: Ubuntu – File list of package libkf5archive-dev/focal/amd64

In Ubuntu this means that you are missing the -dev package. I found it by searching the ubuntu package page.

Hi @christianlupus,
thank you, the command sudo apt install libkf5archive-dev, resolved the error By not providing "FindKF5Archive.cmake" in CMAKE_MODULE_PATH

I will open a PR and add libkf5archive-dev to the sudo apt install command in the Ubuntu 20.04 documentation

However, 2 new CMake error appeared, see below.
It guessed more packages are missing and I selected some from the ubuntu package page, but I had no luck with:

  • sudo apt install qt5qevercloud-dev
  • sudo apt install sphinxsearch

Do you happen to know which packages are missing?

Best regards,
Markus

cmake .. -DCMAKE_INSTALL_PREFIX=~/nextcloud-desktop-client -DCMAKE_BUILD_TYPE=Debug
-- Build of crashreporter disabled.
-- GIT_SHA1 b6bfb243e67a12ff3ccf46db76a3ed7f7e4dbc6c
Compiling with updater
-- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE) 
-- Checking for module 'cloudproviders'
--   No package 'cloudproviders' found
CMake Error at src/CMakeLists.txt:63 (get_target_property):
  get_target_property() called with non-existent target "Qt5::qmake".


-- Using Qt  ()
list of plugins suffix;cfapi;xattr
discovery suffix
/home/markus/git/nextcloud/desktop/src/libsync/vfs/suffix
/home/markus/git/nextcloud/desktop/src/libsync/vfs/suffix suffix
-- Added vfsPlugin without tests: suffix
discovery cfapi
/home/markus/git/nextcloud/desktop/src/libsync/vfs/cfapi
/home/markus/git/nextcloud/desktop/src/libsync/vfs/cfapi cfapi
-- Added vfsPlugin without tests: cfapi
discovery xattr
/home/markus/git/nextcloud/desktop/src/libsync/vfs/xattr
/home/markus/git/nextcloud/desktop/src/libsync/vfs/xattr xattr
-- Added vfsPlugin without tests: xattr
CMake Error at src/gui/CMakeLists.txt:64 (qt_add_resources):
  Unknown CMake command "qt_add_resources".


-- Configuring incomplete, errors occurred!
See also "/home/markus/git/nextcloud/desktop/build/CMakeFiles/CMakeOutput.log".

In the topmost CMakeLists.txt, I found these two options:

# this option creates only libocsync and libowncloudsync (NOTE: BUILD_CLIENT needs to be on)
option(BUILD_LIBRARIES_ONLY "BUILD_LIBRARIES_ONLY" OFF)

# build the GUI component, when disabled only nextcloudcmd is built
option(BUILD_GUI "BUILD_GUI" ON)

By switching them, the cmake command reports interesting errors:

cmake .. -DCMAKE_INSTALL_PREFIX=~/nextcloud-desktop-client -DBUILD_LIBRARIES_ONLY=ON -DBUILD_GUI=OFF



-- Build of crashreporter disabled.
-- GIT_SHA1 b6bfb243e67a12ff3ccf46db76a3ed7f7e4dbc6c
Compiling with updater
-- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE) 
-- Checking for module 'cloudproviders'
--   No package 'cloudproviders' found
CMake Error at src/CMakeLists.txt:63 (get_target_property):
  get_target_property() called with non-existent target "Qt5::qmake".


-- Using Qt  ()
list of plugins suffix;cfapi;xattr
discovery suffix
/home/markus/git/nextcloud/desktop/src/libsync/vfs/suffix
/home/markus/git/nextcloud/desktop/src/libsync/vfs/suffix suffix
-- Added vfsPlugin without tests: suffix
discovery cfapi
/home/markus/git/nextcloud/desktop/src/libsync/vfs/cfapi
/home/markus/git/nextcloud/desktop/src/libsync/vfs/cfapi cfapi
-- Added vfsPlugin without tests: cfapi
discovery xattr
/home/markus/git/nextcloud/desktop/src/libsync/vfs/xattr
/home/markus/git/nextcloud/desktop/src/libsync/vfs/xattr xattr
-- Added vfsPlugin without tests: xattr
CMake Warning at shell_integration/CMakeLists.txt:14 (find_package):
  By not providing "FindKF5KIO.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "KF5KIO", but
  CMake did not find one.

  Could not find a package configuration file provided by "KF5KIO" (requested
  version 5.16) with any of the following names:

    KF5KIOConfig.cmake
    kf5kio-config.cmake

  Add the installation prefix of "KF5KIO" to CMAKE_PREFIX_PATH or set
  "KF5KIO_DIR" to a directory containing one of the above files.  If "KF5KIO"
  provides a separate development package or SDK, be sure it has been
  installed.


Dolphin plugin disabled: KDE Frameworks 5.16 not found
-- The following OPTIONAL packages have been found:

 * PdfLatex

-- The following REQUIRED packages have been found:

 * Inotify
 * OpenSSL (required version >= 1.1)
 * ZLIB
 * Qt5Core, Qt5 Core component.
 * Qt5Keychain
 * PkgConfig
 * SQLite3 (required version >= 3.8.0)
 * Qt5Network (required version >= 5.12.8), Qt5 Network component.
 * Qt5WebSockets
 * Qt5Gui (required version >= 5.12.8)
 * Qt5Widgets
 * Qt5Svg
 * Qt5

-- The following OPTIONAL packages have not been found:

 * Sphinx
 * KF5KIO (required version >= 5.16)

-- The following REQUIRED packages have not been found:

 * Qt5Xml (required version >= 5.15.0), Qt5 Xml component.
 * Qt5Concurrent (required version >= 5.15.0), Qt5 Concurrent component.
 * Qt5WebEngineWidgets (required version >= 5.15.0), Qt5 WebEngineWidgets component.
 * Qt5WebEngine (required version >= 5.15.0), Qt5 WebEngine component.

CMake Error at /usr/share/cmake-3.16/Modules/FeatureSummary.cmake:457 (message):
  feature_summary() Error: REQUIRED package(s) are missing, aborting CMake
  run.
Call Stack (most recent call first):
  CMakeLists.txt:273 (feature_summary)


-- Configuring incomplete, errors occurred!
See also "/home/markus/git/nextcloud/desktop/build/CMakeFiles/CMakeOutput.log".

How can Qt5Xml, Qt5Concurrent, Qt5WebEngineWidgets and Qt5WebEngine be missing, when many other Qt5 components are present?

I double checked that Qt5 is installed:

sudo apt-get install qt5-default 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
qt5-default is already the newest version (5.12.8+dfsg-0ubuntu2.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

How to Compile NextCloud 3.0.3 on Ubuntu 20.4

Install following GitHub - nextcloud/desktop: 💻 Desktop sync client for Nextcloud

sudo apt install cmake g++ qt5-default openssl libssl-dev libzip-dev qtbase5-private-dev qtdeclarative5-dev qtwebengine5-dev qt5keychain-dev qttools5-dev sqlite3 libsqlite3-dev libqt5svg5-dev zlib1g-dev libqt5websockets5-dev qtquickcontrols2-5-dev shared-mime-inf 

Install due to CMake errors along the way

sudo apt install libkf5archive-dev extra-cmake-modules libkf5kio-dev libqt5webkit5-dev

Ubuntu 20.4 has Qt 5.12.8, Git master requires Qt 5.15.0

find .. -type f -exec grep -H '"5.15.0"' {} \;
../src/CMakeLists.txt:set(REQUIRED_QT_VERSION "5.15.0")
../shell_integration/dolphin/CMakeLists.txt:set(QT_MIN_VERSION "5.15.0")

Instead of getting Qt 5.15, go back to NextCloud v3.0.3 because it requires Qt 5.12

git clone --depth 1 --branch v3.0.3 https://github.com/nextcloud/desktop.git
cd desktop
mkdir build && cd build

Cmake and make

cmake .. -DCMAKE_INSTALL_PREFIX=~/ncdc	
sudo make install

I suspect, that you were able to compile successfully in the end, then? If not, please clarify what is missing/causing trouble.

Hi @christianlupus
Yes, and I should have added that make install was successful :slight_smile:

While this is a step forward, the more interesting question is how to compile a recent NextClould , which means installing a recent Qt5. I have met difficulties which I will resolve or report shortly.

1 Like