Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build script fails to build nextcloud client on Windows 10 - Qt 5.15.2 #107

Open
myomv100 opened this issue Sep 13, 2022 · 9 comments
Open

Comments

@myomv100
Copy link

myomv100 commented Sep 13, 2022

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 F5Archive and 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

Any idea on how to fix karchive issue ?

Best

@myomv100
Copy link
Author

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.

@allexzander
Copy link
Contributor

@myomv100 If you want to build master on Windows, then just clone, build and install these (in order):

  1. https://github.com/KDE/extra-cmake-modules
  2. https://github.com/KDE/karchive

@myomv100
Copy link
Author

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.

@vectorez
Copy link

@allexzander how to install?

@retnag
Copy link

retnag commented Mar 12, 2023

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).

@593749519
Copy link

Same encountered, rollback to stable-3.6 and solved, look forward to the document update about karchive issue.

@allexzander
Copy link
Contributor

@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

@mmarif4u
Copy link

mmarif4u commented May 4, 2023

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.

  1. I will not go to the basics, I assume you already have followed the README.md to get all the things installed and pulled.
  2. 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.
  3. 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 with craft --search karchive
    3.2 That's it. But if you need any other package just install with the craft command.
  4. This is the important part. Open client-building/desktop/CMakeLists.txt and add set( KF5Archive_DIR ${CMAKE_SOURCE_DIR}/../../../../../CraftRoot/lib/cmake/KF5Archive ). Remember CraftRoot is the directory where Craft is installed.
  5. Next create a directory named dll anywhere, I created it inside Nextcloud/tools/dll for ease.
    5.1 Go to CraftRoot/bin and 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 from CraftRoot/bin, Remove everything from it except locale and qlogging-categories5.
    5.3 We are done here.
  6. Open client-building/single-build-installer-collect.bat, and change the KArchive copy source location. It may be look like this C:/Program Files (x86)/ECM/bin/. Change this to the dll directory 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

@CCC193
Copy link

CCC193 commented May 8, 2023

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.

  1. I will not go to the basics, I assume you already have followed the README.md to get all the things installed and pulled.
  2. 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.
  3. 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 with craft --search karchive
    3.2 That's it. But if you need any other package just install with the craft command.
  4. This is the important part. Open client-building/desktop/CMakeLists.txt and add set( KF5Archive_DIR ${CMAKE_SOURCE_DIR}/../../../../../CraftRoot/lib/cmake/KF5Archive ). Remember CraftRoot is the directory where Craft is installed.
  5. Next create a directory named dll anywhere, I created it inside Nextcloud/tools/dll for ease.
    5.1 Go to CraftRoot/bin and 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 from CraftRoot/bin, Remove everything from it except locale and qlogging-categories5.
    5.3 We are done here.
  6. Open client-building/single-build-installer-collect.bat, and change the KArchive copy source location. It may be look like this C:/Program Files (x86)/ECM/bin/. Change this to the dll directory 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants