1
00:00:00,017 --> 00:00:06,297
To us about why and how to use KDE frameworks in non-KDE apps. Take a look. All right.

2
00:00:11,597 --> 00:00:17,777
Hello, I'm Javier. And one second, let me push this mic a little bit better over here.

3
00:00:20,997 --> 00:00:22,297
Testing, testing, mic check.

4
00:00:26,957 --> 00:00:30,637
All right. Right, so I'm going to be giving this presentation,

5
00:00:30,977 --> 00:00:34,757
Why and How to Use KDE Frameworks in Non-KDE Apps.

6
00:00:35,897 --> 00:00:42,397
Who's this for? Well, this is for the canonicus Linux programator futurum,

7
00:00:42,397 --> 00:00:47,977
or the Linux developer of the future, and for the peritus fanaticus codex elite,

8
00:00:48,157 --> 00:00:51,177
that professional in the lookout for cool libraries.

9
00:00:53,297 --> 00:01:00,217
By the end of this talk, you'll have learned how about KDE frameworks the KDE community has to offer.

10
00:01:00,877 --> 00:01:05,377
You'll be able to use KDE frameworks in your own projects and you'll have some

11
00:01:05,377 --> 00:01:10,037
guidance on how to make apps that you can distribute using these frameworks.

12
00:01:11,597 --> 00:01:15,397
Who am I? I'm a software engineer at KDAB. My name is Javier.

13
00:01:15,557 --> 00:01:20,817
I have background in computer science and mass media communications and I develop

14
00:01:20,817 --> 00:01:22,777
an application called QPrompt.

15
00:01:22,877 --> 00:01:27,577
It's a teleprompter app used in mass media communications and it's made using

16
00:01:27,577 --> 00:01:29,697
Kirigami and other KDE frameworks.

17
00:01:31,817 --> 00:01:38,357
So, about the frameworks. These are a collection of libraries and add-ons that

18
00:01:38,357 --> 00:01:45,357
you can essentially use them to program with Qt and make your experience better, add more features.

19
00:01:45,737 --> 00:01:49,357
They're made primarily to satisfy the needs of the KDE community,

20
00:01:49,777 --> 00:01:52,937
but you're welcome and free to use them.

21
00:01:54,177 --> 00:01:59,997
Let's see these frameworks in action first, but let's see them in action in

22
00:01:59,997 --> 00:02:02,397
applications that are not KDE's.

23
00:02:02,657 --> 00:02:08,577
Here we have one that needs no introduction. This is Qt Creator and it's using K syntax highlighting

24
00:02:08,837 --> 00:02:12,417
for its syntax highlighting this

25
00:02:12,417 --> 00:02:15,597
one is subsurface it's a

26
00:02:15,597 --> 00:02:23,477
application that linux linux storables created it has a mobile user interface

27
00:02:23,477 --> 00:02:29,697
that works on kirigami works on ios and android and it has a desktop user interface

28
00:02:29,697 --> 00:02:33,737
that one is made with cute widgets It's they share a common backend.

29
00:02:34,797 --> 00:02:40,897
This is QPrompt, my application. I'm using Kirigami, K-Crash,

30
00:02:40,937 --> 00:02:42,457
K-Icon themes, and Breeze icons.

31
00:02:42,797 --> 00:02:46,837
My goal with choosing Kirigami was to make a native Linux app.

32
00:02:47,897 --> 00:02:53,537
This is Comics Reader, a random app I found on GitHub, and it's also using Kirigami.

33
00:02:55,682 --> 00:02:58,622
And this is Astra, developed by my colleague Joshua.

34
00:02:59,202 --> 00:03:08,742
He chose Kirigami because he felt like it was... I forgot the exact words on Riff, I'm sorry.

35
00:03:09,162 --> 00:03:16,982
It essentially helps him do with QML the things that you can't do with QML alone.

36
00:03:17,162 --> 00:03:19,362
I'm sorry, that was very butchered, but anyways.

37
00:03:20,342 --> 00:03:26,402
And he's also using KConfig and KArchive. KConfig is essentially a library that

38
00:03:26,402 --> 00:03:31,662
will allow you to have settings in a structured manner.

39
00:03:32,062 --> 00:03:35,002
So it's like QSettings, but on steroids.

40
00:03:35,922 --> 00:03:38,722
And the KArchive allows compressing and decompressing files.

41
00:03:41,102 --> 00:03:47,542
Here we have, this is how the KDE community organizes the frameworks.

42
00:03:47,822 --> 00:03:55,742
They're divided into tiers. The first tier are applications that are libraries

43
00:03:55,742 --> 00:04:01,402
that don't have many dependencies.

44
00:04:01,522 --> 00:04:04,522
You simply can start using them in most cases.

