Build script fails to build nextcloud client on Windows 10 - Qt 5.15.2
Hello Everyone,
It seems the current release is missing some important packages or it may lack some critical undocument steps.
Here is my enviroment versions:
- Windows 10 64bit
- Qt 5.15.2 both 32 and 64 bit
- Visual Studio 2019 both 32 and 64 bit
Steps to resolve some errors:
- Install doxygen-1.9.5 since it's is required by build.bat but undocument
- WIX variable is required example fix "export WIX="C:\Nextcloud\tools\wix""
- WiX headers are required and fixed by adding to
C:\Nextcloud\client-buildingdesktop\CMakeLists.txt:
set(INCLUDE_DIR "C:/Nextcloud/tools/wix/sdk/inc")
include_directories (${INCLUDE_DIR})
- Latest inkspace is required and fixed by installing `inkscape-1.2.1.msi'
- The last required component is KDE archive
F5Archiveand error is :
CMake Error at src/gui/CMakeLists.txt:3 (find_package):
Could not find a configuration file for package "KF5Archive" that is
compatible with requested version "".
The following configuration files were considered but not accepted:
C:/CraftRoot/lib/cmake/KF5Archive/KF5ArchiveConfig.cmake, version: 5.98.0 (64bit)
-- Configuring incomplete, errors occurred!
See also "C:/Nextcloud/client-building/desktop/build/CMakeFiles/CMakeOutput.log".
See also "C:/Nextcloud/client-building/desktop/build/CMakeFiles/CMakeError.log".
"*** Build FAILED: desktop Release Win32 (single-build-desktop.bat)"
I tried to compile F5Archive from source and tried using Craft binaries. Both ways results to the same thing Could not find a configuration file for package "KF5Archive .
I compiled F5archive with the follwoing steps from Qt website:
Building extra-cmake-modules
- Install CMake for windows (http://www.cmake.org/) and remember to put it on path enviroment variable
- git clone https://github.com/KDE/extra-cmake-modules.git
- In extra-cmake-modules, use (x64 Native Tools Command Prompt for VS 2019)
- mkdir build && cd build
- cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=C:\kderoot; -DCMAKE_PREFIX_PATH=C:\Qt\5.15.2\msvc2019_64
- nmake install
Building karchive
- git clone kArchive https://github.com/KDE/karchive.git
- download Zlib from http://www.winimage.com/zLibDll/zlib123dllx64.zip in path-to-karchive\zlib\lib folder
- download https://zlib.net/zlib-1.2.12.tar.xz and put all headers in path-to-karchive\zlib\include folder
- In kArchive directory: mkdir build && cd build
- use (x64 Native Tools Command Prompt for VS 2019)
- cmake .. -G “NMake Makefiles” -DCMAKE_INSTALL_PREFIX=C:\kderoot -DCMAKE_BUILD_TYPE=release -DCMAKE_PREFIX_PATH=C:\kderoot;C:\Qt\5.15.2\msvc2019_64;C:\Nextcloud\tools\karchive\karchive\karchive\zlib
- nmake install
Any idea on how to fix karchive issue ?
Best
I relized that karchive is only required in the master branch in C:\Nextcloud\client-building\desktop\src\gui\CMakeLists.txt . I switched to 3.6 stable and recompile is in a progress.
@myomv100 If you want to build master on Windows, then just clone, build and install these (in order):
- https://github.com/KDE/extra-cmake-modules
- https://github.com/KDE/karchive
This is what I did as I mentioned earlier. I get Could not find a configuration file for package "KF5Archive whenever I build the master.
I switched to desktop release 3.6 and the problem went away since karchive is not required for stable-3.6. I needed to disbable PULL and Checkout in the build scripts.
@allexzander how to install?
Very helpful issue, thanks, I was stuck with karchive missing (I still am, but at least I know where to look forward)
I managed to build extra-cmake-modules, but karchive wants qt6 for some reason... Pretty-please consider updating the readme on the master branch, including ALL dependencies like inkscape, extra-cmake-modules, and up-to-date build instructions, as this is not a "pain-free" process any more (contrary to what is advertised in the readme).
Same encountered, rollback to stable-3.6 and solved, look forward to the document update about karchive issue.
@allexzander how to install?
I suggest checking CMake documentation, or, referring to this thread https://stackoverflow.com/questions/48428647/how-to-use-cmake-to-install
For those who may still face issues building either from master or stable-3.7 on wards can apply these steps to get a working app.
Let's start from the beginning. Until 3.6, if you have all the apps and libs downloaded following the README.md, everything should work. But not from 3.7 and above or master.
I know it is a pain and a serious one. So after two days of building/fixing/researching I have finally build the app from 3.8 branch and master. The steps I am going to share are not maybe pretty and easy, but hey it works at the end.
As @myomv100 mentioned the steps to build KArchive, that may work until you get LINK errors for KF5::Archive-NOTFOUND. So what now?
The biggest issue here is a proper KF5Archive files and build. So here are the ugly steps to make it work.
Note: you don't need to build ECM and karchive following the steps above anymore.
- I will not go to the basics, I assume you already have followed the README.md to get all the things installed and pulled.
- Install and build Craft from KDE. https://community.kde.org/Get_Involved/development/Windows 2.1 It is quite easy to build actually. 2.2 You may already have Python, power shell and Visual studio. If not just install them as stated in the how-to.
- Once you have setup Craft, in the power shell, install karchive with
craft karchive. https://community.kde.org/Craft#Searching_for_a_package 3.1 You can search a package withcraft --search karchive3.2 That's it. But if you need any other package just install with the craft command. - This is the important part. Open
client-building/desktop/CMakeLists.txtand addset( KF5Archive_DIR ${CMAKE_SOURCE_DIR}/../../../../../CraftRoot/lib/cmake/KF5Archive ). RememberCraftRootis the directory where Craft is installed. - Next create a directory named
dllanywhere, I created it insideNextcloud/tools/dllfor ease. 5.1 Go toCraftRoot/binand copy these dll files to the dll directory you created above.KF5Archive.dll,libbzip2.dll,liblzma.dll,zlib1.dll,zstd.dll. 5.2 Copy the data directory too fromCraftRoot/bin, Remove everything from it exceptlocaleandqlogging-categories5. 5.3 We are done here. - Open
client-building/single-build-installer-collect.bat, and change the KArchive copy source location. It may be look like thisC:/Program Files (x86)/ECM/bin/. Change this to thedlldirectory location, e.g:C:/Nextcloud/tools/dll/. 6.1- You can find KArchive line around 182/183 or just search for KArchive. 6.2- That's it.
Go ahead and hit that Enter button on ./build.bat. Good luck
For those who may still face issues building either from
masterorstable-3.7on wards can apply these steps to get a working app.Let's start from the beginning. Until
3.6, if you have all the apps and libs downloaded following theREADME.md, everything should work. But not from3.7and above ormaster.I know it is a pain and a serious one. So after two days of building/fixing/researching I have finally build the app from
3.8branch andmaster. The steps I am going to share are not maybe pretty and easy, but hey it works at the end.As @myomv100 mentioned the steps to build KArchive, that may work until you get LINK errors for
KF5::Archive-NOTFOUND. So what now?The biggest issue here is a proper KF5Archive files and build. So here are the ugly steps to make it work.
Note: you don't need to build ECM and karchive following the steps above anymore.
- I will not go to the basics, I assume you already have followed the README.md to get all the things installed and pulled.
- Install and build Craft from KDE. https://community.kde.org/Get_Involved/development/Windows 2.1 It is quite easy to build actually. 2.2 You may already have Python, power shell and Visual studio. If not just install them as stated in the how-to.
- Once you have setup Craft, in the power shell, install karchive with
craft karchive. https://community.kde.org/Craft#Searching_for_a_package 3.1 You can search a package withcraft --search karchive3.2 That's it. But if you need any other package just install with the craft command.- This is the important part. Open
client-building/desktop/CMakeLists.txtand addset( KF5Archive_DIR ${CMAKE_SOURCE_DIR}/../../../../../CraftRoot/lib/cmake/KF5Archive ). RememberCraftRootis the directory where Craft is installed.- Next create a directory named
dllanywhere, I created it insideNextcloud/tools/dllfor ease. 5.1 Go toCraftRoot/binand copy these dll files to the dll directory you created above.KF5Archive.dll,libbzip2.dll,liblzma.dll,zlib1.dll,zstd.dll. 5.2 Copy the data directory too fromCraftRoot/bin, Remove everything from it exceptlocaleandqlogging-categories5. 5.3 We are done here.- Open
client-building/single-build-installer-collect.bat, and change the KArchive copy source location. It may be look like thisC:/Program Files (x86)/ECM/bin/. Change this to thedlldirectory location, e.g:C:/Nextcloud/tools/dll/. 6.1- You can find KArchive line around 182/183 or just search for KArchive. 6.2- That's it.Go ahead and hit that Enter button on
./build.bat. Good luck
Why does my craft karchive command say Craft was unable to find karchive