diff --git a/plasma/kwin/HISTORY b/plasma/kwin/HISTORY
index 5c0e343..25c5b89 100644
--- a/plasma/kwin/HISTORY
+++ b/plasma/kwin/HISTORY
@@ -1,3 +1,6 @@
+2018-01-22 Treeve Jelbert <treeve AT sourcemage.org>
+ * PRE_BUILD PATCHES/*: added, upstream patch
+
2018-01-03 Treeve Jelbert <treeve AT sourcemage.org>
* DETAILS: version 5.11.5
diff --git a/plasma/kwin/PRE_BUILD b/plasma/kwin/PRE_BUILD
new file mode 100755
index 0000000..922c0ab
--- /dev/null
+++ b/plasma/kwin/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd $SOURCE_DIRECTORY &&
+apply_patch_dir patches
diff --git a/plasma/kwin/patches/automoc.patch
b/plasma/kwin/patches/automoc.patch
new file mode 100644
index 0000000..359d512
--- /dev/null
+++ b/plasma/kwin/patches/automoc.patch
@@ -0,0 +1,43 @@
+commit cd544890ced4192d07467c89e23adbb62d8cea5c
+Author: Milian Wolff <mail AT milianw.de>
+Date: Mon Dec 18 11:40:35 2017 +0100
+
+ Fix build with CMake 3.10
+
+ Looks like a classic false-positive, but this makes the compile
+ pass for me without making the code harder to read:
+
+ AutoMoc error
+ -------------
+
"/ssd/milian/projects/kf5/src/kde/workspace/kwin/kcmkwin/kwinscripts/main.cpp"
+ The file contains a K_PLUGIN_FACTORY macro, but does not include
"main.moc"!
+ Consider to
+ - add #include "main.moc"
+ - enable SKIP_AUTOMOC for this file
+
+ So we just add the include and then get rid of the duplicate
+ definition of the plugin factory and the problem is resolved.
+
+diff --git a/kcmkwin/kwinscripts/main.cpp b/kcmkwin/kwinscripts/main.cpp
+index f5ee04b30..baa517511 100644
+--- a/kcmkwin/kwinscripts/main.cpp
++++ b/kcmkwin/kwinscripts/main.cpp
+@@ -22,3 +22,5 @@
+
+ K_PLUGIN_FACTORY(KcmKWinScriptsFactory,
+ registerPlugin<Module>("kwin-scripts");)
++
++#include "main.moc"
+diff --git a/kcmkwin/kwinscripts/module.cpp b/kcmkwin/kwinscripts/module.cpp
+index a0d698ec2..ccf7d4130 100644
+--- a/kcmkwin/kwinscripts/module.cpp
++++ b/kcmkwin/kwinscripts/module.cpp
+@@ -40,8 +40,6 @@
+
+ #include "version.h"
+
+-K_PLUGIN_FACTORY_DECLARATION(KcmKWinScriptsFactory)
+-
+ Module::Module(QWidget *parent, const QVariantList &args) :
+ KCModule(parent, args),
+ ui(new Ui::Module),
[SM-Commit] GIT changes to master grimoire by Treeve Jelbert (88038d9b87a7f6fa41e4ed8a92d5cea99da96a56),
Treeve Jelbert, 01/22/2018