Jump to content

KDEConnect/Build Windows: Difference between revisions

From KDE Community Wiki
Brute4s99 (talk | contribs)
No edit summary
Brute4s99 (talk | contribs)
No edit summary
Line 36: Line 36:




=== 0.3 Installing Craft ===
=== 0.X Installing Craft ===


1. Call the following commands in a Powershell window with ''Administrator Privileges''
1. Call the following commands in a Powershell window with ''Administrator Privileges''
Line 90: Line 90:




== X. BUILDING A SHARE-ABLE INSTALLER ==
== 3. BUILDING A SHARE-ABLE INSTALLER ==
 
Choose your package of choice:-
<p align = "center"> [https://community.kde.org/KDEConnect/Build_Windows#3.1_creating_a_desktop_application_.exe_setup '''.EXE Setup'''] (full-support) | [https://community.kde.org/KDEConnect/Build_Windows#3.2_creating_a_Windows_App_.Appx_package '''.Appx package for Windows Store'''] (partial support) </p>
 
 
 
=== 3.1 creating a desktop application <code>.exe</code> setup ===
 
0. Make sure PackageType is set as <code>PackageType = NullsoftInstallerPackager</code> in <code>CraftRoot/etc/CraftSettings.ini</code>.


1. To create an installable setup, you need [https://sourceforge.net/projects/nsis/ '''NSIS- a open source system to create Windows installers''']. Install it by this command: <code>craft nsis</code>  
1. To create an installable setup, you need [https://sourceforge.net/projects/nsis/ '''NSIS- a open source system to create Windows installers''']. Install it by this command: <code>craft nsis</code>  
Line 98: Line 107:




2. Now you can use the <code>--package</code> flag to build an installable '''.EXE''' out of latest source code available [https://invent.kde.org/kde/kdeconnect-kde here]. The command should look like this: <code>craft --package extragear/kdeconnect-kde</code>
=== 3.2 creating a Windows App <code>.Appx</code> package ===


Note the output file here:
0. Make sure PackageType is set as <code>PackageType = AppxPackager</code> in <code>CraftRoot/etc/CraftSettings.ini</code>.
 
=== 3.X Packaging through Craft ===
 
1. Now you can use the <code>--package</code> flag to build an installer. Run this in '''Craft CraftRoot'''.
<pre>
craft --package extragear/kdeconnect-kde
</pre>


<code>Output: &quot;C:\CraftRoot\tmp\kdeconnect-kde-master-86e5cd48-windows-msvc2017_64-cl.exe&quot;</code>
'''Note''': The output files are saved here: <code>C:\CraftRoot\tmp\</code>




Be sure to tell us if you got stuck somewhere in the process of setting up the developer environment. You can [mailto:[email protected] mail us.] Yes we read the mails! 😜
Be sure to tell us if you got stuck somewhere in the process of setting up the developer environment. You can [mailto:[email protected] mail us.] Yes we read the mails! 😜

Revision as of 16:34, 30 August 2019

NOTE: This tutorial assumes Craft is being installed in C:/ [default]

0. SETTING UP ENVIRONMENT

The environment for KDE Connect on Windows simply consists of two parts- A compiler of choice and a build system. While we do have a couple of options for the compiler, our recommended build system is Craft. While this is an all-in-one build guide, you should definitely refer to Craft's documentation for further information on using the build system in your development environment!

Choose your compiler of choice:-

MSVC (full-support) | MinGW-w64 (partial support)

0.1 Installing MSVC

1. Install Visual Studio 2019 (Community) from here and select Desktop development with C++.

2. Install these packages.

Select these components

    • Just-in-Time debugger
    • VC++ 2019 version
    • C++ profiling tools
    • Windows 10 SDK
    • Visual C++ tools for CMake
    • Visual C++ ATL for x86 and x64
    • Test Adapter for Boost.Test
    • Test Adapter for Google Test

0.2 Installing MinGW-w64

1. Install MinGW-w64 through the GUI installer located here.

2. While installing Craft, feel free to select Mingw-w64 as your compiler!

Afterwards, there is no difference in the commands used in the development. Note that due to the lacking of some definitions in MinGW provided header file, some plugins could not be compiled with all functions on Windows using MinGW.

This is still an experimental feature, and you might need some developer know-how to get past any build problems.


0.X Installing Craft

1. Call the following commands in a Powershell window with Administrator Privileges


Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/KDE/craft/master/setup/install_craft.


2. During command 2, select the default (Visual Studio 17 if you chose MSVC earlier, otherwise Mingw-w64) as your compiler.

INSTALLATION 1

Select compiler
[0] Mingw-w64, [1] Microsoft Visual Studio 2017, [2] Microsoft Visual Studio 2019 (default is Microsoft Visual Studio 2017): 1
Select architecture
[0] x86 [1] x64 (Default is x64): 1


3. When installation is done, note the Environment variables to match the ones in top of this image:-

env vars

[Environment]
PATH=

Craft                : C:\CraftRoot
Version              : master
ABI                  : windows-msvc2017_64-c1
Download directory   : C:\CraftRoot\download


1. BUILDING KDE CONNECT OUT OF LATEST SOURCE CODE

Craft has automated most of the redundant parts of the build process and exposed just the really useful parameters like which version to build, where to install et al.

1. Open Craft CraftRoot from search (in taskbar).

2. Run the following commands now.


REM First, we set the version of kdeconnect-kde to be installed to the master branch.
craft --set version=master kdeconnect-kde  
REM Now we install kdeconnect-kde within CraftRoot.
craft -i kdeconnect-kde 


3. BUILDING A SHARE-ABLE INSTALLER

Choose your package of choice:-

.EXE Setup (full-support) | .Appx package for Windows Store (partial support)


3.1 creating a desktop application .exe setup

0. Make sure PackageType is set as PackageType = NullsoftInstallerPackager in CraftRoot/etc/CraftSettings.ini.

1. To create an installable setup, you need NSIS- a open source system to create Windows installers. Install it by this command: craft nsis


install NSIS


3.2 creating a Windows App .Appx package

0. Make sure PackageType is set as PackageType = AppxPackager in CraftRoot/etc/CraftSettings.ini.

3.X Packaging through Craft

1. Now you can use the --package flag to build an installer. Run this in Craft CraftRoot.

craft --package extragear/kdeconnect-kde

Note: The output files are saved here: C:\CraftRoot\tmp\


Be sure to tell us if you got stuck somewhere in the process of setting up the developer environment. You can mail us. Yes we read the mails! 😜