45
00:04:05,002 --> 00:04:09,642
In some cases, there will be dependencies, but those will be third-party dependencies,

46
00:04:09,902 --> 00:04:12,122
and they're not that many.

47
00:04:13,362 --> 00:04:18,642
Tier 2 are KDE libraries that depend on Tier 1 libraries.

48
00:04:19,302 --> 00:04:24,502
And tier 3 have more complex dependencies, sometimes depending on tier 1 and

49
00:04:24,502 --> 00:04:27,342
tier 2, and also external libraries at times.

50
00:04:28,262 --> 00:04:33,082
Tier 4, according to the documentation, can be safely ignored by application

51
00:04:33,082 --> 00:04:36,162
developers. So I'm going to do just that.

52
00:04:38,682 --> 00:04:45,002
Now, if you ask me, I will say that in practice, there's also a tier 0.

53
00:04:45,002 --> 00:04:51,862
And that tier contains this build framework called extracemic modules,

54
00:04:52,202 --> 00:04:56,182
which every single KDE framework depends on.

55
00:04:56,342 --> 00:04:58,422
Only for building, not for runtime.

56
00:04:58,742 --> 00:05:03,522
But extracemic modules is something that you need to embrace if you're going

57
00:05:03,522 --> 00:05:05,242
to be using KDE libraries.

58
00:05:05,942 --> 00:05:11,482
And there's a few small libraries here and there that will also belong to this

59
00:05:11,482 --> 00:05:15,242
tier. and they're not big enough to be considered an actual framework or they're

60
00:05:15,242 --> 00:05:19,702
not listed on the frameworks list that you will access with this link.

61
00:05:20,322 --> 00:05:25,582
This is what that page looks like. This is the actual page.

62
00:05:25,962 --> 00:05:30,082
And as you can see, they're all divided into tiers.

63
00:05:30,382 --> 00:05:36,282
And it tells you the operating system that is supported by each of the libraries.

64
00:05:38,191 --> 00:05:47,651
This is QPrompt. Here I have a little video comparing the use of Kirigami.

65
00:05:47,731 --> 00:05:50,131
To the left is the desktop interface.

66
00:05:50,451 --> 00:05:56,631
To the right we have the mobile version. It's the same, but some layout changes

67
00:05:56,631 --> 00:05:59,251
happen automatically. That's all thanks to Kirigami.

68
00:06:02,111 --> 00:06:10,731
Over here we have Sonnet. Now I'm just showing a random KDE frameworks that I find cool.

69
00:06:11,351 --> 00:06:13,351
This one is for spell checking.

70
00:06:14,611 --> 00:06:18,831
KNotifications, you can use it for creating pop-up notifications.

71
00:06:19,511 --> 00:06:24,431
Solid will give you information about the hardware that your system is running.

72
00:06:25,011 --> 00:06:31,571
And KUser feedback can be used to create, to collect telemetry in a way that is trustworthy.

73
00:06:33,271 --> 00:06:39,191
For other KDE frameworks, please check out the website and check out how they're

74
00:06:39,191 --> 00:06:41,771
employed, how they're used in KDE gear.

75
00:06:43,851 --> 00:06:47,111
Okay, so let's talk about pros and cons.

76
00:06:48,111 --> 00:06:52,211
The pros of KDE frameworks are that they expand Qt functionality.

77
00:06:52,611 --> 00:06:56,391
They give you support for multiple platforms.

78
00:06:56,911 --> 00:07:04,231
Nevertheless, iOS support is very limited, and the WebAssembly support is practically

79
00:07:04,231 --> 00:07:05,751
non-existent, unfortunately.

80
00:07:06,531 --> 00:07:11,291
But it's still possible to deploy to these platforms if you put in the effort.

81
00:07:12,071 --> 00:07:18,011
The frameworks are well-documented, implemented and they have open governance,

82
00:07:18,251 --> 00:07:25,351
which means that one can help steer the future of these frameworks if one is

83
00:07:25,351 --> 00:07:28,391
willing to participate in the community.

84
00:07:30,151 --> 00:07:36,991
The only con in my eyes with KDE frameworks is that tight integration with the

85
00:07:36,991 --> 00:07:41,591
KDE infrastructure can make it inconvenient for using non-KDE apps.

86
00:07:43,091 --> 00:07:46,651
Another pro is that it's free software and open source.

87
00:07:47,071 --> 00:07:51,551
But in the eyes of some people, strong copyleft licenses require consideration.

88
00:07:53,423 --> 00:08:01,423
So, let's talk about licenses. The frameworks are licensed under LGPL, BSD, or MIT licenses.

89
00:08:01,903 --> 00:08:04,083
KDE apps use the GPL.

