Calligra/Building Calligra on Windows
These instructions are for the Windows operating systems.
- Building Krita on Windows, the easy way BuildKritaOnWindows
- Nightly Builds
- Developing With...
- Pages about compiling KDE software for Windows
- kde's git infrastructure manual
- KDE and Git for developers
- git crash course
Note: the 4.7 branch of emerge is no longer usable. Use the 4.8 or master branch. Those branches need Python 3.x. You also need 7za.exe instead of 7z.exe in the path.
- 1 Preparation
- 2 Build Calligra
- 3 Running Calligra applications
- 4 Updating the already built software
- 5 Executing unit tests
- 6 CMake Build Options
- 7 Resources
- 8 Possible issues
First you should have windows 7 or later installed. If you're a unix user and tired of install windows manually, here is a sample packer template for auto-unattend installation of Windows 7 SP1 x64 in virtualbox:
git clone https://github.com/philacs/calligra-windows-dev-env-setup.git cd calligra-windows-dev-env-setup
Windows 7 PROFESSIONAL in
scripts/Autounattend.xml to use your ProductKey and Edtion, replace
win7x64.json to the location of your windows 7 iso file.
kde folder will be copied to
C:/kde so put anything you want to copy there. Install packer following this link, make sure your computer connected to the Internet so it can download needed softwares, then
packer build win7x64.json
Virtualbox Appliance files will be generated under
output-virtualbox-iso folder, import the ovf file in virtualbox to use it.
If you don't use the packer.io builder provided, still download the git repo and copy
kde folder to
C:/ manually to continue next step.
Now download and install kde windows build dependencies. Run
C:/kde/install-kde-build-deps.bat, an application will be downloaded through IE and click "Run" in the upcoming dialog, then the install starts. The installation is automated including reboot handling, wait until everything finish.
Now use following script to install kde components needed to build calligra TODO
Before you begin, you will need to have a minimal set of software installed on your PC:
- Python 3.2 (x86, not 64-bit)
- Microsoft Windows SDK 7.1 (Windows 7 with .NET Framework 4)
First you will need to make sure that you have Git installed on your PC in order to be able to clone the KDE Windows emerge repository. Be sure to switch to the kde-4.8 branch.
git clone git://anongit.kde.org/emerge.git cd emerge git checkout kde-4.8 mkdir ..\etc copy kdesettings-example.bat ..\etc\kdesettings.bat
You will need to make the following changes to etc/kdesettings.bat:
- Update KDEROOT
- Set KDECOMPILER=msvc2010
- Update WINDOWSSDKDIR to point to your installation of the Windows SDK
- Set EMERGE_USE_SHORT_PATH=1
- Set PYTHONPATH (default assumes in Program Files)
- Set EMERGE_SOURCEONLY=True
One you have done this, you should navigate to the emerge directory and call
This sets up the development environment that you will need to use in order to build the KDE libraries, their dependencies and Calligra.
In order to install the bare minimum set up of KDE libraries, you will need to run a series of calls to emerge, which will take some time:
emerge qt emerge kdelibs emerge kde-runtime
Users familiar with development on Linux platforms may also wish to install another couple of libraries
emerge coreutils emerge grep
There are some additional optional libraries that can be used by Calligra, again emerge is used to install them:
emerge lcms2 emerge eigen2 emerge boost emerge okular (only needed to build a calligra plugin for okular) emerge exiv2 emerge soprano emerge librdf-src
Depending on your requirements, there are some additional libraries that may be useful
emerge libwpd // Wordperfect document support emerge libwpg // Wordperfect graphics support
Here is recommendation of a directory structure:
- KDE on Windows root directory
From your %USERPROFILE% directory (assuming you will be the only local user)
- source code
- directory that Calligra will be built in
- directory that Calligra will be installed in
The build directory is needed because you cannot build Calligra inside the source directory; the source and build directory have to be separated.
You can create this structure by opening a command prompt (cmd.exe) and typing:
cd %USERPROFILE% mkdir kde4 mkdir kde4\build mkdir kde4\build\calligra mkdir kde4\inst mkdir kde4\src
Getting the source code
As Windows support is still being improved, it is recommended that you use the development version. If you require stability, it is recommended that you take advantage of the nightly builds.
The latest development version of Calligra is 3.1.0 Alpha; developers always refer to it as to Master. Once tested and released, it will become the new current stable version 3.1.
To retrieve the source code from Git you have to use the following setup:
Add the following text to %USERPROFILE%\.gitconfig:
[url "git://anongit.kde.org/"] insteadOf = kde: [url "ssh://[email protected]/"] pushInsteadOf = kde: [core] autocrlf=false
$ git clone kde:calligra
By using the kde: prefix, read access will automatically happen over Git, and authenticated SSH is only required for pushes.
Note that pushing your changes will only work if you have a KDE developer identity (https://identity.kde.org/register.php).
This will create a 'calligra' subdirectory with the complete source tree.
From your home directory, navigate to the build\calliga subdirectory and execute cmake to configure the project for building with the following lines:
cd kde4\build\calligra # with versions <= 2.6 cmake -DCMAKE_INSTALL_PREFIX=..\..\inst ..\..\src\calligra -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -G "NMake Makefiles JOM" -DTINY=off -DBUILD_active=off -DBUILD_mobile=off -DBUILD_kexi=off # with versions >= 2.7 cmake -DCMAKE_INSTALL_PREFIX=..\..\inst ..\..\src\calligra -DCMAKE_BUILD_TYPE=%EMERGE_BUILDTYPE% -G "NMake Makefiles JOM" -DBUILD_kexi=off
Here we are telling cmake that:
- We want to install Calligra into ~/kde4/inst
- The source files are located at ~/kde4/src/calligra
- We are building to the same type (RelWithDebInfo / Debug) as used to build the Qt and KDE libraries, by reading the value of EMERGE_BUILDTYPE
- We are selectively disabling some portions of the build with the -DBUILD_xxxx=on|off commands. 'active' and 'mobile' are not applicable to the desktop build, while flow and kexi (at the time of writing) were still undergoing testing on the platform.
Then, to build Calligra, type:
This will take a while, once it has completed, type this command to install the software:
Please follow the Running Calligra Applications instructions before trying to run an application.
Running Calligra applications
There are two options to make the Calligra applications available for running.
- Option 1: Being able to run Calligra applications from the command line. If you have installed Calligra in a different prefix than KDElibs (which was recommended in this document), you may want to set the following environment variable:
set KDEDIRS=\path\to\install;%KDEDIRS% set PATH=\path\to\install\bin;%PATH% set KDEHOME=\path\to\a\config\dir
And then you need to execute:
For example for the recommended directory structure:
set KDEDIRS=%USERPROFILE%\kde4\inst;%KDEDIRS% set PATH=%USERPROFILE%\kde4\inst\bin;%PATH% set KDEHOME=%USERPROFILE%\kde4\.kde
Here we are setting KDEHOME to be saved
- Option 2: Being able to run Calligra applications from the menu or by clicking on desktop icons. Instead of using KDEDIRS, you can add these lines to $HOME/.kde/share/config/kdeglobals file using text editor:
And then you need to execute:
update-mime-database %KDEROOT%\share\mime kbuildsycoca4 --noincremental
The advantage of this is that KDE4 will always look for the services where Calligra is installed.
Updating the already built software
If the source code has been checked out, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.
cd %USERPROFILE%\kde4\src\calligra git pull --rebase cd %USERPROFILE%\kde4\build\calligra jom jom install
Executing unit tests
To be able to execute unit tests, you need to explicitely enable them in the build configuration. To do so, set the KDE4_BUILD_TESTS variable to "ON", either by issuing the command in the build directory:
cd $HOME/kde4/build/calligra cmake -DKDE4_BUILD_TESTS=ON .
Or you can run cmake-gui in the buld directory and set KDE4_BUILD_TESTS to "on".
It is then recommended that before running the tests, you first execute
You can then run the test by executing:
or individually in the tests directories.
CMake Build Options
When you enter your build directory, you can type "cmake-gui ." to see many build options, e.g. you can turn off compilation of apps you don't want - you can save time when compiling.
Here is list for Krita related options:
- HAVE_MEMORY_LEAK_TRACKER [On/Off] - You can turn on compilation of the tool in krita which detects memory leak. If you want to help debug Krita memory usage, it is useful. Otherwise you just slow down your Krita.
- HAVE_BACKTRACE_SUPPORT [On/Off] - It is related to the memory leak tool. If you activate, you will be able to see code path which leads to memory leak.
- Useful hints for who wants to hack on Calligra
- opengtl debugging, or turning it off
- Status of Calligra build on Windows (msvc 2008, mingw)
Calligra apps don't start
If the Calligra applications do not start properly, or you see the window flash up then disappear, then you need to check the Running Calligra Applications section earlier and make sure you've run update-mime-database and kbuildsycoca4.
You can get some additional insight by installing DebugView, which will let you see warnings and error messages reported by the programs. This is available on Microsoft Technet.
The sources for the WIX-based installer for Calligra on Windows are at https://gitorious.org/calligra-installer-for-windows