Bug 512270 - plasma-workspace fails to compile because of upstream fontconfig header change
Summary: plasma-workspace fails to compile because of upstream fontconfig header change
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_fontinst (other bugs)
Version First Reported In: git-stable-Plasma/6.3
Platform: Other Linux
: HI crash
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-18 00:10 UTC by bluescreenavenger
Modified: 2025-12-10 23:08 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.6
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bluescreenavenger 2025-11-18 00:10:10 UTC
Hi

It seems that plasma-workspace fails to compile because fontconfig moved some functions around in a header.

The error is below, I hope I am reporting against the correct component, I could not find the plasma-workspace component here, so this is my best guess, and the gitlab repo says to report here

I think it is because of this commit https://github.com/fontconfig/fontconfig/commit/b4b753d66dea17d645166adca239a0fba84d03a9

Thanks


```
  Build plasma-workspace (294 of 519): [ 26%] Built target org.kde.plasma.lock_logout_autogen
  Build plasma-workspace (294 of 519): [ 26%] Building CXX object applets/kicker/autotests/CMakeFiles/testrunnermodel.dir/__/actionlist.cpp.o
  Build plasma-workspace (294 of 519): [ 26%] Building CXX object applets/kicker/autotests/CMakeFiles/testrunnermodel.dir/__/containmentinterface.cpp.o
  Build plasma-workspace (294 of 519): [ 26%] Linking CXX shared library ../bin/libklipper.so
  Build plasma-workspace (294 of 519): /var/cache/srcbuild/plasma-workspace/kcms/kfontinst/lib/Fc.cpp: In function ‘QString KFI::FC::getName(const QString&)’:
  Build plasma-workspace (294 of 519): /var/cache/srcbuild/plasma-workspace/kcms/kfontinst/lib/Fc.cpp:406:22: error: ‘FcFreeTypeQuery’ was not declared in this scope
  Build plasma-workspace (294 of 519):   406 |     FcPattern *pat = FcFreeTypeQuery((const FcChar8 *)(QFile::encodeName(file).constData()), 0, nullptr, &count);
  Build plasma-workspace (294 of 519):       |                      ^~~~~~~~~~~~~~~
  Build plasma-workspace (294 of 519): [ 26%] Built target keyboardindicatorplugin_autogen
```
Comment 1 David Edmundson 2025-11-18 22:36:09 UTC
As you've done this work already do you want to create an MR?
Comment 2 bluescreenavenger 2025-11-19 00:25:10 UTC
(In reply to David Edmundson from comment #1)
> As you've done this work already do you want to create an MR?

Well... I thought it would be easy
```
diff --git a/kcms/kfontinst/lib/Fc.h b/kcms/kfontinst/lib/Fc.h
index 4dd854d4db..0899e6bfec 100644
--- a/kcms/kfontinst/lib/Fc.h
+++ b/kcms/kfontinst/lib/Fc.h
@@ -9,6 +9,7 @@
 #include "kfontinst_export.h"
 #include <QUrl>
 #include <fontconfig/fontconfig.h>
+#include <fontconfig/fcfreetype.h>
 
 #include "kfontinst_export.h"
 
```

but fcfreetype.h loops for ft2build.h ...which is provided by freetype
I have the header. So I assume that some CMake change needs to be done too?
Comment 3 bluescreenavenger 2025-11-23 01:46:54 UTC
Unless you can give me some sort of advice

```
diff --git a/kcms/kfontinst/lib/Fc.h b/kcms/kfontinst/lib/Fc.h
index 4dd854d4db..0899e6bfec 100644
--- a/kcms/kfontinst/lib/Fc.h
+++ b/kcms/kfontinst/lib/Fc.h
@@ -9,6 +9,7 @@
 #include "kfontinst_export.h"
 #include <QUrl>
 #include <fontconfig/fontconfig.h>
+#include <fontconfig/fcfreetype.h>
 
 #include "kfontinst_export.h"
 ```

does not work, because it tries to find a header from another package.
Comment 4 Nate Graham 2025-12-10 23:08:25 UTC
Git commit 9a5a1a4f36ba0b488d3787317038b281f5c11ece by Nate Graham, on behalf of Nerdopolis Turfwalker.
Committed on 10/12/2025 at 23:08.
Pushed by ngraham into branch 'master'.

Fix build with latest Fontconfig changes

It seems that fontconfig split a header https://github.com/fontconfig/fontconfig/commit/b4b753d66dea17d645166adca239a0fba84d03a9
FIXED-IN: 6.6

M  +6    -0    CMakeLists.txt
M  +1    -0    kcms/kfontinst/lib/CMakeLists.txt
M  +1    -0    kcms/kfontinst/lib/Fc.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/9a5a1a4f36ba0b488d3787317038b281f5c11ece