90
00:08:04,943 --> 00:08:11,183
About those licenses, the LGPL is probably the one that is of most concern to

91
00:08:11,183 --> 00:08:14,263
those people for whom it requires consideration.

92
00:08:14,263 --> 00:08:20,483
Consideration and to address those concerns I want to talk briefly about the

93
00:08:20,483 --> 00:08:25,743
four freedoms and the findings I've had from reading the license.

94
00:08:27,023 --> 00:08:35,143
I'm not a lawyer, that's a disclaimer, but if we look at the freedoms there's

95
00:08:35,143 --> 00:08:39,743
two things that stand out to me in freedoms three and four.

96
00:08:39,743 --> 00:08:44,863
Or the freedom to redistribute copies so you can help others,

97
00:08:45,083 --> 00:08:50,103
and the freedom to distribute copies of modified versions so you can give the

98
00:08:50,103 --> 00:08:52,623
whole community a chance to benefit from your changes.

99
00:08:53,743 --> 00:09:00,143
If you keep this mindset of this is so you can help others and allow others

100
00:09:00,143 --> 00:09:03,803
to benefit when making use of the library.

101
00:09:05,803 --> 00:09:10,823
You'll essentially have a good time making use of the library itself.

102
00:09:12,683 --> 00:09:16,983
These are some general findings and some common misconceptions.

103
00:09:18,003 --> 00:09:23,783
The most notable one is that under the LGPL, non-GPL family programs can be

104
00:09:23,783 --> 00:09:27,903
distributed under any terms if they are not derivative works.

105
00:09:27,903 --> 00:09:33,863
For a program to not be considered derivative, certain requirements must be

106
00:09:33,863 --> 00:09:36,183
met, and for those, please read the license.

107
00:09:38,403 --> 00:09:44,523
The more relevant section for an application developer who will make use of

108
00:09:44,523 --> 00:09:49,403
LGPL libraries is this section, section 4 on combined works.

109
00:09:50,043 --> 00:09:56,063
What's in bold is a summary, and out of that summary, that's a summary of the

110
00:09:56,063 --> 00:09:57,663
requirements that you must meet.

111
00:09:57,863 --> 00:10:01,663
Of course, you must comply with the entire license, but this is the section

112
00:10:01,663 --> 00:10:04,263
that's most relevant for application developers.

113
00:10:04,603 --> 00:10:12,523
And the easiest way to compile is to use this one that I marked in the section

114
00:10:12,523 --> 00:10:14,183
D says, do one of the following.

115
00:10:14,183 --> 00:10:20,463
And option number one is use a suitable shared library mechanism for linking with the library.

116
00:10:20,923 --> 00:10:24,343
This is the easiest one, the easiest approach in my opinion.

117
00:10:24,503 --> 00:10:31,923
It's the default when creating applications with CMake and the default that

118
00:10:31,923 --> 00:10:34,083
KDE uses themselves as well.

119
00:10:34,223 --> 00:10:36,723
So I highly advise going that route.

120
00:10:38,583 --> 00:10:44,423
Now, how do we make use of these frameworks? works. Well, let's prepare our

121
00:10:44,423 --> 00:10:45,123
development environment.

122
00:10:47,374 --> 00:10:55,654
There are four options when it comes to that we can take if we want to create

123
00:10:55,654 --> 00:11:00,814
a development environment that we can also reuse as a distribution environment.

124
00:11:02,714 --> 00:11:06,694
Libraries, the way that they're installed for development is closely tied to

125
00:11:06,694 --> 00:11:10,154
how the package gets distributed later on.

126
00:11:10,154 --> 00:11:13,634
So what I've done is,

127
00:11:13,754 --> 00:11:24,074
here we have the four approaches that are probably the easiest or that can be

128
00:11:24,074 --> 00:11:26,574
used for both things at the same time,

129
00:11:26,634 --> 00:11:29,054
both developing and distributing.

130
00:11:29,954 --> 00:11:36,074
So first approach is to build ourselves. We build each of the dependencies and

131
00:11:36,074 --> 00:11:39,354
that sounds like a lot of work, requires the most mastery.

132
00:11:40,154 --> 00:11:45,274
But it covers the most platforms. If you want to deploy on a platform like iOS,

133
00:11:45,534 --> 00:11:47,054
you will probably need to do this.

134
00:11:49,534 --> 00:11:55,634
We can use our Linux, FreeBSD, Haiku OS distributions packages.

135
00:11:55,994 --> 00:12:02,314
That is, in my opinion, one of the most user-friendly approaches towards developers

136
00:12:02,314 --> 00:12:03,874
making use of the libraries.

137
00:12:05,414 --> 00:12:11,674
We could also use KDE Builder or KDE Source Build. this is the way if you're

