CSync and Mirall Development Setup
people were asking how to set up a development setup for the syncing client we are working on to sync local files to ownCloud and vice versa currently, work title mirall. While a website about it is not yet finished, I try to summarize it here. There are some hacks here and there but that’s how I do it today. It will improve over time. Note that this is about a real development setup, not for a production build.
Linux and Windows development should go in parallel as easy as possible.
Edit: Please also refer to the official build documentation.
cmake -DCMAKE_BUILD_TYPE="Debug" ../csync
and watch its output. You probably have to fulfill some dependencies, make sure to install all the needed devel packages. You will need log4c, iniparser, sqlite3 and for the modules libssh, libsmbclient and neon for the ownCloud module. Once cmake succeeds, call make to build it. So far relaxed for Linux.
To build csync for Windows, there are a couple of possibilities. The one I chose was to cross compile with mingw under openSUSE. That way I can build for all on one devel machine under my prefered system.
For that, I installed the cross compile and mingw32 packages from the openSUSE Build Service, which really demonstrates power here. I used the mingw repository. Kudos at this point to Dominik Schmidt, a Tomahawk developer, who helped me a lot to set all up and to all people who work in OBS to maintain the mingw repo.
Basically the cross compiler and libs (eg. packages
mingw32-cross-cpp) and the dependencies for the software to build have to be installed from the mingw repo. An action item is left to dig which in detail.
After installation you should have some mingw32-tools such as
mingw32-cmake which should be used to build for win.
Now create a directory win and within that again buildcsync. In there, start
mingw32-cmake -DCMAKE_BUILD_TYPE="Debug" -DWITH_LOG4C=OFF ../../csync
That should do it. I did not find log4c for Win32, so I disabled it in the cmake call.
Now build it with
mingw32-make and see if it creates a dll in the src subdir and csync.exe in the client dir.
For mirall, it works similar. Mirall uses Qt and is C++, so again a lot of packages to install. Make again sure to have the mingw32-qt packages, for example
mingw32-libqt4-devel and more.
However, there are two caveats with mirall:
- the current development state of mirall needs the latest devel version of csync which
we just built. I tweaked the CMakefile that way that if the mirall- and csync and build*
folders are in the same directory, the csync is found by mirall cmake in the parallel dir.
So I do not have to install the devel version of csync in my system.
- to build mirall for windows, it must be made sure that cmake finds the mingw32 Qt tools like moc. Since there is also the Linux moc in the system, this can confuse.
Domme pointed me to a script that sets some variables correct values to prevent mixing:
# %_mingw32_qt4_platform win32-g++-cross
With that setup I can build both the Linux and Windows version quite easily. There is still a lot to be solved, such as automatted packaging and such. CMake as usual is a great help.