Bug 342481

Summary: Provide Build Instructions for Windows
Product: [Applications] digikam Reporter: Claudius <kde.bugs>
Component: Bundle-WindowsAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: anantapalani, caulier.gilles, piter.dias
Priority: NOR    
Version: 4.7.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 5.0.0
Sentry Crash Report:

Description Claudius 2015-01-04 12:39:34 UTC
I am trying (again) to build my own digikam binary from sources. My last attempt (#340286) failed because of outdated instructions. I'm having not much more luck this time. I would like to request more detailed build instructions than what's on this page: https://www.digikam.org/download/tarball

I tried Downloading the tarball and executing `bootstrap.msvc.bat`. Here is what failed so far and that should be in some kind of "HowTo".

* It failed for the lack of *cmake* (which is normal on a fresh windows install), so i installed that from http://www.cmake.org/.
* It then didn't find *KDE* (which i gathered from reading the .bat file, which is not part of windows). I installed it from https://windows.kde.org/ (4.10.2 in my case)
* It then complained that there's no *compiler* (which is also not available by default on windows). I installed the Visual Studio Community Edition 2013, available here: http://www.visualstudio.com/downloads/download-visual-studio-vs

Now it complains about missing *kde4-config* - and i can't find how i would get that? It's not available in the KDE (expert mode) installer. I can't locate a binary or something similar for windows.

Can anyone help me get started developing Digikam?



Reproducible: Always




(i view "build system broken" (or undocumented) as a major flaw in an open source project, hence i categorized it as major.)
Comment 1 Claudius 2015-01-16 20:15:34 UTC
I really wish, i could contribute to this project. I would take vague pointers, if there were any. Right now, i'm just stuck.
Comment 2 Claudius 2015-01-30 22:07:49 UTC
I'm going to keep bumping this (roughly) every two weeks.
Comment 3 Piter Dias 2015-02-07 15:18:53 UTC
Have you tried emerge as explained at https://techbase.kde.org/Getting_Started/Build/KDE4/Windows/emerge?
Also I would downgrade the compiler in one or two versions, just in case.
Try to figure out which KDE version digiKam for Linux is really compiled against before installing emerge.

I tried this a while ago but gave up when digiKam 4.5 was released. The porting from Linux to Windows (and vice-versa) is a pain (mainly when C/C++ code is used) and I can't blame the maintainers. A lot of packages do the same, like Darktable that I use in a under powered Linux box over network, for example, because there is no Windows version.
Comment 4 Claudius 2015-02-07 15:47:43 UTC
I did not know about emerge. I'll give it a try, thanks!
Comment 5 Piter Dias 2015-02-08 20:25:26 UTC
I just checked my digiKam 4.5 install and I can confirm that it is using Visual C++ 2010. It is worth a VC++ downgrade to try building in a environment digiKam maintainers also use.

If I happen to know the exactly KDE version I post as well.
Comment 6 Piter Dias 2015-02-08 20:29:33 UTC
There it is KDE 4.10.2.

C:\Program Files\digiKam\bin>kded4.exe -version

C:\Program Files\digiKam\bin>Qt: 4.8.4
KDE Development Platform: 4.10.2
KDE Daemon: $Id$
Comment 7 Claudius 2015-02-13 22:58:07 UTC
I just spent 2 hours with kde / emerge. I got to a point where it produced readable error messages (meaning: i went into their powershell and python code to find out what went wrong for long stretches of this task).

Here's a list of things i tried until i got there (in case anyone else tries this on windows):

* before doing the `. .\kdeenv.ps1` you need to allow script execution (d'uh). Be advised that this is a potential security risk. Run this from an elevated powershell: `Set-ExecutionPolicy Unrestricted`
* emerg.bat does not use the python that's configured in etc\kdesettings.ini (make sure the right one is on your path, even though the readme explicitly claims, emerg would take care of that). This may be related to the next point, though.
* kdeenv.ps1:182 tries to get the "PYTHONPATH" from the settings (ini), but that is not actually in there. Nicely enough, there is even a TODO tag nearby (line 181) informing me that this can't actually work.
* the required "subst"s (long paths made into drive letters) didn't set up correctly on my system. I simply set those up by hand to match the tiny table kdeenv outputs for reference.

After fixing these, i now get an error with the digest of putty. I'm not yet sure if i will continue this ordeal, though.

(Line numbers refer to the current state of branch kde-4.10, which is commit 1ce6a19c)
Comment 8 Claudius 2015-02-14 00:19:29 UTC
i can run the `emerge qt` over and over again, and each time another package will throw an error. After enough runs, it has settled on jom (digest), mysql (digest), ActivePerl(404), putty (digest) ... also, this seems fairly random. Not as if there was a specific order of things.
Comment 9 caulier.gilles 2015-03-26 06:56:54 UTC
Note : 

digiKam 4.7.0 for Windows is available :

http://download.kde.org/stable/digikam/digiKam-installer-4.7.0-1-win32.exe.mirrorlist

Gilles Caulier
Comment 10 caulier.gilles 2015-03-26 06:57:46 UTC
Ananta,

Perhaps you can provide the instruction the build windows installer somewhere on KDE Wiki ?

Gilles Caulier
Comment 11 Claudius 2015-03-28 09:13:31 UTC
Thank you for the heads up! I haven't given up hope yet ;-)

I guess most people are pushing for the 5.0 version, and that is great. Maybe this will get some attention in the second half of 2015. I think it's likely that the build system for 5.0 will have to look at least somewhat different, so I'd rather wait for those than have 4.x instructions.
Comment 12 caulier.gilles 2015-07-06 07:37:50 UTC
digiKam 4.11.0 Windows installer is available for download :

http://download.kde.org/stable/digikam/digiKam-installer-4.11.0-win32.exe.mirrorlist
Comment 13 caulier.gilles 2016-05-28 17:15:50 UTC
The Windows build workflow is now fully not dependent of Windows operating system.

Thant to cross-compiler and MXE project (http://mxe.cc/) to facilitate the whole dependencies, the core implementation, all KDE framework, and the NSIS installer, to be compilable as well under Linux !

All instructions are simple and 90% automatized here :

https://quickgit.kde.org/?p=digikam-software-compilation.git&a=blob&f=project%2Fmxe%2FREADME

With next digiKam 5.0.0, we will provide a Windows version fully cross-compiled

https://www.flickr.com/photos/digikam/27033685570/in/dateposted-public/

The Windows installer is available here to test :

https://drive.google.com/open?id=0B7yq-xFihT0_SzhxVzF1RDhPbFE

Gilles Caulier
Comment 14 Claudius 2016-05-29 21:33:05 UTC
To clarify: does it mean digikam can _only_ be cross-compiled? If so, it would be nice to make this very clear at the beginning of the build instructions. Novices might need a while to figure this out.

The installer just ran, and digikam 5 seems to be running on my machine (win 10, 64 bit, 32 bit installer). Thanks for making this possible!
Comment 15 caulier.gilles 2016-05-30 10:45:23 UTC
No, native windows building is possible but is just a BIG PAIN.

Cross compiling is easy to do and do not require Windows to build executable/dlls and also the NSIS installer. Yes, all can be done on Linux as well.

Gilles Caulier