138
00:12:11,674 --> 00:12:14,194
going to develop a KDE app for KDE.

139
00:12:15,754 --> 00:12:20,914
I personally have found it unsuitable for third-party because of the integration

140
00:12:20,914 --> 00:12:26,834
with CI but honestly I didn't go very deep into it so there's a good chance

141
00:12:26,834 --> 00:12:27,814
that I might have missed something.

142
00:12:29,214 --> 00:12:32,614
Please give it a try and especially go this

143
00:12:32,614 --> 00:12:36,914
route if you're going to make a KDE app and then there's

144
00:12:36,914 --> 00:12:43,634
craft this is another tooling that is developed by KDE for the purposes of the

145
00:12:43,634 --> 00:12:48,614
developing the packages creating the packages that get distributed on windows

146
00:12:48,614 --> 00:12:54,154
mac os freebsd the linux app images and the android packages as well,

147
00:12:55,404 --> 00:13:02,624
Pros about using Craft. It's a robust packaging system written in Python and

148
00:13:02,624 --> 00:13:07,004
it's honestly far easier than packaging the apps yourself.

149
00:13:08,344 --> 00:13:13,404
The cons is that it constantly keeps changing and it's a little hard to keep up.

150
00:13:13,404 --> 00:13:16,724
Old versions of KDE frameworks are removed

151
00:13:16,724 --> 00:13:19,804
as new versions are added and that might

152
00:13:19,804 --> 00:13:22,964
make it so that your application if you suddenly

153
00:13:22,964 --> 00:13:26,984
cannot build it with the framework that you used originally if you're just going

154
00:13:26,984 --> 00:13:31,444
to fix the bug on it you will need to update to the latest framework and sometimes

155
00:13:31,444 --> 00:13:37,044
that's not an option so unless you're going to follow KDE's release cycle I

156
00:13:37,044 --> 00:13:40,804
think it's probably better to go a different route.

157
00:13:42,164 --> 00:13:49,444
I have had a good experience with Craft, minus the not being able to build stuff

158
00:13:49,444 --> 00:13:53,664
at times, but yes it's an excellent tool.

159
00:13:54,964 --> 00:13:59,384
The Android build scripts however are tied to the CI and that makes it impossible

160
00:13:59,384 --> 00:14:00,844
to use for third-party stuff.

161
00:14:03,324 --> 00:14:08,284
The other option, distribution packages, is actually very easy to get started.

162
00:14:08,424 --> 00:14:11,704
All you need to do is install the libraries, the frameworks,

163
00:14:11,924 --> 00:14:18,084
with their respective "-dev-" or "-devel-" suffixes.

164
00:14:18,704 --> 00:14:26,104
Devel is for RPM, dev is for Debian, and yeah, it's very easy to make these

165
00:14:26,104 --> 00:14:28,204
packages. I will show a little bit about that later on.

166
00:14:29,164 --> 00:14:36,324
And the only con is that some distributions versions update these packages sporadically.

167
00:14:37,124 --> 00:14:44,084
Ubuntu 24.04, for example, shifts with version 5.115 of KDE frameworks,

168
00:14:44,304 --> 00:14:47,484
and that version is already duplicated.

169
00:14:47,684 --> 00:14:51,444
So if you're going to be using this in a developer environment,

170
00:14:51,824 --> 00:14:53,804
I suggest going with KDE Neon.

171
00:14:53,924 --> 00:14:59,744
And when you're targeting for distribution, I suggest choosing the oldest,

172
00:15:00,044 --> 00:15:02,844
still active, version of Debian.

173
00:15:04,924 --> 00:15:09,164
I haven't talked about universal packages. I didn't put them on this section.

174
00:15:09,384 --> 00:15:14,624
And the reason for that is universal packages, they can't really be used for

175
00:15:14,624 --> 00:15:16,864
both purposes, development and distribution.

176
00:15:18,704 --> 00:15:23,004
Essentially, you do your development and then you use this pipeline for distributing

177
00:15:23,004 --> 00:15:23,944
the universal packages.

178
00:15:24,684 --> 00:15:29,644
Still thought it was worth to mention. it because KDE provides these runtimes

179
00:15:29,644 --> 00:15:31,724
that you can use for flat packs and snaps,

180
00:15:31,964 --> 00:15:36,824
and all you need to do is to include those in your YAML files and configuration files,

181
00:15:37,004 --> 00:15:46,404
and you'll essentially use a part of that CI infrastructure to create packages

182
00:15:46,404 --> 00:15:48,584
that satisfy the framework requirements.

183
00:15:50,921 --> 00:15:57,181
So now about building everything yourself. The advantages are that you can develop

184
00:15:57,181 --> 00:16:01,821
at your own pace and you can target architectures that are not currently supported

185
00:16:01,821 --> 00:16:05,881
by KDE, such as RISC-V and ARM64 bits on Windows.

186
00:16:06,801 --> 00:16:10,281
And you can distribute on platforms that are currently limited,

187
00:16:10,381 --> 00:16:12,201
such as Android and WebAssembly.

188
00:16:13,241 --> 00:16:19,441
The disadvantage is that for each platform, you have to build all the libraries

189
00:16:19,441 --> 00:16:24,461
manually, install them, and then create the packages and installers for each of those platforms,

190
00:16:24,701 --> 00:16:31,401
which can be a lot of work, but there's a script for that, at least the first two parts here.

191
00:16:33,041 --> 00:16:39,001
All right, so now let's talk about CMake. I bet most people here are familiar

192
00:16:39,001 --> 00:16:42,781
with this, but this is a build system for C++ code.

193
00:16:42,901 --> 00:16:45,261
It's what's used for Qt. It's what's used by KDE.

194
00:16:45,421 --> 00:16:47,941
It's been used by KDE for a long time, and it's excellent.

195
00:16:50,301 --> 00:16:56,081
There's this feature, the generators, that is essentially what CMake outputs.

196
00:16:56,201 --> 00:17:00,961
It outputs project files that can be used by compilers in different environments

197
00:17:00,961 --> 00:17:02,901
to create your application.

198
00:17:05,101 --> 00:17:09,161
And there are defaults for each system that we can use.

199
00:17:09,801 --> 00:17:16,341
So relying on the defaults, here is... We'll go back into CMake a little bit

200
00:17:16,341 --> 00:17:22,461
later. This is actually CMake code, but here is how we use CMake to make use of KDE frameworks.

201
00:17:22,741 --> 00:17:31,081
This part in particular is no different for a third-party app than it will be for a KDE application.

202
00:17:31,961 --> 00:17:35,481
We essentially find the package

203
00:17:35,481 --> 00:17:38,581
for extra CMake modules and then we find

204
00:17:38,581 --> 00:17:41,481
each of the add-ons that we want

205
00:17:41,481 --> 00:17:44,681
and then we create

206
00:17:44,681 --> 00:17:47,781
we do the linking to those to the

207
00:17:47,781 --> 00:17:54,141
different modules that were found in these packages so essentially find packages

208
00:17:54,141 --> 00:18:01,481
searches a file and I'll show which one that's later and once the packages have

209
00:18:01,481 --> 00:18:05,741
been found you can link your binaries to them in this step using this.

210
00:18:07,821 --> 00:18:14,401
So, although other packaging methods for locating libraries exist in CMake,

211
00:18:14,521 --> 00:18:19,381
I recommend FindPackage because it's what KDE themselves is using.

212
00:18:19,621 --> 00:18:25,681
And all the libraries depend on extra CMake modules if you're going to compile them.

213
00:18:25,821 --> 00:18:29,161
So, at the very least, extra CMake modules need to be installed.

214
00:18:30,301 --> 00:18:35,321
And if you're able to to install extra-semic modules, then you should be able

215
00:18:35,321 --> 00:18:36,561
to install all other libraries.

216
00:18:38,228 --> 00:18:44,608
Due to sometimes there being hard-coded paths in the CMake files of KDE frameworks,

217
00:18:44,868 --> 00:18:48,768
these might not compile if you attempt to add them using add subdirectory.

218
00:18:49,748 --> 00:18:54,748
And if you use external project add, this might not work for CI environments

219
00:18:54,748 --> 00:18:56,928
such as the one for flatpaks.

220
00:18:57,888 --> 00:19:02,208
So just stick to find package and you'll be fine.

221
00:19:03,928 --> 00:19:08,388
Okay, so I've said, I said extra CMake modules a bunch of times in the last slide.

222
00:19:09,168 --> 00:19:13,948
These are a set of build script for CMake that Katie is using.

223
00:19:14,048 --> 00:19:17,028
Okay, and they is building.

224
00:19:18,348 --> 00:19:22,628
This is what's actually extra CMake modules. It's just those folders and they

225
00:19:22,628 --> 00:19:23,768
contain a bunch of modules.

226
00:19:23,928 --> 00:19:28,008
You could actually load those files directly in CMake and you wouldn't even

227
00:19:28,008 --> 00:19:36,628
need to use the find but use the find because that you'll need them for the dependencies okay.

228
00:19:39,188 --> 00:19:41,788
Again this is CMake I think I repeated

229
00:19:41,788 --> 00:19:46,468
the slide okay so these are some commodities that you get at from ECM.

230
00:19:47,568 --> 00:19:49,268
I'll skip those for now.

231
00:19:50,988 --> 00:19:53,068
Now let's build the packages.

