Skip to content

Instantly share code, notes, and snippets.

@Noxwizard
Last active October 12, 2015 10:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Noxwizard/4011094 to your computer and use it in GitHub Desktop.
Save Noxwizard/4011094 to your computer and use it in GitHub Desktop.
Cross compiling ownCloud's Mirall on OpenSUSE

Cross Compiling ownCloud's Mirall on OpenSUSE

Get OpenSuse

  1. Download OpenSUSE 12.2 32bit: http://software.opensuse.org/122/en
  2. Install it

Add Dependency Repositories

In the YaST Control Center, click Software Repositories. Click Add and then Specify URL. Do that for the following:

Name: png2ico URL: http://download.opensuse.org/repositories/windows:/mingw/openSUSE_12.2/

Name: MinGW URL: http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_12.2/

Name: ownCloud MinGW libraries URL: http://download.opensuse.org/repositories/isv:/ownCloud:/devel:/mingw:/win32/openSUSE_12.2/

Name: Custom NSIS URL: http://pmbs.links2linux.org/download/mingw%3A/32/openSUSE_12.1/

You will be prompted to trust their GPG keys.

Download the Dependencies

Open the YaST Control Center and click Software Management

Search for "git". Put a check next to:

  • git

Search for "png2ico". Put a check next to:

  • kdewin-png2ico

Search for "iniparser". Put a check next to:

  • libiniparser-devel
  • libiniparser0 (If not auto-checked)
  • mingw32-iniparser
  • mingw32-iniparser-devel

Search for "dlfcn". Put a check next to:

  • mingw32-dlfcn
  • mingw32-dlfcn-devel

Search for "neon". Put a check next to:

  • libneon27 (If not already installed)
  • libneon-devel
  • mingw32-libneon
  • mingw32-libneon-devel

Search for "sqlite3". Put a check next to:

  • libsqlite3-0 (If not already installed)

Search for "libqt4". Put a check next to:

  • libqt4 (If not already installed)
  • libqt4-devel
  • mingw32-libqt4
  • mingw32-libqt4-devel

Search for "log4c". Put a check next to:

  • liblog4c-devel
  • liblog4c3 (If not auto-checked)

Search for "cmake". Put a check next to:

  • cmake

Search for "mingw32-cross". Put a check next to:

  • mingw32-cross-gcc
  • mingw32-cross-gcc-c++
  • mingw32-cross-nsis

For these two, click the Versions tab and mark the radio button next to "0-3.1-i586 from Custom NSIS..."

  • mingw32-cross-nsis-plugin-uac
  • mingw32-cross-nsis-plugin-processes

Search for "mingw32-sqlite". Put a check next to:

  • mingw32-sqlite
  • mingw32-libsqlite-devel

Search for "mingw32-lib". Put a check next to:

  • mingw32-libjpeg-devel
  • mingw32-libpng-devel
  • mingw32-libtiff-devel

Search for "mingw32-qtkeychain". Put a check next to:

  • mingw32-qtkeychain
  • mingw32-qtkeychain-devel

Search for "openssl". Put a check next to:

  • mingw32-openssl

Click Accept to install it all. It will prompt about other things it has to install as well, accept that too.

Set up the Build Structure

In the desktop area, right click and create a new folder named owncloud-dev

Get csync

Open a terminal and execute:

cd ~/Desktop/owncloud-dev
git clone git://git.csync.org/users/freitag/csync.git
cd csync
git checkout dav

Build it:

cd ..
mkdir buildcsync
cd buildcsync
cmake -DCMAKE_BUILD_TYPE="Debug" -DLOG_TO_CALLBACK=ON ../csync
make

Get the ownCloud Client

cd ..
git clone git://github.com/owncloud/mirall.git

Build the Linux ownCloud Client

Go back to the owncloud-dev folder and execute:

mkdir buildmirall
cd buildmirall

cmake -DCMAKE_BUILD_TYPE="Debug" ../mirall \
      -DCSYNC_LIBRARY_PATH=~/Desktop/owncloud-dev/buildcsync \
      ../mirall
make

The executables will be in the bin directory.

Build the Windows ownCloud Client

In the owncloud-dev folder, make a directory named win. First we need to build csync and generate Windows libraries.

cd win
mkdir buildcsync
cd buildcsync
mingw32-cmake -DCMAKE_BUILD_TYPE="Debug" -DWITH_LOG4C=OFF -DLOG_TO_CALLBACK=ON ../../csync
mingw32-make

Now we can build the ownCloud client:

cd ..
mkdir buildmirall
cd buildmirall

Make a file called docmake.sh with the following in it:

export QT_BINDIR=/usr/bin
export BIN_PRE=i686-w64-mingw32
/usr/bin/mingw32-cmake \
-DCMAKE_BUILD_TYPE="Debug" \
-DQMAKESPEC=win32-g++-cross \
-DQT_MKSPECS_DIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/share/qt4/mkspecs \
-DQT_INCLUDE_DIR=/usr/i686-w64-mingw32/sys-root/mingw/include \
-DQT_PLUGINS_DIR=/usr/i686-w64-mingw32/sys-root/mingw/lib/qt4/plugins \
-DQT_QMAKE_EXECUTABLE=${QT_BINDIR}/${BIN_PRE}-qmake \
-DQT_MOC_EXECUTABLE=${QT_BINDIR}/${BIN_PRE}-moc \
-DQT_RCC_EXECUTABLE=${QT_BINDIR}/${BIN_PRE}-rcc \
-DQT_UIC_EXECUTABLE=${QT_BINDIR}/${BIN_PRE}-uic \
-DQT_DBUSXML2CPP_EXECUTABLE=${QT_BINDIR}/qdbusxml2cpp \
-DQT_DBUSCPP2XML_EXECUTABLE=${QT_BINDIR}/qdbuscpp2xml \
-DQT_LRELEASE_EXECUTABLE=${QT_BINDIR}/${BIN_PRE}-lrelease \
-DWINDRES_EXECUTABLE=/usr/bin/${BIN_PRE}-windres \
-DCSYNC_LIBRARY_PATH=/home/administrator/Desktop/owncloud-dev/win/buildcsync \
../../mirall 

NOTE: The DCSYNC_LIBRARY_PATH parameter at the end needs to be updated to the absolute path to your win/buildcsync directory.

chmod +x docmake.sh
./docmake.sh
mingw32-make

You can also generate a NSIS setup package:

sudo mingw32-make package

It seems to copy some files over to /usr/... for some reason and needs root privileges for that.

@cvamca1147
Copy link

hello i encountered a problem in get csync operations pls help me

@guardezi
Copy link

guardezi commented Aug 5, 2014

Hello i have this erros when i trying windows cross compiling
can anyone help me?

/usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtGui/qopenglfunctions.h: In member function 'void QOpenGLFunctions::glVertexAttribPointer(GLuint, GLint, GLenum, GLboolean, GLsizei, const void_)':
/usr/i686-w64-mingw32/sys-root/mingw/include/qt5/QtGui/qopenglfunctions.h:1493:5: error: '::glVertexAttribPointer' has not been declared
::glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
^
make[2]: *_* [src/CMakeFiles/owncloudsync.dir/mirall/theme.cpp.obj] Error 1
make[2]: Leaving directory /home/guardezi/Desktop/owncloud-dev/win/buildmirall' make[1]: *** [src/CMakeFiles/owncloudsync.dir/all] Error 2 make[1]: Leaving directory/home/guardezi/Desktop/owncloud-dev/win/buildmirall'
make: *** [all] Error 2

@LePatay
Copy link

LePatay commented Oct 22, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment