2013-09-03 14:34:29 +04:00
.. _building-label:
Appendix A: Building the Client
===============================
2012-10-31 17:44:18 +04:00
2012-10-31 18:19:00 +04:00
This section explains how to build the ownCloud Client from source
for all major platforms. You should read this section if you want
to development on the desktop client.
2012-10-31 17:44:18 +04:00
2013-11-06 14:13:55 +04:00
Note that the building instruction are subject to change as development
proceeds. It is important to check the version which is to built.
This instructions were updated to work with ownCloud Client 1.5.
2012-10-31 17:44:18 +04:00
Linux
-----
1. Add the `ownCloud repository from OBS`_ .
2. Install the dependencies (as root, or via sudo):
* Debian/Ubuntu: `` apt-get update; apt-get build-dep owncloud-client ``
* openSUSE: `` zypper ref; zypper si -d owncloud-client ``
2012-10-31 18:19:00 +04:00
* Fedora/CentOS: `` yum install yum-utils; yum-builddep owncloud-client ``
2012-10-31 17:44:18 +04:00
2012-10-31 18:19:00 +04:00
3. Follow the `generic build instructions`_ .
2012-10-31 17:44:18 +04:00
Mac OS X
--------
2013-05-17 13:40:43 +04:00
Next to XCode (and the command line tools!), you will need some
extra dependencies.
2013-01-22 18:08:56 +04:00
2013-05-17 13:40:43 +04:00
You can install these dependencies via MacPorts_ or Homebrew_.
2012-10-31 17:44:18 +04:00
This is only needed on the build machine, since non-standard libs
will be deployed in the app bundle.
2013-05-17 13:40:43 +04:00
The tested and preferred way is to use HomeBrew_. The ownCloud team has
2013-05-17 14:02:40 +04:00
its own repository which contains non-standard recipes. Add it with::
2012-10-31 18:19:00 +04:00
2013-05-17 13:40:43 +04:00
brew tap owncloud/owncloud
2012-10-31 18:19:00 +04:00
2013-05-17 14:02:40 +04:00
Next, install the missing dependencies::
2013-05-17 13:40:43 +04:00
brew install $(brew deps mirall)
2013-09-09 21:09:08 +04:00
2014-02-12 14:32:19 +04:00
To build mirall, follow the `generic build instructions`_ .
2012-10-31 17:44:18 +04:00
.. note ::
You should not call `` make install `` at any time, since the product of the
mirall build is an app bundle. Call `` make package `` instead to create an
install-ready disk image.
Windows (cross-compile)
-----------------------
2014-02-12 14:32:19 +04:00
Due to the amount of dependencies, building the client for Windows
is **currently only supported on openSUSE** , by using the MinGW
2013-11-14 15:36:09 +04:00
cross compiler. You can set up openSUSE 12.1, 12.2 or 13.1 in a virtual machine
2012-10-31 17:44:18 +04:00
if you do not have it installed already.
In order to cross-compile, the following repositories need to be added
2013-11-14 15:36:09 +04:00
via YaST or `` zypper ar `` (adjust when using openSUSE 12.2 or 13.1)::
2012-10-31 17:44:18 +04:00
2014-03-07 12:56:28 +04:00
zypper ar http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/windows:mingw:win32.repo
zypper ar http://download.opensuse.org/repositories/windows:/mingw/openSUSE_13.1/windows:mingw.repo
2012-10-31 17:44:18 +04:00
Next, install the cross-compiler packages and the cross-compiled dependencies::
2013-04-26 19:02:55 +04:00
zypper install cmake make mingw32-cross-binutils mingw32-cross-cpp mingw32-cross-gcc \
mingw32-cross-gcc-c++ mingw32-cross-pkg-config mingw32-filesystem \
2013-12-02 14:37:06 +04:00
mingw32-headers mingw32-runtime site-config mingw32-libqt4-sql \
2014-03-13 17:02:48 +04:00
mingw32-libqt4-sql-sqlite mingw32-sqlite mingw32-libsqlite-devel \
2013-11-25 15:50:12 +04:00
mingw32-dlfcn-devel mingw32-libssh2-devel kdewin-png2ico \
mingw32-libqt4 mingw32-libqt4-devel mingw32-libgcrypt \
2013-11-14 15:36:09 +04:00
mingw32-libgnutls mingw32-libneon-openssl mingw32-libneon-devel \
mingw32-libbeecrypt mingw32-libopenssl mingw32-openssl \
mingw32-libpng-devel mingw32-libsqlite mingw32-qtkeychain \
mingw32-qtkeychain-devel mingw32-dlfcn mingw32-libintl-devel \
mingw32-libneon-devel mingw32-libopenssl-devel mingw32-libproxy-devel \
mingw32-libxml2-devel mingw32-zlib-devel
2012-11-19 21:15:25 +04:00
2012-12-14 23:42:59 +04:00
For the installer, the NSIS installer package is also required::
2012-11-19 21:15:25 +04:00
2013-04-26 19:02:55 +04:00
zypper install mingw32-cross-nsis
2012-12-14 23:42:59 +04:00
.. Usually, the following would be needed as well, but due to a bug in mingw, they
will currently not build properly from source.
mingw32-cross-nsis-plugin-processes mingw32-cross-nsis-plugin-uac
2013-01-22 18:08:56 +04:00
You will also need to manually download and install the following files with
2013-11-14 15:36:09 +04:00
`` rpm -ivh <package> `` (They will also work with openSUSE 12.2 and newer)::
2012-12-14 23:42:59 +04:00
2013-10-28 20:17:10 +04:00
rpm -ihv http://download.tomahawk-player.org/packman/mingw:32/openSUSE_12.1/x86_64/mingw32-cross-nsis-plugin-processes-0-1.1.x86_64.rpm
rpm -ihv http://download.tomahawk-player.org/packman/mingw:32/openSUSE_12.1/x86_64/mingw32-cross-nsis-plugin-uac-0-3.1.x86_64.rpm
2012-10-31 17:44:18 +04:00
2012-11-21 17:57:04 +04:00
Now, follow the `generic build instructions`_ , but pay attention to
the following differences:
2012-10-31 17:44:18 +04:00
2014-03-07 12:56:28 +04:00
For building for windows a special toolchain file has to be specified.
That makes cmake finding the platform specific tools. This parameter
has to be added to the call to cmake:
2012-11-21 17:57:04 +04:00
`` -DCMAKE_TOOLCHAIN_FILE=../mirall/admin/win/Toolchain-mingw32-openSUSE.cmake ``
2012-10-31 17:44:18 +04:00
Finally, just build by running `` make `` . `` make package `` will produce
an NSIS-based installer, provided the NSIS mingw32 packages are installed.
Generic Build Instructions
--------------------------
2012-10-31 18:19:00 +04:00
.. _`generic build instructions`
2014-03-07 12:56:28 +04:00
Compared to previous versions building of Mirall has become more easy.
CSync, which is the sync engine library of Mirall, is now part of the
Mirall source repository, not, like it was before, a separate module.
Mirall can be downloaded at ownCloud's `Client Download Page`_ .
2012-10-31 17:44:18 +04:00
If you want to build the leading edge version of the client, you should
2014-03-07 12:56:28 +04:00
use the latest versions of Mirall via Git_, like so::
2012-10-31 17:44:18 +04:00
git clone git://github.com/owncloud/mirall.git
2014-03-07 12:56:28 +04:00
Next, create build directories::
2012-10-31 17:44:18 +04:00
2014-02-12 14:32:19 +04:00
mkdir mirall-build
2012-10-31 17:44:18 +04:00
2014-03-07 12:56:28 +04:00
Now build mirall::
cd ../mirall-build
cmake -DCMAKE_BUILD_TYPE="Debug" ../mirall
2012-10-31 17:44:18 +04:00
2013-01-22 18:08:56 +04:00
Note that it is important to use absolute pathes for the include- and library
directories. If this succeeds, call `` make `` . The owncloud binary should appear
in the `` bin `` directory. You can also run `` make install `` to install the client to
2012-10-31 17:44:18 +04:00
`` /usr/local/bin `` .
2013-05-17 13:40:43 +04:00
To build an installer/app bundle (requires the mingw32-cross-nsis packages on Windows)::
2012-11-19 21:15:25 +04:00
make package
2013-03-11 19:18:20 +04:00
Known cmake parameters:
2014-02-11 14:45:00 +04:00
* QTKEYCHAIN_LIBRARY=/path/to/qtkeychain.dylib -DQTKEYCHAIN_INCLUDE_DIR=/path/to/qtkeychain/: Use QtKeychain for stored credentials. When compiling with Qt5, the library is called qt5keychain.dylib. You need to compile QtKeychain with the same Qt version.
2014-02-12 14:32:19 +04:00
* WITH_DOC=TRUE: create doc and manpages via running `` make `` ; also adds install statements to be able to install it via `` make install `` .
* CMAKE_PREFIX_PATH=/path/to/Qt5.2.0/5.2.0/yourarch/lib/cmake/ : to build with Qt5
* BUILD_WITH_QT4=ON : to build with Qt4 even if Qt5 is found
2013-03-11 19:18:20 +04:00
2012-10-31 17:44:18 +04:00
.. _`ownCloud repository from OBS`: http://software.opensuse.org/download/package?project=isv:ownCloud:devel&package=owncloud-client
.. _CSync: http://www.csync.org
.. _`Client Download Page`: http://owncloud.org/sync-clients/
.. _Git: http://git-scm.com
.. _MacPorts: http://www.macports.org
.. _Homebrew: http://mxcl.github.com/homebrew/
2014-03-07 12:56:28 +04:00
.. _QtKeychain https: //github.com/frankosterfeld/qtkeychain