232
00:19:56,028 --> 00:20:01,028
Okay. In order to build the KDE frameworks on any operating system,

233
00:20:01,268 --> 00:20:05,548
you'll need to get a script language of your choice.

234
00:20:05,648 --> 00:20:08,248
I'm using bash here and a Python.

235
00:20:08,968 --> 00:20:13,568
On Mac, you'll need to run this command. On Ubuntu, you'll need these dependencies.

236
00:20:15,508 --> 00:20:23,508
And the script begins, create a build folder, set these configuration types.

237
00:20:23,708 --> 00:20:27,948
This is what can be built. We want a debug and a release at the very least.

238
00:20:28,228 --> 00:20:31,288
And this is what will be built. These are all variables.

239
00:20:31,548 --> 00:20:34,608
And we have this CMake prefix path.

240
00:20:34,788 --> 00:20:39,248
This is a very important path because this is the path that gets searched by

241
00:20:39,248 --> 00:20:43,608
this find instruction, this find package over here.

242
00:20:45,610 --> 00:20:50,970
So with those variables all set, we have the install prefix path,

243
00:20:51,190 --> 00:20:55,830
which is where once you install, you go to install the framework,

244
00:20:56,030 --> 00:20:57,430
where will this get stored?

245
00:20:57,590 --> 00:21:01,790
I'm just storing it on the same folder as the prefix, and then everything will

246
00:21:01,790 --> 00:21:03,390
be in there all pretty together.

247
00:21:04,810 --> 00:21:06,530
But you can do it wherever you want.

248
00:21:08,170 --> 00:21:11,690
So now we have all of those variables set.

249
00:21:11,850 --> 00:21:17,150
Let's call CMake. You call CMake, pass the variables, you will also need for

250
00:21:17,150 --> 00:21:22,390
a third-party app development, you will also need to set build testing to off and build QCH to off.

251
00:21:22,890 --> 00:21:27,730
And with all the variables set, go ahead and tell it to build the build directory.

252
00:21:29,050 --> 00:21:32,930
And it will build from the source code in the current directory.

253
00:21:33,410 --> 00:21:38,410
And that's essentially it runs CMake, which gets everything ready.

254
00:21:38,410 --> 00:21:42,610
And once everything is ready, the next command, cmake build,

255
00:21:42,910 --> 00:21:49,190
that one will do all of the building using the generator that was used in the

256
00:21:49,190 --> 00:21:52,410
previous step, which in this case is just the default for every system.

257
00:21:53,710 --> 00:21:58,950
And once the build completes, run cmake install, point it to the build directory,

258
00:21:59,150 --> 00:22:03,290
and it will install your KDE framework to the install prefix.

259
00:22:04,710 --> 00:22:10,490
So this is how I'm doing it in my application QPrompt.

260
00:22:10,550 --> 00:22:16,110
I download every dependency to a sub-module using getSubModuleAdd.

261
00:22:16,490 --> 00:22:23,170
You can add them from either invent.kde.org directly or from GitHub.

262
00:22:25,148 --> 00:22:28,808
Then I go and check the operating system, and depending on the operating system

263
00:22:28,808 --> 00:22:32,628
and its architecture, I set a series of values like the compiler and the platform.

264
00:22:33,768 --> 00:22:36,408
Then I update the submodules.

265
00:22:38,508 --> 00:22:45,028
For Python, I did mention Python was required. This is, you'll need to install things and reuse.

266
00:22:45,368 --> 00:22:51,368
These are the commands to automatically install those things and load the local

267
00:22:51,368 --> 00:22:55,408
installation folder that we create here for a virtual environment in Python.

268
00:22:56,928 --> 00:23:01,648
And I did mention that some KDE frameworks have dependencies.

269
00:23:03,068 --> 00:23:06,088
Unfortunately, if we're taking this approach of building everything ourselves,

270
00:23:06,408 --> 00:23:08,488
that means we also need to build those dependencies.

271
00:23:08,848 --> 00:23:13,848
And those are not KDE dependencies, which I have streamlined here.

272
00:23:14,008 --> 00:23:17,368
Each one of those can be something completely different. So,

273
00:23:17,608 --> 00:23:23,788
I tried to find a common denominator between all of them, and I found that VCPKG

274
00:23:23,788 --> 00:23:27,868
can satisfy most of KDE's third-party dependencies.

275
00:23:28,548 --> 00:23:35,348
So, what I do is I take VCPKG installable dependencies in classic mode,

276
00:23:35,488 --> 00:23:37,708
which puts them all in a central folder,

277
00:23:38,048 --> 00:23:44,548
and then I take that folder and copy it over to the install prefix.

278
00:23:45,568 --> 00:23:50,508
Why not use vcpkg for installing KDE frameworks?

