Nextcloud Desktop-Client build procedure

泪湿孤枕 提交于 2019-12-13 03:13:49

问题


Good day everybody.

I used this instructions from Git on how to build the nextcloud client: https://github.com/nextcloud/desktop/wiki/How-to-compile-the-desktop-client

I want to explain what I did and what tried to get the nextcloud client running:

  1. I created a new virtual machine with Windows 10 to get clean environment for my tests

Installing Qt

  1. I downloaded the Qt installer from https://www.qt.io/download-qt-installer?hsCtaTracking=9f6a2170-a938-42df-a8e2-a9f0b1d6cdce%7C6cb0de4f-9bb5-4778-ab02-bfb62735f3e5
  2. In the Qt Setup Wizard I selected Qt 5.11.0 and MinGW 4.9.1 to install.
  3. To my PATH variable I added C:\...\Qt\5.11.0

CMake

  1. I downloaded the Windows win64-x64 Installer from https://cmake.org/download/ and installed it
  2. To my PATH variable I added C:\...\Cmake\bin

Zlib

  1. I downloaded the 64 bit release from https://github.com/maxirmx/Dist_zlib and unzipped the folder
  2. To my PATH variable I added C:\...\Zlib\bin and C:\...\Zlib\lib

QtKeychain

  1. I cloned the repository from https://github.com/frankosterfeld/qtkeychain.git build it and got three files: qt5keychain.dll, qt5keychain.exp, qt5keychain.lib
  2. To my PATH variable I added C:\...\QtKeychain\Release which contains these three files

OpenSSL

  1. The link to the index of OpenSLL provided at https://github.com/nextcloud/desktop/wiki/System-requirements-for-compiling-the-desktop-client does not provide any OpenSSL 1.1.x version. The newest one provided is 1.0.2. So I searched a bit and I downloaded Win64 OpenSSL v1.1.0i from https://slproweb.com/products/Win32OpenSSL.html.
  2. To my PATH variable I added C:\...\OpenSSL-Win64\bin which contains openssl.exe, libcrypto-1_1-x64.dll, openssl.cfg and so on

Git

  1. I downloaded the Git installer from https://git-scm.com/downloads and made no changes in the installer and installed it

Visual Studio

  1. I installed a VS 2017 Community Edition with the C++ package and the following additional components: Visual C++ Tools for CMake Windows 10 SDK for UWP C++ (not sure if that is all)

Creating the nextcloud poject files

  1. In Git Bash I navigated to /c/.../nextcloud/desktop/
  2. I run: 'mkdir build'
  3. Navigated to /c/.../nextcloud/desktop/cmake\ and run:
    cmake -G "Visual Studio 15 2017 Win64" .. -DCMAKE_INSTALL_PREFIX=/c/.../nextcloud/desktop/build/ -DQTKEYCHAIN_INCLUDE_DIR=/c/QTKeychain/Release/ -DCMAKE_BUILD_TYPE=Debug -DNO_SHIBBOLETH=1
  4. Done (no errors)

Build the nextcloud client

  1. In /c/.../nextcloud/desktop/cmake I run:
    cmake --build . --config Debug --target nextcloud

  2. Got the error that file clientsideencryption.cpp and httpcredentials.cpp cannot find keychain.h and qkeychain_export.h, so I copied these two files (and keychain.cpp) from the QtKeychain repository to where the files are localed under desktop/src/libsync and the errors don't occour anymore

  3. Run 19. again and now I got over 50 errors like:

    clientsideencryption.obj : error LNK2019: Unresolved external symbol "BIO_read" referenced in function ""class QByteArray __cdecl OCC::'anonymous namespace'::BIO2ByteArray(struct bio_st *)" (?BIO2ByteArray@?A0xd4adced4@OCC@@ya?AVQByteArray@@PEAUbio_st@@@z)". [C:\Nextcloud_64\desktop\cmake\src\libsync\nextcloudsync.vcxproj]

    clientsideencryption.obj : error LNK2019: Unresolved external symbol "BIO_write" referenced in function ""class QByteArray __cdecl OCC::EncryptionHelper::privateKeyToPem(class QSslKey)" (?privateKeyToPem@EncryptionHelper@OCC@@ya?AVQByteArray@@VQSslKey@@@z)". [C:\Nextcloud_64\desktop\cmake\src\libsync\nextcloudsync.vcxproj]

I am not sure if this problem comes form OpenSLL or QtKeychain. Do I something missed copying or connect somehow?

Can anyone tell if hat is right what I am doing and if there is any way to get the client build?

Thank you very much in advance


回答1:


An issue on GitHub just lead me to the question here. In case anyone is trying the same, I'd like to add some hints:

We now have an official repository with build scripts for Windows, used to create the daily builds and also for our release builds:

https://github.com/nextcloud/client-building/

If you don't want build for Windows you may get some useful hints there ;-)

Regarding Windows: Good tip @mn_dc466 :) Once you first manage to build the client, just open the Visual Studio solution file in the build folder and you can rebuild and debug with your modifications without having to completely rebuild the whole project.



来源:https://stackoverflow.com/questions/51949473/nextcloud-desktop-client-build-procedure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!