This section explains how to build the ownCloud Desktop App from source for all major platforms. You should read this section if you want to develop for the Desktop App. Build instructions are subject to change as development proceeds.
Note
|
Please check the version for which you want to build. |
These instructions are updated to work with the latest version of the ownCloud Desktop App.
The generic build instructions pull the latest code directly from GitHub, and work on Linux, Mac OS X, and Windows.
For the published Desktop Apps we link against QT5 dependencies from our own repositories so that we can have the same versions on all distributions. This chapter shows you how to build the Desktop App yourself with this setup. If you want to use the QT5 dependencies from your system, see the next chapter.
You may wish to use source packages for your Linux distribution, as these give you the exact sources from which the binary packages are built. These are hosted on the ownCloud repository from OBS. Go to the Index of repositories to see all the Linux client repositories.
Note
|
To get the echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Debian_9.0/ /' >> /etc/apt/sources.list.d/owncloud-client.list echo 'deb-src http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Debian_9.0/ /' >> /etc/apt/sources.list.d/owncloud-client.list |
The above registers the source repository of the released Desktop App. There is also …/desktop:/testing/…
and e.g. …/desktop:/daily:/2.7/…
for beta versions or daily snapshots.
Install the dependencies using the following commands for your specific Linux distribution. Make sure the repositories for source packages are enabled. These are:
Distribution | Installation Instructions |
---|---|
Debian/Ubuntu |
|
openSUSE/SLES |
|
Fedora/CentOS/RHEL |
|
Follow the generic build instructions, starting with step 2.
Build sources from a GitHub checkout with dependencies provided by your Linux distribution. While this allows more freedom for development, it does not exactly represent what we ship as packages. See above for how to recreate packages from source.
Note
|
To get the source dependencies on Debian and Ubuntu, run the following command: sudo apt install qtdeclarative5-dev libinotifytools-dev \
qt5keychain-dev python3-sphinx \
libsqlite3-dev \
g++ extra-cmake-modules zlib1g-dev pkgconf |
Follow the generic build instructions, starting with step 1.
In addition to needing Xcode (along with the command line tools), developing in the macOS environment requires extra dependencies. You can install these dependencies through MacPorts or Homebrew. These dependencies are required only on the build machine, because non-standard libs are deployed in the app bundle.
The tested and preferred way to develop in this environment is through the use of HomeBrew. The ownCloud team has its own repository containing non-standard recipes. To set up your build environment for development using HomeBrew:
-
Install Xcode.
-
Install Xcode command line tools using
xcode-select --install
-
Install Homebrew using
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Add the ownCloud repository using the command
brew tap owncloud/owncloud
-
Install a Qt5 version, ideally from 5.10.1, using the command
brew install qt5
-
Install any missing dependencies, using the command:
brew install $(brew deps owncloud-client)
-
Install
qtkeychain
by runninggit clone https://github.com/frankosterfeld/qtkeychain.git
Make sure you make the same install prefix as later while building the Desktop App e.g.
-DCMAKE_INSTALL_PREFIX=/Path/to/client/../install
-
For compilation of the Desktop App, follow the generic build instructions.
-
Install the Packages package creation tool.
-
In the build directory, run
admin/osx/create_mac.sh <CMAKE_INSTALL_DIR> <build dir> <installer sign identity>
If you have a developer signing certificate, you can specify its Common Name as a third parameter (use quotes) to have the package signed automatically.
NoteContrary to earlier versions, version 1.7 and later are packaged as a
pkg
installer. Do not callmake package
at any time when compiling for OS X, as this will build a disk image, which will not work correctly.
If you want to test some changes, you can build the ownCloud Desktop App natively on Windows using KDE Craft. You can also use it to build unsupported and unoptimized installers.
To install KDE Craft, Python 2.7 or Python 3.6+, and PowerShell 5.0+ must be installed. You can find the full installation guide in the KDE Community Wiki.
Tip
|
If you want to use Microsoft Visual Studio, naturally, that must be installed as well. |
When the dependencies are installed, install KDE Craft using the following lines in PowerShell:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/KDE/craft/master/setup/install_craft.ps1'))
The first command allows running scripts from remote sources. The second command starts installing KDE Craft. You are asked where you want to put the main folder, called CraftRoot
, which will contain all source, build, and install folders. Please choose a disk with sufficient free space.
Last but not least, you need to choose the compiler you want to use. The official builds only supports Microsoft Visual Studio 2019. However, if you’re feeling adventurous, you can also try to use Mingw-w64. In contrast to Visual Studio, which you need to install in advance, KDE Craft can install Mingw-w64
for you.
Tip
|
Unless you need 32bit builds, you should stick to the default of x64 builds. |
After you install KDE Craft, there are two steps left before the ownCloud Desktop App can be compiled. These are:
To launch the KDE Craft environment, you need to run the following command in PowerShell. This provides you with a shell with all the environment variables set that you need to work with KDE Craft.
C:\CraftRoot\craft\craftenv.ps1
Tip
|
This needs to be done every time you want to work with Craft. |
Note
|
We’re assuming that you installed KDE Craft in the default path of C:\CraftRoot . If you have installed it somewhere else, please adjust the path as necessary.
|
The last step before we can begin, is adding the ownCloud repository. It provides you with additional dependencies and tools, which are not available from the standard KDE repository.
craft --add-blueprint-repository https://github.com/owncloud/craft-blueprints-owncloud.git
Tip
|
You only need to do this once. |
Finally, we can build the Desktop App with the following command:
craft owncloud-client
This installs all required dependencies and builds the ownCloud Desktop App from the master
git branch. If you want to build a different branch, first install all dependencies and then clone the source code from git, like this:
craft --install-deps owncloud-client
craft --fetch owncloud-client
You can find the git checkout in C:\CraftRoot\downloads\git\owncloud\owncloud-client
. There you can use the usual git commands to switch branches and remotes, e.g., to build the {latest-desktop-version}
stable branch you can use craft with --set version parameter:
git checkout {latest-desktop-version}
craft --set version={latest-desktop-version} owncloud-client
Afterwards you can build the Desktop App like this:
craft --configure --make --install
craft owncloud-client
Neither craft owncloud-client
nor craft --configure --make --install
make the ownCloud Desktop App available in your PATH, they only install to the so-called image directory. This is so KDE Craft knows which files belong to which package. In order to run the Desktop App, you first need to merge the image directory to the regular KDE Craft root (C:\CraftRoot
). Afterwards, you can run owncloud.exe
from your shell.
craft --qmerge owncloud-client
owncloud.exe
Although this is not officially supported, it is, generally, possible to build an installer with:
craft nsis
craft --package owncloud-client
Now you should have a file called: owncloud-client-master-${COMMIT_HASH}-windows-${COMPILER}.exe
in C:\CraftRoot\tmp
.
Note
|
This is not supported, optimised, nor regularly tested! Fully supported Windows installers are currently only provided by ownBrander. |
To build the most up-to-date version of the Desktop App:
-
Clone the latest versions of the Desktop App from Git as follows:
git clone https://github.com/owncloud/client.git cd client
By default,
git
clones the development branch calledmaster
. This branch often works, but this is not guaranteed. If you want to build a stable release or a specific branch, you can usegit checkout <name>
inside the clonedclient
directory to switch to another target. You can find a list of all releases [here](https://github.com/owncloud/client/releases).git checkout master git submodule init git submodule update
-
Create the build directory:
mkdir client-build cd client-build
-
Configure the Desktop App build:
cmake -DCMAKE_PREFIX_PATH=/opt/ownCloud/qt-5.15.2 -DCMAKE_INSTALL_PREFIX=/usr/ ..
Please also check the beginning of ../src/CMakeLists.txt - The version number in
find_package(Qt5 5.xx …
should match what you have available. For client 3.0 or later we use Qt 5.15.2 - for client 2.x we used Qt 5.12.10 or below. For Linux builds (using QT5 libraries via build-dep) a typical setting is-DCMAKE_PREFIX_PATH=/opt/ownCloud/qt-5.12.10/
However, the version number may vary. For Linux builds using system dependencies
-DCMAKE_PREFIX_PATH
is not needed. You must use absolute paths for theinclude
andlibrary
directories.On Mac OS X, you need to specify
-DCMAKE_INSTALL_PREFIX=target
, wheretarget
is a private location, i.e. in parallel to your build dir by specifying../install
.qtkeychain must be compiled with the same prefix e.g.,
-DCMAKE_INSTALL_PREFIX=/Users/path/to/client/../install/
-
Call
make
The ownCloud binary will appear in the
bin
directory.
-
(Optional) Call
make install
to install the Desktop App to the/usr/local/bin
directory (or as per CMAKE_INSTALL_PREFIX).
The following are known CMake parameters:-
QTKEYCHAIN_LIBRARY=/path/to/qtkeychain.dylib -DQTKEYCHAIN_INCLUDE_DIR=/path/to/qtkeychain/
Used for stored credentials. When compiling with Qt5, the library is calledqt5keychain.dylib.
You need to compile QtKeychain with the same Qt version. If you install QtKeychain into the CMAKE_PREFIX_PATH then you don’t need to specify the path manually. -
WITH_DOC=TRUE
: Creates doc and man pages through runningmake
; also adds install statements, providing the ability to install usingmake install
. -
CMAKE_PREFIX_PATH=/path/to/Qt5.12.4/5.12.4/yourarch/lib/cmake/
: Builds using that Qt version. -
CMAKE_INSTALL_PREFIX=path
: Set an install prefix. This is mandatory on Mac OS.
-
-
Optional: Run a Desktop App that was installed in a custom CMAKE_INSTALL_PREFIX may not pick up the correct libraries automatically. You can use LD_LIBRARY_PATH to help find the libraries like this:
LD_LIBRARY_PATH=/opt/ownCloud/qt-5.12.4/lib/x86_64-linux-gnu/:/Users/path/to/client/../install/lib/x86_64-linux-gnu/ /Users/path/to/client/../install/bin/owncloud
If you don’t want to go through the trouble of doing all the compiling work manually, you can use ownBrander to create installer images for all platforms.