279
00:23:51,148 --> 00:23:56,548
Well, there's no one actively maintaining the KDE packages on vcpkg,

280
00:23:57,228 --> 00:24:01,128
but if that were maintained, you could use vcpkg for everything.

281
00:24:04,117 --> 00:24:08,797
So I add vcpkg as a submodule, same as all the other packages,

282
00:24:08,997 --> 00:24:13,757
and then initialize it with this command. It will generate a JSON like this one.

283
00:24:14,917 --> 00:24:19,197
Then automatically build and then we continue with the build script.

284
00:24:19,417 --> 00:24:20,757
This is the build script that I was showing earlier.

285
00:24:21,037 --> 00:24:28,417
It continues here. This is the vcpkg section, where essentially I run the bootstrap,

286
00:24:28,517 --> 00:24:35,877
which sets up vcpkg and installs all of the dependencies that I have listed in a folder.

287
00:24:37,337 --> 00:24:41,357
No, I just list them right here. And package name goes here,

288
00:24:41,497 --> 00:24:44,437
put all the names of the packages there, and it will get installed.

289
00:24:45,077 --> 00:24:46,537
Those get copied in this step.

290
00:24:47,337 --> 00:24:51,717
All right. And now with all of the third-party dependencies taken care of,

291
00:24:51,837 --> 00:24:57,457
we can automatically go through each of the tiers in KDE frameworks.

292
00:24:58,577 --> 00:25:02,037
This is a list of paths in Bash.

293
00:25:02,837 --> 00:25:06,517
And we do a for loop and go through all of those lists.

294
00:25:06,517 --> 00:25:09,497
And out of there

295
00:25:09,497 --> 00:25:12,357
i essentially do the same thing

296
00:25:12,357 --> 00:25:15,297
that i showed you earlier run cmake to

297
00:25:15,297 --> 00:25:21,657
generate all of the run the cmake command on on those each of those frameworks

298
00:25:21,657 --> 00:25:27,357
then we build them and we install them and then we do the same thing one more

299
00:25:27,357 --> 00:25:34,497
time for our own application we don't necessarily install it in this case but we do it and we're done.

300
00:25:35,757 --> 00:25:43,477
So that's for building. Then we have a dev environment just a launch configure

301
00:25:43,477 --> 00:25:50,877
Qt Creator to use the prefix and you'll be able to access all of your KDE frameworks

302
00:25:50,877 --> 00:25:53,037
from there and develop very comfortably.

303
00:25:55,457 --> 00:25:59,837
When we go towards making the applications the distributable installers,

304
00:25:59,917 --> 00:26:02,597
we can use CPAC, which is a part of CMake.

305
00:26:03,737 --> 00:26:09,857
For using CPAC, what we need to do is enter the build directory and then run the CPAC command.

306
00:26:10,277 --> 00:26:13,877
Of course, we need to set up a few things before that in the CMake itself.

307
00:26:14,237 --> 00:26:16,497
These are just screenshots from QPrompt.

308
00:26:17,637 --> 00:26:23,257
Here I have the instructions for the Debian package. You can use that as is, it works.

309
00:26:24,317 --> 00:26:29,157
Works. These are for... this is more of the Debian and the RPM.

310
00:26:29,477 --> 00:26:31,577
The RPM isn't fully working, so don't copy that.

311
00:26:32,497 --> 00:26:35,857
These are for Windows. These aren't tested yet, it's still in development.

312
00:26:36,837 --> 00:26:39,797
And these are for iOS and Android.

313
00:26:40,557 --> 00:26:46,737
These are mostly working. I've yet to do the signing part which I'll talk about in a moment.

314
00:26:47,897 --> 00:26:49,677
And this is for FreeBSD.

315
00:26:52,174 --> 00:26:56,634
So, the thing I just said, I'll talk in a moment, is this.

316
00:26:57,374 --> 00:27:02,894
When you package the application, it may not contain all the libraries within it.

317
00:27:03,154 --> 00:27:08,834
And that's because, well, you just packaged your application,

318
00:27:08,994 --> 00:27:10,414
not necessarily the libraries.

319
00:27:10,554 --> 00:27:14,394
And these are dynamically linked, not statically linked.

320
00:27:14,394 --> 00:27:23,394
So, what we want to do is use some tooling like WinDeployQt,

321
00:27:24,374 --> 00:27:27,554
MacDeployQt to, in the cases of those platforms that need it,

322
00:27:27,694 --> 00:27:34,634
we collect all of our libraries and have them in a search central folder before we run CPEC.

323
00:27:35,274 --> 00:27:39,694
In the case of Windows, we also want this command that says install required

324
00:27:39,694 --> 00:27:41,874
system libraries. We want to set this to on.

