Attempting to Build the OwnCloud Client from Source
I currently run my own local ownCloud server. I am also a big fan of the Fedora Linux distribution, so I run that on my main laptop. As I use the ownCloud desktop client to communicate with my server, it has clearly made sense to use the official ownCloud fedora package repository. This is a nice convenient way of maintaining the latest version.
However, I have found that this repository does not get updated very quickly after the release of a new version, at least just lately, which means it is something that stands in the way of confidently upgrading to the latest version of Fedora (currently version 36).
As a result, I thought it might be worth investigating whether I can try building the ownCloud desktop client directly from source code, in case that might be a better way of avoiding the wait. I would much prefer to avoid this, but at least it would be available as an option.
Therefore, this blog post is an attempt to document my attempts to go through the official documentation on compiling the client, to see how easy or difficult it might be and what steps it might take to overcome any difficulties.
Setting up the Environment
In order to try this out, I thought it would be best to use a Fedora 36 VM, running under VirtualBox, which is something I already have. For the purposes of this exercise, it is worth noting that this VM has been around for a number of years and I have been upgrading it from one version to another and have installed all sorts of things, so this is definitely not a cleanly installed version, hence there will presumably be significant differences if this is attempted on a newly installed version. I may try putting together instructions on a newly installed Fedora distribution in due course.
Note that I took the VM snapshot before starting this exercise, which of course is one of the great advantages of a VM over a direct installation.
As I already had the official ownCloud client installed on this VM, the first thing to do was to remove it, to avoid any clash with the subsequent building from source.
dnf remove owncloud-client
Analysis and summary of the build instructions
According to those official instructions on building the ownCloud client, there appear to be two different approaches.
- Perform the build, such that it uses exactly the same dependencies that are used to build the official owncloud-client. This means you end up with something that should be exactly the same as that built by the ownCloud project. However, this depends on using the repository to download associated rpms, rather than the actual source code.
- Download the source code and then build using what ever dependencies exist on the target system.
The latter definitely seem to be what would be required, since otherwise I would be trying to use a repository which doesn't currently exist (i.e., nothing for Fedora 36). Therefore, I decided that I would follow instructions for the source code itself.
The generic build instructions can be examined for the official details, but at the time of writing a summary of what is required are the following list of commands.
- git clone git://github.com/owncloud/client.git
- cd client
- git checkout master
- git submodule init
- git submodule update
- mkdir client-build
- cd client-build
- cmake -DCMAKE_PREFIX_PATH=/opt/ownCloud/qt-5.12.4 -DCMAKE_INSTALL_PREFIX=/Users/path/to/client/../install/ ..
- make
- make install
Following the Build Instructions
This section documents my attempt to actually follow the build instructions and anything I needed to do to get round the problems I encountered. I will divide those temps into roughly the same sections as given in the official build instructions.
Clone the Latest Versions of the Client from Git
mkdir -p ~/Build/owncloud
cd ~/Build/owncloud
git clone git://github.com/owncloud/client.git
Cloning into 'client'... fatal: unable to connect to github.com: github.com[0: 140.82.121.3]: errno=Connection timed out
Something was clearly wrong here and it left me scratching my head for a while. Eventually, after searching for some examples of using git, I figured that the documentation may be mistaken and so tried using the https prefix.
git clone https://github.com/owncloud/client.git
Cloning into 'client'... remote: Enumerating objects: 121651, done. remote: Counting objects: 100% (19/19), done. remote: Compressing objects: 100% (16/16), done. remote: Total 121651 (delta 7), reused 9 (delta 3), pack-reused 121632 Receiving objects: 100% (121651/121651), 191.40 MiB | 7.30 MiB/s, done. Resolving deltas: 100% (96304/96304), done.
cd client
git checkout master Already on 'master' Your branch is up to date with 'origin/master'. git submodule init Submodule 'src/3rdparty/libcrashreporter-qt' (https://github.com/dschmidt/libcrashreporter-qt.git) registered for path 'src/3rdparty/libcrashreporter-qt' git submodule update Cloning into '/home/saxman/Build/owncloud/client/src/3rdparty/libcrashreporter-qt'... Submodule path 'src/3rdparty/libcrashreporter-qt': checked out '47dbf7629f07608416a0476b82c98004f04fbdde'
Create the Build Directory
mkdir client-build
cd client-build
Configure the Client Build
As I mentioned earlier, the command given in the official build documentation for configuring the client build is as follows:
cmake -DCMAKE_PREFIX_PATH=/opt/ownCloud/qt-5.12.4 -DCMAKE_INSTALL_PREFIX=/Users/path/to/client/../install/ ..
However, from reading the rest of that documentation, it would appear that I don't need to specify either the prefix path all the install prefix. I gather that the prefix path is only required if you are building a particular version of qt (which I am not) and the install prefix I believe has a default of "/usr/local". Note that the final ".." argument indicates the source directory (as far as I understand). Hence, the following command should be required:
cmake ..
-- The CXX compiler identification is GNU 12.1.1 -- The C compiler identification is GNU 12.1.1 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/lib64/ccache/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/lib64/ccache/cc - skipped -- Detecting C compile features -- Detecting C compile features - done CMake Error at CMakeLists.txt:8 (find_package): Could not find a package configuration file provided by "ECM" (requested version 5.50.0) with any of the following names: ECMConfig.cmake ecm-config.cmake Add the installation prefix of "ECM" to CMAKE_PREFIX_PATH or set "ECM_DIR" to a directory containing one of the above files. If "ECM" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! See also "/home/saxman/Build/owncloud/client/client-build/CMakeFiles/CMakeOutput.log".
I then searched for 'Could not find a package configuration file provided by "ECM"' on Google, which amongst other things returned CMake configuration error (package configuration file) #8. This gave me the clue that some packages might need to be installed. The first thing suggested led me to try:
- dnf install extra-
cmake-modules
After this, I saw a different error.
cmake ..
Installing in /usr/local. Run /home/saxman/Build/owncloud/client/client-build/prefix.sh to set the environment for client. -- Setting build type to 'Debug' as none was specified. -- Looking for __GLIBC__ -- Looking for __GLIBC__ - found -- Performing Test _OFFT_IS_64BIT -- Performing Test _OFFT_IS_64BIT - Success -- Performing Test HAVE_DATE_TIME -- Performing Test HAVE_DATE_TIME - Success -- Adding additional plugin path: ../lib64/plugins -- Branding: ownCloud -- Build of crashreporter disabled. -- GIT_SHA1 bc18bc7ae9eae70d087284d194747f2254463599 -- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find SQLite3 (missing: SQLite3_INCLUDE_DIR SQLite3_LIBRARY) (Required is at least version "3.9.0") Call Stack (most recent call first): /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) cmake/modules/FindSQLite3.cmake:52 (find_package_handle_standard_args) CMakeLists.txt:135 (find_package) -- Configuring incomplete, errors occurred! See also "/home/saxman/Build/owncloud/client/client-build/CMakeFiles/CMakeOutput.log".
This appeared to indicate that there might be some other packages required and it would be a matter of tracking them down. Cutting a long story short, I used the various error messages I received on rerunning the cmake command and "dnf search" to install some more packages, summarised by the following command line:
dnf install sqlite-devel qtkeychain-devel qtkeychain-qt5-devel
After that, there seemed to be success:
cmake ..
Installing in /usr/local. Run /home/saxman/Build/owncloud/client/client-build/prefix.sh to set the environment for client. -- Adding additional plugin path: ../lib64/plugins -- Branding: ownCloud -- Build of crashreporter disabled. -- GIT_SHA1 bc18bc7ae9eae70d087284d194747f2254463599 -- Found SQLite3: /usr/include (found suitable version "3.36.0", minimum required is "3.9.0") -- OWNCLOUD_ICONS: owncloud: /home/saxman/Build/owncloud/client/src/resources//theme/colored/1024-owncloud-icon.png;/home/saxman/Build/owncloud/client/src/resources//theme/colored/128-owncloud-icon.png;/home/saxman/Build/owncloud/client/src/resources//theme/colored/16-owncloud-icon.png;/home/saxman/Build/owncloud/client/src/resources//theme/colored/24-owncloud-icon.png;/home/saxman/Build/owncloud/client/src/resources//theme/colored/256-owncloud-icon.png;/home/saxman/Build/owncloud/client/src/resources//theme/colored/32-owncloud-icon.png;/home/saxman/Build/owncloud/client/src/resources//theme/colored/48-owncloud-icon.png;/home/saxman/Build/owncloud/client/src/resources//theme/colored/64-owncloud-icon.png -- Using Qt 5.15.3 (/usr/lib64/qt5/bin/qmake) -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success -- Performing Test COMPILER_HAS_DEPRECATED_ATTR -- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success -- Looking for nanosleep in rt -- Looking for nanosleep in rt - found -- Looking for utimes -- Looking for utimes - found -- Looking for lstat -- Looking for lstat - found CMake Warning at src/libsync/CMakeLists.txt:5 (message): Failed to find system OpenAPI::LibreGraphAPI: fetching v0.13.2 -- OWNCLOUD_SIDEBAR_ICONS: owncloud: -- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0") -- Checking for module 'cloudproviders>=0.3' -- Package 'cloudproviders', required by 'virtual:world', not found Building without libcloudproviders -- Found SharedMimeInfo: /usr/bin/update-mime-database (found version "2.1") -- Added vfsPlugin without tests: off -- Added vfsPlugin without tests: suffix -- Could NOT find KF5KIO (missing: KF5KIO_DIR) -- Could NOT find KF5KIO: found neither KF5KIOConfig.cmake nor kf5kio-config.cmake -- Could NOT find KF5 (missing: KIO) (Required is at least version "5.16") Dolphin plugin disabled: KDE Frameworks 5.16 not found -- Could NOT find CMocka (missing: CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR) -- The following OPTIONAL packages have been found: * Qt5LinguistTools * SharedMimeInfo, A database of common MIME types, <https://freedesktop.org/wiki/Software/shared-mime-info/> -- The following REQUIRED packages have been found: * ECM (required version >= 5.50.0), Extra CMake Modules., <https://projects.kde.org/projects/kdesupport/extra-cmake-modules> * Inotify * ZLIB * SQLite3 (required version >= 3.9.0) * Qt5Concurrent * Qt5Keychain * Qt5Gui (required version >= 5.15.3) * Qt5Widgets * Qt5DBus * PkgConfig * Qt5Core * Qt5Test * Qt5Xml * Qt5Network * Qt5 -- The following features have been disabled: * AppImageUpdate, Built-in libappimageupdate based updater * Libcloudproviders, Enable cloud provider integration -- The following OPTIONAL packages have not been found: * KF5KIO (required version >= 5.16) * KF5 (required version >= 5.16) * CMocka -- Suitable ECM 5.94.0 found, installing clang-format git hook -- Configuring done CMake Warning (dev) at client-build/src/libsync/libregraphapisrc-src/client/CMakeLists.txt:20 (add_library): Policy CMP0063 is not set: Honor visibility properties for all target types. Run "cmake --help-policy CMP0063" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Target "client" of type "STATIC_LIBRARY" has the following visibility properties set for CXX: CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN For compatibility CMake is not honoring them for this target. This warning is for project developers. Use -Wno-dev to suppress it. -- Generating done -- Build files have been written to: /home/saxman/Build/owncloud/client/client-build
Perform the Actual Build
With the environment set, I just needed to issue the make command.
make
[ 0%] Automatic MOC and UIC for target owncloudResources [ 0%] Built target owncloudResources_autogen [ 1%] Automatic RCC for core_theme.qrc [ 2%] Generating client_ar.qm ... ... [ 99%] Built target ActivityModelTest [100%] Automatic MOC for target ProtocolModelTest [100%] Built target ProtocolModelTest_autogen [100%] Building CXX object test/modeltests/CMakeFiles/ProtocolModelTest.dir/ProtocolModelTest_autogen/mocs_compilation.cpp.o [100%] Building CXX object test/modeltests/CMakeFiles/ProtocolModelTest.dir/testprotocolmodel.cpp.o [100%] Linking CXX executable ../../bin/ProtocolModelTest [100%] Built target ProtocolModelTest
Success!
Installing the OwnCloud Client
Having successfully built the client, all that would appear to be required would be to perform the installation. As the installation requires admin privileges, the following command can be used to allow this:
su -c "make install"
[ 0%] Automatic MOC and UIC for target owncloudResources [ 0%] Built target owncloudResources_autogen Consolidate compiler generated dependencies of target owncloudResources [ 8%] Built target owncloudResources [ 8%] Automatic MOC for target csync [ 8%] Built target csync_autogen Consolidate compiler generated dependencies of target csync [ 13%] Built target csync [ 13%] Automatic MOC for target client [ 13%] Built target client_autogen ... ... -- Installing: /usr/local/share/icons/hicolor/72x72/apps/ownCloud_ok_shared.png -- Installing: /usr/local/share/icons/hicolor/72x72/apps/ownCloud_sync.png -- Installing: /usr/local/share/icons/hicolor/72x72/apps/ownCloud_sync_shared.png -- Installing: /usr/local/share/icons/hicolor/72x72/apps/ownCloud_warn.png -- Installing: /usr/local/share/icons/hicolor/72x72/apps/ownCloud_warn_shared.png -- Installing: /usr/local/share/nautilus-python/extensions/syncstate-ownCloud.py -- Installing: /usr/local/share/nemo-python/extensions/syncstate-ownCloud.py -- Installing: /usr/local/share/caja-python/extensions/syncstate-ownCloud.py
Testing the OwnCloud Client
A quick test would be whether you can actually launch the newly installed client. When I did this through the normal menu entry, it successfully launched and on the test VM, it recognised that there was no server configuration and therefore opened the wizard.