[Owncloud] how-to compile owncloud client on Windows

Luke Owncloud owncloud at ohrt.org
Thu Nov 8 13:12:34 UTC 2012


Hi Antonio,

I don't think anybody has natively compiled ownCloud for Windows.
Here you find instructions how to cross-compile it running Linux:

http://daniel.molkentin.de/occ/building.html#windows-cross-compile

http://dragotin.wordpress.com/2012/03/22/csync-and-mirall-development-setup/


Further, it tried to compile it using Cygwin. I attached the script 
which does the job. However, it is of not much use, because it compiles 
the owncloud client for the Cygwin X interface.

Cheers,
Luke

On 08.11.2012 13:22, Antonio Giovanni Pacicca wrote:
> HI,
>
> I need to build owncloud client for Windows 7 but i can't find any kind
> of how-to or help that seems to work. There is some easy way to do this
> with qt creator or else?
>
> Sorry for my english
> Thanks
>
>
> _______________________________________________
> Owncloud mailing list
> Owncloud at kde.org
> https://mail.kde.org/mailman/listinfo/owncloud
>
-------------- next part --------------

### init

init()
{
  cd ~
  PATH=/usr/local/bin:/usr/bin
}

### Install requried packages

install_packages_csync()
{
  wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
  chmod a+x apt-cyg
  mv apt-cyg /usr/local/bin
  apt-cyg install gcc gcc4 make           \
      patch sed cmake libsqlite3-devel \
      libneon-devel libssh2_1 git
}

### Install iniparser (required by csync)

install_iniparser()
{
  wget http://ndevilla.free.fr/iniparser/iniparser-3.1.tar.gz
  tar xzf iniparser-3.1.tar.gz
  cd iniparser
  make
  cp lib* /usr/lib
  cp src/*.h /usr/include
  cd ..
  rm iniparser-3.1.tar.gz
  rm -rf iniparser
}

### Download csync

download_cysnc()
{
  cd ~
  git clone git://git.csync.org/users/freitag/csync.git
  cd csync
  git checkout dav
  git pull
  cd ..
}

### Compile csync

compile_csync()
{
  cd ~
  mkdir buildcsync
  cd buildcsync/
  cmake -DCMAKE_BUILD_TYPE="Debug" -DLOG_TO_CALLBACK=ON -DWITH_LOG4C=OFF ../csync
  make
}

### Run csync

run_csync()
{
  cp src/cygocsync-0.dll client/
  cp src/cygocsync-0.dll src/libocsync.dll
  ./client/ocsync
  cd ..

###

echo Above you should see output of ocsync.
echo Press any key to continue.
read

}

### Download mirall

download_mirall()
{
  git clone git://github.com/owncloud/mirall.git
  cd mirall/
}

### Patch CMakeLists.txt -> use QT4 4.7.4

patch_CMakeLists()
{
  sed -i "s/Qt4 4.6.0/Qt4 4.7.4/" CMakeLists.txt
}

### Patch FindCsync.cmake -> use cygocsync-0.dll

patch_FindCsync()
{
  cd cmake/modules

  echo "Index: FindCsync.cmake" > FindCsync.cmake.patch
  echo "===================================================================" >> FindCsync.cmake.patch
  echo "--- FindCsync.cmake" >> FindCsync.cmake.patch
  echo "+++ FindCsync.cmake" >> FindCsync.cmake.patch
  echo "@@ -4,9 +4,17 @@" >> FindCsync.cmake.patch
  echo "   FIND_PATH(CSYNC_INCLUDE_PATH NAMES csync.h HINTS \$ENV{CSYNC_DIR} )" >> FindCsync.cmake.patch
  echo " ENDIF()" >> FindCsync.cmake.patch
  echo " " >> FindCsync.cmake.patch
  echo "+IF ( CYGWIN OR WIN32 )" >> FindCsync.cmake.patch
  echo "+  IF(EXISTS "\${CMAKE_SOURCE_DIR}/../buildcsync/src/cygocsync-0.dll")" >> FindCsync.cmake.patch
  echo "+    SET(CSYNC_LIBRARY_PATH \${CMAKE_SOURCE_DIR}/../buildcsync)" >> FindCsync.cmake.patch
  echo "+  ENDIF()" >> FindCsync.cmake.patch
  echo "+ENDIF()" >> FindCsync.cmake.patch
  echo "+" >> FindCsync.cmake.patch
  echo " IF( DEFINED CSYNC_LIBRARY_PATH AND DEFINED CSYNC_INCLUDE_PATH )" >> FindCsync.cmake.patch
  echo "   IF( WIN32 )" >> FindCsync.cmake.patch
  echo "     SET(CSYNC_LIBRARY \${CSYNC_LIBRARY_PATH}/src/libocsync.dll)" >> FindCsync.cmake.patch
  echo "+  ELSEIF ( CYGWIN )" >> FindCsync.cmake.patch
  echo "+    SET(CSYNC_LIBRARY \${CSYNC_LIBRARY_PATH}/src/cygocsync-0.dll)" >> FindCsync.cmake.patch
  echo "   ELSEIF ( APPLE )" >> FindCsync.cmake.patch
  echo "     SET(CSYNC_LIBRARY \${CSYNC_LIBRARY_PATH}/src/libocsync.dylib)" >> FindCsync.cmake.patch
  echo "   ELSE()" >> FindCsync.cmake.patch

  patch < FindCsync.cmake.patch

  rm FindCsync.cmake.patch

  cd ../..
}

### download QT

install_qt()
{
  apt-cyg install libQtGui4-devel libQtXml4-devel libQtNetwork4-devel libQtTest4-devel
}

### build mirall

build_mirall()
{
  cd ~
  mkdir buildmirall
  cd buildmirall/
  rm -rf *

  cmake -DCMAKE_BUILD_TYPE="Debug" ../mirall
  make

  cp src/cygowncloudsync.dll bin/
  cp ../buildcsync/src/cygocsync-0.dll bin/
}

### download X11

download_x11()
{
  apt-cyg install xinit
}
### start owncloud

start_owncloud()
{
  cd ~/buildmirall/bin
  startx ./owncloud.exe
}


###

echo This downloads and compiles ownCloud for Windows.
echo Execute this script in a clean Cygwin enviroment with just wget installed.
echo All requirements are installed automatically. Press key to continue.
echo By pressing key you accept the terms of the QT4 license.
read
init
echo Next: install_packages_csync
read
install_packages_csync
echo Next: install_iniparser
read
install_iniparser
echo Next: download_cysnc
read
download_cysnc
echo Next: compile_csync
read
compile_csync
echo Next: run_csync
read
run_csync
echo Next: download_mirall
read
download_mirall
echo Next: patch_CMakeLists
read
patch_CMakeLists
echo Next: patch_FindCsync
read
patch_FindCsync
echo Next: install_qt
read
install_qt
echo Next: build_mirall
read
build_mirall
echo Next: download_x11
read
download_x11
echo Next: start_owncloud
read
start_owncloud


More information about the Owncloud mailing list