325
00:27:44,054 --> 00:27:47,354
And yeah if it's a

326
00:27:47,354 --> 00:27:51,234
windows an app image a mac

327
00:27:51,234 --> 00:27:54,434
or android you want to include all the libraries and if

328
00:27:54,434 --> 00:27:57,774
it's a wm package an rpm a snapback a haiku

329
00:27:57,774 --> 00:28:00,494
os flatpak all of those you do not

330
00:28:00,494 --> 00:28:05,714
want to include the packages that's also true for freebsd and

331
00:28:05,714 --> 00:28:09,654
last but not least some platforms will

332
00:28:09,654 --> 00:28:12,374
require you to sign these packages and this

333
00:28:12,374 --> 00:28:16,934
is a bit annoying because you don't only need to sign your program you also

334
00:28:16,934 --> 00:28:25,334
need to sign KDE libraries themselves so yeah you'll sign both the binary and

335
00:28:25,334 --> 00:28:30,934
the package in the case of distributing on the Microsoft Store you'll just need to do the Microsoft,

336
00:28:31,734 --> 00:28:36,694
here are some additional resources that I recommend for learning about CMake

337
00:28:36,694 --> 00:28:40,994
The first three are playlists in YouTube, and they are amazing.

338
00:28:42,354 --> 00:28:43,774
Thank you very much for your time.

339
00:28:51,674 --> 00:28:52,554
Any questions?

340
00:29:08,405 --> 00:29:11,285
Hello. Is it okay?

341
00:29:11,985 --> 00:29:17,185
So I have been using KDE frameworks so far in my application,

342
00:29:17,445 --> 00:29:28,105
and I feel like one of the most problem for me is that it couples very tightly with K initialization,

343
00:29:28,345 --> 00:29:32,905
but I use another framework for translations.

344
00:29:33,465 --> 00:29:35,105
Is there any way around that?

345
00:29:38,565 --> 00:29:42,345
So you're talking about KI-18, the translations framework?

346
00:29:43,305 --> 00:29:49,905
I don't use K. Right. I don't use that. Yeah, I use Fluent. Right.

347
00:29:51,905 --> 00:29:55,665
My personal advice is to avoid it if possible.

348
00:29:56,265 --> 00:30:00,405
If another dependency requires it, then use it in that case.

349
00:30:00,405 --> 00:30:03,465
But in in your personal application i will

350
00:30:03,465 --> 00:30:09,485
try to avoid it simply because um it's one of those that requires third-party

351
00:30:09,485 --> 00:30:13,645
dependencies and the technique that i showed you to satisfy those dependencies

352
00:30:13,645 --> 00:30:19,445
will work um but you also need to copy one file and it's an additional step

353
00:30:19,445 --> 00:30:22,265
that i have in my MyScript, the one, the actual app.

354
00:30:23,645 --> 00:30:34,185
But the thing is, most of the value that a K internationalization provides is for the KDE community.

355
00:30:34,525 --> 00:30:42,665
And if one is outside, working from the outside, unless you intend,

356
00:30:42,925 --> 00:30:47,825
like I do in my case, to to distribute that application eventually as a KDE app,

357
00:30:48,805 --> 00:30:55,365
then you'll probably have a better time working with Qt's own internationalization

358
00:30:55,365 --> 00:30:59,905
API, which didn't exist, and that's why K-internationalization was created,

359
00:31:00,025 --> 00:31:02,665
but now we have one, so I will use that instead.

360
00:31:04,425 --> 00:31:06,805
Okay, we have time for just one more question.

361
00:31:13,837 --> 00:31:19,197
You mentioned early on that one of the cons of KDE frameworks is the tight integration

362
00:31:19,197 --> 00:31:20,617
with the KDE infrastructure.

363
00:31:22,177 --> 00:31:28,997
The KDE what? The tight integration of KDE frameworks with the KDE infrastructure for third parties.

364
00:31:29,337 --> 00:31:34,077
Then you mentioned issues with craft specifically, but do you have any other

365
00:31:34,077 --> 00:31:36,977
examples or the extent of it?

366
00:31:36,977 --> 00:31:43,817
I mean, in my personal experience, the main issue has been that since the libraries

367
00:31:43,817 --> 00:31:51,537
are deprecated, I mean, yeah, they're removed from one being able to build them with craft.

368
00:31:52,897 --> 00:31:56,337
I'm essentially forced to update constantly to the more recent version.

369
00:31:56,897 --> 00:32:01,957
Besides that, the other issues I've had have been honestly small,

370
00:32:02,117 --> 00:32:06,177
and I've been able to reach out to the team, and they've addressed them all.

371
00:32:06,177 --> 00:32:09,297
So that's the only notable one.

