From 2437d1837c3a760133d03593fe0bbe301655db65 Mon Sep 17 00:00:00 2001
From: Bart Ribbers <bribbers@disroot.org>
Date: Mon, 30 May 2022 08:58:06 +0200
Subject: [PATCH] community/nemo-qml-plugin-calendar: upgrade to 0.6.46

---
 .../0001-Port-to-CMake.patch                  | 230 +++---
 community/nemo-qml-plugin-calendar/1.patch    | 722 ++++++++++++++++++
 community/nemo-qml-plugin-calendar/APKBUILD   |  19 +-
 3 files changed, 875 insertions(+), 96 deletions(-)
 create mode 100644 community/nemo-qml-plugin-calendar/1.patch

diff --git a/community/nemo-qml-plugin-calendar/0001-Port-to-CMake.patch b/community/nemo-qml-plugin-calendar/0001-Port-to-CMake.patch
index c44261d100bd..faa1a910f830 100644
--- a/community/nemo-qml-plugin-calendar/0001-Port-to-CMake.patch
+++ b/community/nemo-qml-plugin-calendar/0001-Port-to-CMake.patch
@@ -1,74 +1,18 @@
-From 676285b18b11055eca4481434934c5d5d816ac4f Mon Sep 17 00:00:00 2001
-From: Bart Ribbers <bribbers@disroot.org>
-Date: Sun, 18 Apr 2021 17:22:02 +0200
-Subject: [PATCH] Port to CMake
-
-This project uses KDE's KCalendarCore. However, that package can only be
-used with build systems that support CMake dependencies, which QMake is
-not one of. KCalendarCore probably shipped a pkgconfig file in the past,
-but this has not been the case for a quite a while as far as I can see.
-
-Since using QMake thus prevents using a current KCalendarCore, switch
-the build system to CMake instead
----
- .gitignore                                    |  5 +-
- CMakeLists.txt                                | 51 ++++++++++++++
- calendar.pro                                  |  7 --
- lightweight/CMakeLists.txt                    |  2 +
- .../calendardataservice/CMakeLists.txt        | 23 ++++++
- .../calendardataservice.pro                   | 45 ------------
- .../calendareventsmodel/CMakeLists.txt        | 23 ++++++
- .../calendareventsmodel.pro                   | 34 ---------
- lightweight/lightweight.pro                   |  2 -
- src/CMakeLists.txt                            | 62 ++++++++++++++++
- src/src.pro                                   | 70 -------------------
- tests/CMakeLists.txt                          |  4 ++
- tests/common.pri                              |  9 ---
- tests/tests.pro                               | 10 ---
- tests/tst_calendarevent/CMakeLists.txt        | 15 ++++
- tests/tst_calendarevent/tst_calendarevent.pro |  4 --
- tests/tst_calendarmanager/CMakeLists.txt      | 15 ++++
- .../tst_calendarmanager.pro                   |  4 --
- tools/CMakeLists.txt                          |  1 +
- tools/icalconverter/CMakeLists.txt            | 10 +++
- tools/icalconverter/icalconverter.pro         | 10 ---
- tools/tools.pro                               |  2 -
- 23 files changed, 207 insertions(+), 211 deletions(-)
- create mode 100644 CMakeLists.txt
- delete mode 100644 calendar.pro
- create mode 100644 lightweight/CMakeLists.txt
- create mode 100644 lightweight/calendardataservice/CMakeLists.txt
- delete mode 100644 lightweight/calendardataservice/calendardataservice.pro
- create mode 100644 lightweight/calendareventsmodel/CMakeLists.txt
- delete mode 100644 lightweight/calendareventsmodel/calendareventsmodel.pro
- delete mode 100644 lightweight/lightweight.pro
- create mode 100644 src/CMakeLists.txt
- delete mode 100644 src/src.pro
- create mode 100644 tests/CMakeLists.txt
- delete mode 100644 tests/common.pri
- delete mode 100644 tests/tests.pro
- create mode 100644 tests/tst_calendarevent/CMakeLists.txt
- delete mode 100644 tests/tst_calendarevent/tst_calendarevent.pro
- create mode 100644 tests/tst_calendarmanager/CMakeLists.txt
- delete mode 100644 tests/tst_calendarmanager/tst_calendarmanager.pro
- create mode 100644 tools/CMakeLists.txt
- create mode 100644 tools/icalconverter/CMakeLists.txt
- delete mode 100644 tools/icalconverter/icalconverter.pro
- delete mode 100644 tools/tools.pro
-
 diff --git a/.gitignore b/.gitignore
-index c6d36a2..d2a8406 100644
+index 7fdc54b..2d578b4 100644
 --- a/.gitignore
 +++ b/.gitignore
-@@ -1,11 +1,8 @@
+@@ -1,13 +1,8 @@
  # Build artefacts
  *.o
  *.so
--lightweight/calendardataservice/calendardataservice
--tests/tst_calendarevent/tst_calendarevent
--tests/tst_calendarmanager/tst_calendarmanager
--tools/icalconverter/icalconverter
- RPMS
+-/lightweight/calendardataservice/calendardataservice
+-/tests/tst_calendarevent/tst_calendarevent
+-/tests/tst_calendarmanager/tst_calendarmanager
+-/tests/tst_calendaragendamodel/tst_calendaragendamodel
+-/tests/tst_calendarevent/Makefile.tst_calendareventbin
+-/tools/icalconverter/icalconverter
+ /RPMS
 +build
  
  # Generated sources
@@ -182,7 +126,7 @@ index 0000000..36425cf
 +	DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/services)
 diff --git a/lightweight/calendardataservice/calendardataservice.pro b/lightweight/calendardataservice/calendardataservice.pro
 deleted file mode 100644
-index cfe937d..0000000
+index a311951..0000000
 --- a/lightweight/calendardataservice/calendardataservice.pro
 +++ /dev/null
 @@ -1,45 +0,0 @@
@@ -201,11 +145,11 @@ index cfe937d..0000000
 -    calendardataserviceadaptor.h \
 -    ../common/eventdata.h \
 -    ../../src/calendaragendamodel.h \
+-    ../../src/calendareventlistmodel.h \
 -    ../../src/calendarmanager.h \
 -    ../../src/calendarworker.h \
 -    ../../src/calendareventoccurrence.h \
 -    ../../src/calendarevent.h \
--    ../../src/calendarchangeinformation.h \
 -    ../../src/calendareventquery.h \
 -    ../../src/calendarinvitationquery.h \
 -    ../../src/calendarutils.h
@@ -215,11 +159,11 @@ index cfe937d..0000000
 -    calendardataserviceadaptor.cpp \
 -    ../common/eventdata.cpp \
 -    ../../src/calendaragendamodel.cpp \
+-    ../../src/calendareventlistmodel.cpp \
 -    ../../src/calendarmanager.cpp \
 -    ../../src/calendarworker.cpp \
 -    ../../src/calendareventoccurrence.cpp \
 -    ../../src/calendarevent.cpp \
--    ../../src/calendarchangeinformation.cpp \
 -    ../../src/calendareventquery.cpp \
 -    ../../src/calendarinvitationquery.cpp \
 -    ../../src/calendarutils.cpp \
@@ -310,7 +254,7 @@ index 6fe91a6..0000000
 -SUBDIRS = calendardataservice calendareventsmodel
 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
 new file mode 100644
-index 0000000..66fef87
+index 0000000..901c1dd
 --- /dev/null
 +++ b/src/CMakeLists.txt
 @@ -0,0 +1,62 @@
@@ -329,13 +273,13 @@ index 0000000..66fef87
 +	calendarmanager.cpp
 +	calendarworker.cpp
 +	calendarnotebookquery.cpp
-+	calendareventmodification.cpp
-+	calendarchangeinformation.cpp
++	calendareventmodification.cpp	
 +	calendarutils.cpp
 +	calendarimportmodel.cpp
 +	calendarimportevent.cpp
 +	calendarcontactmodel.cpp
-+	calendarattendeemodel.cpp)
++	calendarattendeemodel.cpp
++	calendareventlistmodel.cpp)
 +set(HEADERS
 +	calendarevent.h
 +	calendareventoccurrence.h
@@ -348,13 +292,13 @@ index 0000000..66fef87
 +	calendarworker.h
 +	calendardata.h
 +	calendarnotebookquery.h
-+	calendareventmodification.h
-+	calendarchangeinformation.h
++	calendareventmodification.h	
 +	calendarutils.h
 +	calendarimportmodel.h
 +	calendarimportevent.h
 +	calendarcontactmodel.h
-+	calendarattendeemodel.h)
++	calendarattendeemodel.h
++	calendareventlistmodel.h)
 +
 +add_library(nemocalendar SHARED ${SRC} ${HEADERS})
 +
@@ -378,7 +322,7 @@ index 0000000..66fef87
 +	DESTINATION ${PLUGIN_IMPORT_PATH})
 diff --git a/src/src.pro b/src/src.pro
 deleted file mode 100644
-index f728109..0000000
+index a6de4e5..0000000
 --- a/src/src.pro
 +++ /dev/null
 @@ -1,70 +0,0 @@
@@ -401,7 +345,7 @@ index f728109..0000000
 -qmldir.path +=  $$target.path
 -INSTALLS += qmldir
 -
--qmltypes.commands = qmlplugindump -nonrelocatable org.nemomobile.calendar 1.0 > $$PWD/plugins.qmltypes
+-qmltypes.commands = qmlplugindump -noinstantiate -nonrelocatable org.nemomobile.calendar 1.0 > $$PWD/plugins.qmltypes
 -QMAKE_EXTRA_TARGETS += qmltypes
 -
 -CONFIG += link_pkgconfig
@@ -413,6 +357,7 @@ index f728109..0000000
 -    $$SRCDIR/calendarevent.cpp \
 -    $$SRCDIR/calendareventoccurrence.cpp \
 -    $$SRCDIR/calendaragendamodel.cpp \
+-    $$SRCDIR/calendareventlistmodel.cpp \
 -    $$SRCDIR/calendarapi.cpp \
 -    $$SRCDIR/calendareventquery.cpp \
 -    $$SRCDIR/calendarinvitationquery.cpp \
@@ -421,7 +366,6 @@ index f728109..0000000
 -    $$SRCDIR/calendarworker.cpp \
 -    $$SRCDIR/calendarnotebookquery.cpp \
 -    $$SRCDIR/calendareventmodification.cpp \
--    $$SRCDIR/calendarchangeinformation.cpp \
 -    $$SRCDIR/calendarutils.cpp \
 -    $$SRCDIR/calendarimportmodel.cpp \
 -    $$SRCDIR/calendarimportevent.cpp \
@@ -432,6 +376,7 @@ index f728109..0000000
 -    $$SRCDIR/calendarevent.h \
 -    $$SRCDIR/calendareventoccurrence.h \
 -    $$SRCDIR/calendaragendamodel.h \
+-    $$SRCDIR/calendareventlistmodel.h \
 -    $$SRCDIR/calendarapi.h \
 -    $$SRCDIR/calendareventquery.h \
 -    $$SRCDIR/calendarinvitationquery.h \
@@ -441,7 +386,6 @@ index f728109..0000000
 -    $$SRCDIR/calendardata.h \
 -    $$SRCDIR/calendarnotebookquery.h \
 -    $$SRCDIR/calendareventmodification.h \
--    $$SRCDIR/calendarchangeinformation.h \
 -    $$SRCDIR/calendarutils.h \
 -    $$SRCDIR/calendarimportmodel.h \
 -    $$SRCDIR/calendarimportevent.h \
@@ -454,14 +398,15 @@ index f728109..0000000
 -OBJECTS_DIR = $$PWD/.obj
 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
 new file mode 100644
-index 0000000..238e21f
+index 0000000..b0f453b
 --- /dev/null
 +++ b/tests/CMakeLists.txt
-@@ -0,0 +1,4 @@
+@@ -0,0 +1,5 @@
 +enable_testing()
 +
 +add_subdirectory(tst_calendarevent)
 +add_subdirectory(tst_calendarmanager)
++add_subdirectory(tst_calendaragendamodel)
 diff --git a/tests/common.pri b/tests/common.pri
 deleted file mode 100644
 index bab74e7..0000000
@@ -479,26 +424,80 @@ index bab74e7..0000000
 -target.path = /opt/tests/nemo-qml-plugins-qt5/calendar
 diff --git a/tests/tests.pro b/tests/tests.pro
 deleted file mode 100644
-index 248d80a..0000000
+index 8405ea0..0000000
 --- a/tests/tests.pro
 +++ /dev/null
-@@ -1,10 +0,0 @@
+@@ -1,11 +0,0 @@
 -TEMPLATE = subdirs
 -SUBDIRS = \
 -    tst_calendarmanager \
--    tst_calendarevent
+-    tst_calendarevent \
+-    tst_calendaragendamodel
 -
 -tests_xml.path = /opt/tests/nemo-qml-plugins-qt5/calendar
 -tests_xml.files = tests.xml
 -INSTALLS += tests_xml
 -
 -OTHER_FILES += tests.xml
+diff --git a/tests/tests.xml b/tests/tests.xml
+deleted file mode 100644
+index 2b91b34..0000000
+--- a/tests/tests.xml
++++ /dev/null
+@@ -1,16 +0,0 @@
+-<?xml version="1.0" encoding="UTF-8"?>
+-<testdefinition version="1.0">
+-  <suite name="nemo-qml-plugins-calendar-qt5-tests" domain="mw">
+-    <set name="unit-tests" feature="calendar mw">
+-      <case manual="false" name="calendarmanager">
+-        <step>rm -f /tmp/testdb; SQLITESTORAGEDB=/tmp/testdb /usr/sbin/run-blts-root /bin/su $USER -g privileged -c /opt/tests/nemo-qml-plugins-qt5/calendar/tst_calendarmanager</step>
+-      </case>
+-      <case manual="false" name="calendarevent">
+-        <step>rm -f /tmp/testdb; SQLITESTORAGEDB=/tmp/testdb MKCAL_PLUGIN_DIR=/opt/tests/nemo-qml-plugins-qt5/calendar/plugins /usr/sbin/run-blts-root /bin/su $USER -g privileged -c /opt/tests/nemo-qml-plugins-qt5/calendar/tst_calendarevent</step>
+-      </case>
+-      <case manual="false" name="calendaragendamodel">
+-        <step>rm -f /tmp/testdb; SQLITESTORAGEDB=/tmp/testdb /usr/sbin/run-blts-root /bin/su $USER -g privileged -c /opt/tests/nemo-qml-plugins-qt5/calendar/tst_calendaragendamodel</step>
+-      </case>
+-    </set>
+-  </suite>
+-</testdefinition>
+diff --git a/tests/tst_calendaragendamodel/CMakeLists.txt b/tests/tst_calendaragendamodel/CMakeLists.txt
+new file mode 100644
+index 0000000..09cfa06
+--- /dev/null
++++ b/tests/tst_calendaragendamodel/CMakeLists.txt
+@@ -0,0 +1,15 @@
++set(SRC tst_calendaragendamodel.cpp)
++
++add_executable(tst_calendaragendamodel ${SRC})
++
++target_include_directories(tst_calendaragendamodel PRIVATE
++	${PROJECT_SOURCE_DIR}/src
++	${TARGET_MOC_DIR})
++
++target_link_libraries(tst_calendaragendamodel
++	Qt5::Qml
++	Qt5::Test
++	KF5::CalendarCore
++	nemocalendar)
++
++add_test(tst_calendaragendamodel tst_calendaragendamodel)
+diff --git a/tests/tst_calendaragendamodel/tst_calendaragendamodel.pro b/tests/tst_calendaragendamodel/tst_calendaragendamodel.pro
+deleted file mode 100644
+index d9b67f3..0000000
+--- a/tests/tst_calendaragendamodel/tst_calendaragendamodel.pro
++++ /dev/null
+@@ -1,4 +0,0 @@
+-include(../common.pri)
+-
+-TARGET = tst_calendaragendamodel
+-SOURCES += tst_calendaragendamodel.cpp
 diff --git a/tests/tst_calendarevent/CMakeLists.txt b/tests/tst_calendarevent/CMakeLists.txt
 new file mode 100644
-index 0000000..70c0ef6
+index 0000000..50f49f5
 --- /dev/null
 +++ b/tests/tst_calendarevent/CMakeLists.txt
-@@ -0,0 +1,15 @@
+@@ -0,0 +1,17 @@
 +set(SRC tst_calendarevent.cpp)
 +
 +add_executable(tst_calendarevent ${SRC})
@@ -514,16 +513,70 @@ index 0000000..70c0ef6
 +	nemocalendar)
 +
 +add_test(tst_calendarevent tst_calendarevent)
++
++add_subdirectory(test_plugin)
+diff --git a/tests/tst_calendarevent/test_plugin/CMakeLists.txt b/tests/tst_calendarevent/test_plugin/CMakeLists.txt
+new file mode 100644
+index 0000000..9188446
+--- /dev/null
++++ b/tests/tst_calendarevent/test_plugin/CMakeLists.txt
+@@ -0,0 +1,13 @@
++set(SRC test_plugin.cpp)
++
++add_library(tst_calendarevent_plugin ${SRC})
++
++target_include_directories(tst_calendarevent_plugin PRIVATE
++	${PROJECT_SOURCE_DIR}/src
++	${TARGET_MOC_DIR})
++
++target_link_libraries(tst_calendarevent_plugin
++	Qt5::Qml
++	Qt5::Test
++	KF5::CalendarCore
++	PkgConfig::MKCAL)
+diff --git a/tests/tst_calendarevent/test_plugin/test_plugin.pro b/tests/tst_calendarevent/test_plugin/test_plugin.pro
+deleted file mode 100644
+index 0ec993f..0000000
+--- a/tests/tst_calendarevent/test_plugin/test_plugin.pro
++++ /dev/null
+@@ -1,16 +0,0 @@
+-TARGET = testplugin
+-
+-TEMPLATE = lib
+-CONFIG += qt plugin hide_symbols
+-
+-QT -= gui
+-
+-target.path = /opt/tests/nemo-qml-plugins-qt5/calendar/plugins
+-PKGCONFIG += KF5CalendarCore libmkcal-qt5
+-
+-INSTALLS += target
+-
+-CONFIG += link_pkgconfig
+-
+-SOURCES += test_plugin.cpp
+-HEADERS += test_plugin.h
 diff --git a/tests/tst_calendarevent/tst_calendarevent.pro b/tests/tst_calendarevent/tst_calendarevent.pro
 deleted file mode 100644
-index c9b0931..0000000
+index a2d5722..0000000
 --- a/tests/tst_calendarevent/tst_calendarevent.pro
 +++ /dev/null
 @@ -1,4 +0,0 @@
+-TEMPLATE = subdirs
+-SUBDIRS = \
+-    test_plugin \
+-    tst_calendareventbin.pro
+diff --git a/tests/tst_calendarevent/tst_calendareventbin.pro b/tests/tst_calendarevent/tst_calendareventbin.pro
+deleted file mode 100644
+index b52729e..0000000
+--- a/tests/tst_calendarevent/tst_calendareventbin.pro
++++ /dev/null
+@@ -1,5 +0,0 @@
 -include(../common.pri)
 -
 -TARGET = tst_calendarevent
 -SOURCES += tst_calendarevent.cpp
+-HEADERS += test_plugin_interface.h
 diff --git a/tests/tst_calendarmanager/CMakeLists.txt b/tests/tst_calendarmanager/CMakeLists.txt
 new file mode 100644
 index 0000000..66c959f
@@ -602,6 +655,3 @@ index 1827543..0000000
 @@ -1,2 +0,0 @@
 -TEMPLATE=subdirs
 -SUBDIRS+=icalconverter
--- 
-2.31.1
-
diff --git a/community/nemo-qml-plugin-calendar/1.patch b/community/nemo-qml-plugin-calendar/1.patch
new file mode 100644
index 000000000000..2c67d75e0dd0
--- /dev/null
+++ b/community/nemo-qml-plugin-calendar/1.patch
@@ -0,0 +1,722 @@
+From cd58bbf4923c3b241bf0a8ce5b768cf95a4fdd91 Mon Sep 17 00:00:00 2001
+From: Bart Ribbers <bribbers@disroot.org>
+Date: Sun, 18 Apr 2021 17:22:02 +0200
+Subject: [PATCH] Port to CMake
+
+qmake is slowly being deprecated by Qt (they don't use it themselves
+anymore from Qt6 and onwards) and they recommend using CMake instead.
+---
+ .gitignore                                    |  7 +-
+ CMakeLists.txt                                | 51 ++++++++++++++
+ calendar.pro                                  |  7 --
+ lightweight/CMakeLists.txt                    |  2 +
+ .../calendardataservice/CMakeLists.txt        | 23 ++++++
+ .../calendardataservice.pro                   | 45 ------------
+ .../calendareventsmodel/CMakeLists.txt        | 23 ++++++
+ .../calendareventsmodel.pro                   | 34 ---------
+ lightweight/lightweight.pro                   |  2 -
+ src/CMakeLists.txt                            | 62 ++++++++++++++++
+ src/src.pro                                   | 70 -------------------
+ tests/CMakeLists.txt                          |  5 ++
+ tests/common.pri                              |  9 ---
+ tests/tests.pro                               | 11 ---
+ tests/tests.xml                               | 16 -----
+ tests/tst_calendaragendamodel/CMakeLists.txt  | 15 ++++
+ .../tst_calendaragendamodel.pro               |  4 --
+ tests/tst_calendarevent/CMakeLists.txt        | 17 +++++
+ .../test_plugin/CMakeLists.txt                | 13 ++++
+ .../test_plugin/test_plugin.pro               | 16 -----
+ tests/tst_calendarevent/tst_calendarevent.pro |  4 --
+ .../tst_calendareventbin.pro                  |  5 --
+ tests/tst_calendarmanager/CMakeLists.txt      | 15 ++++
+ .../tst_calendarmanager.pro                   |  4 --
+ tools/CMakeLists.txt                          |  1 +
+ tools/icalconverter/CMakeLists.txt            | 10 +++
+ tools/icalconverter/icalconverter.pro         | 10 ---
+ tools/tools.pro                               |  2 -
+ 28 files changed, 238 insertions(+), 245 deletions(-)
+ create mode 100644 CMakeLists.txt
+ delete mode 100644 calendar.pro
+ create mode 100644 lightweight/CMakeLists.txt
+ create mode 100644 lightweight/calendardataservice/CMakeLists.txt
+ delete mode 100644 lightweight/calendardataservice/calendardataservice.pro
+ create mode 100644 lightweight/calendareventsmodel/CMakeLists.txt
+ delete mode 100644 lightweight/calendareventsmodel/calendareventsmodel.pro
+ delete mode 100644 lightweight/lightweight.pro
+ create mode 100644 src/CMakeLists.txt
+ delete mode 100644 src/src.pro
+ create mode 100644 tests/CMakeLists.txt
+ delete mode 100644 tests/common.pri
+ delete mode 100644 tests/tests.pro
+ delete mode 100644 tests/tests.xml
+ create mode 100644 tests/tst_calendaragendamodel/CMakeLists.txt
+ delete mode 100644 tests/tst_calendaragendamodel/tst_calendaragendamodel.pro
+ create mode 100644 tests/tst_calendarevent/CMakeLists.txt
+ create mode 100644 tests/tst_calendarevent/test_plugin/CMakeLists.txt
+ delete mode 100644 tests/tst_calendarevent/test_plugin/test_plugin.pro
+ delete mode 100644 tests/tst_calendarevent/tst_calendarevent.pro
+ delete mode 100644 tests/tst_calendarevent/tst_calendareventbin.pro
+ create mode 100644 tests/tst_calendarmanager/CMakeLists.txt
+ delete mode 100644 tests/tst_calendarmanager/tst_calendarmanager.pro
+ create mode 100644 tools/CMakeLists.txt
+ create mode 100644 tools/icalconverter/CMakeLists.txt
+ delete mode 100644 tools/icalconverter/icalconverter.pro
+ delete mode 100644 tools/tools.pro
+
+diff --git a/.gitignore b/.gitignore
+index 7fdc54b..2d578b4 100644
+--- a/.gitignore
++++ b/.gitignore
+@@ -1,13 +1,8 @@
+ # Build artefacts
+ *.o
+ *.so
+-/lightweight/calendardataservice/calendardataservice
+-/tests/tst_calendarevent/tst_calendarevent
+-/tests/tst_calendarmanager/tst_calendarmanager
+-/tests/tst_calendaragendamodel/tst_calendaragendamodel
+-/tests/tst_calendarevent/Makefile.tst_calendareventbin
+-/tools/icalconverter/icalconverter
+ /RPMS
++build
+ 
+ # Generated sources
+ Makefile
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+new file mode 100644
+index 0000000..97c268c
+--- /dev/null
++++ b/CMakeLists.txt
+@@ -0,0 +1,51 @@
++cmake_minimum_required(VERSION 3.16.0)
++
++project(nemo-qml-plugin-calendar)
++
++set(CMAKE_AUTOMOC ON)
++set(CMAKE_AUTORCC ON)
++set(CMAKE_AUTOUIC ON)
++
++set(CMAKE_INCLUDE_CURRENT_DIR ON)
++
++include(FindPkgConfig)
++include(FeatureSummary)
++include(GNUInstallDirs)
++include(CTest)
++
++set(INSTALL_QML_IMPORT_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/qt/qml"
++	CACHE PATH "Custom QML import installation directory")
++
++find_package(PkgConfig REQUIRED)
++find_package(ECM REQUIRED NO_MODULE)
++set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
++
++set(QT_MIN_VERSION "5.6.0")
++find_package(Qt5 ${QT_MIN_VERSION} COMPONENTS DBus Gui Qml Concurrent Test REQUIRED)
++find_package(KF5 COMPONENTS CalendarCore REQUIRED)
++
++pkg_check_modules(MKCAL libmkcal-qt5 IMPORTED_TARGET REQUIRED)
++set_property(GLOBAL APPEND PROPERTY _CMAKE_libmkcal-qt5_TYPE REQUIRED)
++pkg_check_modules(ACCOUNTS accounts-qt5 IMPORTED_TARGET REQUIRED)
++set_property(GLOBAL APPEND PROPERTY _CMAKE_accounts-qt5_TYPE REQUIRED)
++
++if(MKCAL_FOUND)
++	set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND libmkcal-qt5)
++else()
++	set_property(GLOBAL APPEND PROPERTY PACKAGES_NOT_FOUND libmkcal-qt5)
++endif()
++if(ACCOUNTS_FOUND)
++	set_property(GLOBAL APPEND PROPERTY PACKAGES_FOUND accounts-qt5)
++else()
++	set_property(GLOBAL APPEND PROPERTY PACKAGES_NOT_FOUND accounts-qt5)
++endif()
++
++add_subdirectory(src)
++add_subdirectory(lightweight)
++add_subdirectory(tools)
++
++if(BUILD_TESTING)
++	add_subdirectory(tests)
++endif()
++
++feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
+diff --git a/calendar.pro b/calendar.pro
+deleted file mode 100644
+index 588555a..0000000
+--- a/calendar.pro
++++ /dev/null
+@@ -1,7 +0,0 @@
+-TEMPLATE = subdirs
+-SUBDIRS = src tests lightweight tools
+-
+-tests.depends = src
+-tools.depends = src
+-
+-OTHER_FILES += rpm/*
+diff --git a/lightweight/CMakeLists.txt b/lightweight/CMakeLists.txt
+new file mode 100644
+index 0000000..4fff204
+--- /dev/null
++++ b/lightweight/CMakeLists.txt
+@@ -0,0 +1,2 @@
++add_subdirectory(calendardataservice)
++add_subdirectory(calendareventsmodel)
+diff --git a/lightweight/calendardataservice/CMakeLists.txt b/lightweight/calendardataservice/CMakeLists.txt
+new file mode 100644
+index 0000000..36425cf
+--- /dev/null
++++ b/lightweight/calendardataservice/CMakeLists.txt
+@@ -0,0 +1,23 @@
++set(SRC
++	main.cpp
++	calendardataservice.cpp
++	calendardataserviceadaptor.cpp
++	../common/eventdata.cpp)
++set(HEADERS
++	calendardataservice.h
++	calendardataserviceadaptor.h
++	../common/eventdata.h)
++
++add_executable(calendardataservice ${SRC} ${HEADERS})
++target_link_libraries(calendardataservice
++	Qt5::Qml
++	Qt5::DBus
++	KF5::CalendarCore
++	mkcal-qt5
++	accounts-qt5
++	nemocalendar)
++
++install(TARGETS calendardataservice
++	DESTINATION ${CMAKE_INSTALL_BINDIR})
++install(FILES org.nemomobile.calendardataservice.service
++	DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/services)
+diff --git a/lightweight/calendardataservice/calendardataservice.pro b/lightweight/calendardataservice/calendardataservice.pro
+deleted file mode 100644
+index a311951..0000000
+--- a/lightweight/calendardataservice/calendardataservice.pro
++++ /dev/null
+@@ -1,45 +0,0 @@
+-TEMPLATE = app
+-TARGET = calendardataservice
+-target.path = /usr/bin
+-
+-QT += qml dbus
+-QT -= gui
+-
+-CONFIG += link_pkgconfig
+-PKGCONFIG += KF5CalendarCore libmkcal-qt5 accounts-qt5
+-
+-HEADERS += \
+-    calendardataservice.h \
+-    calendardataserviceadaptor.h \
+-    ../common/eventdata.h \
+-    ../../src/calendaragendamodel.h \
+-    ../../src/calendareventlistmodel.h \
+-    ../../src/calendarmanager.h \
+-    ../../src/calendarworker.h \
+-    ../../src/calendareventoccurrence.h \
+-    ../../src/calendarevent.h \
+-    ../../src/calendareventquery.h \
+-    ../../src/calendarinvitationquery.h \
+-    ../../src/calendarutils.h
+-
+-SOURCES += \
+-    calendardataservice.cpp \
+-    calendardataserviceadaptor.cpp \
+-    ../common/eventdata.cpp \
+-    ../../src/calendaragendamodel.cpp \
+-    ../../src/calendareventlistmodel.cpp \
+-    ../../src/calendarmanager.cpp \
+-    ../../src/calendarworker.cpp \
+-    ../../src/calendareventoccurrence.cpp \
+-    ../../src/calendarevent.cpp \
+-    ../../src/calendareventquery.cpp \
+-    ../../src/calendarinvitationquery.cpp \
+-    ../../src/calendarutils.cpp \
+-    main.cpp
+-
+-dbus_service.path = /usr/share/dbus-1/services/
+-dbus_service.files = org.nemomobile.calendardataservice.service
+-
+-INSTALLS += target dbus_service
+-
+-OTHER_FILES += *.service *.xml
+diff --git a/lightweight/calendareventsmodel/CMakeLists.txt b/lightweight/calendareventsmodel/CMakeLists.txt
+new file mode 100644
+index 0000000..c29c1dd
+--- /dev/null
++++ b/lightweight/calendareventsmodel/CMakeLists.txt
+@@ -0,0 +1,23 @@
++set(PLUGIN_IMPORT_PATH ${INSTALL_QML_IMPORT_DIR}/org/nemomobile/calendar/lightweight)
++
++set(SRC
++	calendardataserviceproxy.cpp
++	calendareventsmodel.cpp
++	plugin.cpp
++	../common/eventdata.cpp)
++set(HEADERS
++	calendardataserviceproxy.h
++	calendareventsmodel.h
++	../common/eventdata.h)
++
++add_library(calendareventsmodel SHARED ${SRC} ${HEADERS})
++
++target_link_libraries(calendareventsmodel
++	Qt5::Gui
++	Qt5::Qml
++	Qt5::DBus)
++
++install(TARGETS calendareventsmodel
++	DESTINATION ${PLUGIN_IMPORT_PATH})
++install(FILES qmldir plugins.qmltypes
++	DESTINATION ${PLUGIN_IMPORT_PATH})
+diff --git a/lightweight/calendareventsmodel/calendareventsmodel.pro b/lightweight/calendareventsmodel/calendareventsmodel.pro
+deleted file mode 100644
+index 1016304..0000000
+--- a/lightweight/calendareventsmodel/calendareventsmodel.pro
++++ /dev/null
+@@ -1,34 +0,0 @@
+-TARGET = nemocalendarwidget
+-PLUGIN_IMPORT_PATH = org/nemomobile/calendar/lightweight
+-
+-TEMPLATE = lib
+-CONFIG += qt plugin hide_symbols
+-
+-QT += qml dbus
+-
+-target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH
+-INSTALLS += target
+-
+-qmldir.files += qmldir plugins.qmltypes
+-qmldir.path +=  $$target.path
+-INSTALLS += qmldir
+-
+-qmltypes.commands = qmlplugindump -nonrelocatable org.nemomobile.calendar.lightweight 1.0 > $$PWD/plugins.qmltypes
+-QMAKE_EXTRA_TARGETS += qmltypes
+-
+-isEmpty(SRCDIR) SRCDIR = "."
+-SOURCES += \
+-    calendardataserviceproxy.cpp \
+-    calendareventsmodel.cpp \
+-    ../common/eventdata.cpp \
+-    plugin.cpp
+-
+-HEADERS += \
+-    calendardataserviceproxy.h \
+-    calendareventsmodel.h \
+-    ../common/eventdata.h
+-
+-OTHER_FILES += qmldir
+-
+-MOC_DIR = $$PWD/.moc
+-OBJECTS_DIR = $$PWD/.obj
+diff --git a/lightweight/lightweight.pro b/lightweight/lightweight.pro
+deleted file mode 100644
+index 6fe91a6..0000000
+--- a/lightweight/lightweight.pro
++++ /dev/null
+@@ -1,2 +0,0 @@
+-TEMPLATE = subdirs
+-SUBDIRS = calendardataservice calendareventsmodel
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+new file mode 100644
+index 0000000..901c1dd
+--- /dev/null
++++ b/src/CMakeLists.txt
+@@ -0,0 +1,62 @@
++set(PLUGIN_IMPORT_PATH ${INSTALL_QML_IMPORT_DIR}/org/nemomobile/calendar)
++set(CMAKE_INSTALL_RPATH "${PLUGIN_IMPORT_PATH}")
++
++set(SRC
++	plugin.cpp
++	calendarevent.cpp
++	calendareventoccurrence.cpp
++	calendaragendamodel.cpp
++	calendarapi.cpp
++	calendareventquery.cpp
++	calendarinvitationquery.cpp
++	calendarnotebookmodel.cpp
++	calendarmanager.cpp
++	calendarworker.cpp
++	calendarnotebookquery.cpp
++	calendareventmodification.cpp	
++	calendarutils.cpp
++	calendarimportmodel.cpp
++	calendarimportevent.cpp
++	calendarcontactmodel.cpp
++	calendarattendeemodel.cpp
++	calendareventlistmodel.cpp)
++set(HEADERS
++	calendarevent.h
++	calendareventoccurrence.h
++	calendaragendamodel.h
++	calendarapi.h
++	calendareventquery.h
++	calendarinvitationquery.h
++	calendarnotebookmodel.h
++	calendarmanager.h
++	calendarworker.h
++	calendardata.h
++	calendarnotebookquery.h
++	calendareventmodification.h	
++	calendarutils.h
++	calendarimportmodel.h
++	calendarimportevent.h
++	calendarcontactmodel.h
++	calendarattendeemodel.h
++	calendareventlistmodel.h)
++
++add_library(nemocalendar SHARED ${SRC} ${HEADERS})
++
++set(TARGET_MOC_DIR ${CMAKE_CURRENT_BINARY_DIR}/calendar_autogen)
++set_target_properties(nemocalendar PROPERTIES AUTOGEN_BUILD_DIR ${TARGET_MOC_DIR})
++
++# For use in other parts of the build
++set(TARGET_MOC_DIR ${TARGET_MOC_DIR}/include PARENT_SCOPE)
++
++target_link_libraries(nemocalendar
++	Qt5::Qml
++	Qt5::Concurrent
++	KF5::CalendarCore
++	PkgConfig::MKCAL
++	PkgConfig::ACCOUNTS)
++
++# Install the library
++install(TARGETS nemocalendar
++	LIBRARY DESTINATION ${PLUGIN_IMPORT_PATH})
++install(FILES qmldir plugins.qmltypes
++	DESTINATION ${PLUGIN_IMPORT_PATH})
+diff --git a/src/src.pro b/src/src.pro
+deleted file mode 100644
+index a6de4e5..0000000
+--- a/src/src.pro
++++ /dev/null
+@@ -1,70 +0,0 @@
+-TARGET = nemocalendar
+-PLUGIN_IMPORT_PATH = org/nemomobile/calendar
+-
+-TEMPLATE = lib
+-CONFIG += qt plugin hide_symbols
+-
+-QT += qml concurrent
+-QT -= gui
+-QMAKE_CXXFLAGS += -Werror
+-
+-target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH
+-PKGCONFIG += KF5CalendarCore libmkcal-qt5 accounts-qt5
+-
+-INSTALLS += target
+-
+-qmldir.files += qmldir plugins.qmltypes
+-qmldir.path +=  $$target.path
+-INSTALLS += qmldir
+-
+-qmltypes.commands = qmlplugindump -noinstantiate -nonrelocatable org.nemomobile.calendar 1.0 > $$PWD/plugins.qmltypes
+-QMAKE_EXTRA_TARGETS += qmltypes
+-
+-CONFIG += link_pkgconfig
+-
+-isEmpty(SRCDIR) SRCDIR = "."
+-
+-SOURCES += \
+-    $$SRCDIR/plugin.cpp \
+-    $$SRCDIR/calendarevent.cpp \
+-    $$SRCDIR/calendareventoccurrence.cpp \
+-    $$SRCDIR/calendaragendamodel.cpp \
+-    $$SRCDIR/calendareventlistmodel.cpp \
+-    $$SRCDIR/calendarapi.cpp \
+-    $$SRCDIR/calendareventquery.cpp \
+-    $$SRCDIR/calendarinvitationquery.cpp \
+-    $$SRCDIR/calendarnotebookmodel.cpp \
+-    $$SRCDIR/calendarmanager.cpp \
+-    $$SRCDIR/calendarworker.cpp \
+-    $$SRCDIR/calendarnotebookquery.cpp \
+-    $$SRCDIR/calendareventmodification.cpp \
+-    $$SRCDIR/calendarutils.cpp \
+-    $$SRCDIR/calendarimportmodel.cpp \
+-    $$SRCDIR/calendarimportevent.cpp \
+-    $$SRCDIR/calendarcontactmodel.cpp \
+-    $$SRCDIR/calendarattendeemodel.cpp
+-
+-HEADERS += \
+-    $$SRCDIR/calendarevent.h \
+-    $$SRCDIR/calendareventoccurrence.h \
+-    $$SRCDIR/calendaragendamodel.h \
+-    $$SRCDIR/calendareventlistmodel.h \
+-    $$SRCDIR/calendarapi.h \
+-    $$SRCDIR/calendareventquery.h \
+-    $$SRCDIR/calendarinvitationquery.h \
+-    $$SRCDIR/calendarnotebookmodel.h \
+-    $$SRCDIR/calendarmanager.h \
+-    $$SRCDIR/calendarworker.h \
+-    $$SRCDIR/calendardata.h \
+-    $$SRCDIR/calendarnotebookquery.h \
+-    $$SRCDIR/calendareventmodification.h \
+-    $$SRCDIR/calendarutils.h \
+-    $$SRCDIR/calendarimportmodel.h \
+-    $$SRCDIR/calendarimportevent.h \
+-    $$SRCDIR/calendarcontactmodel.h \
+-    $$SRCDIR/calendarattendeemodel.h
+-
+-OTHER_FILES += qmldir
+-
+-MOC_DIR = $$PWD/.moc
+-OBJECTS_DIR = $$PWD/.obj
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+new file mode 100644
+index 0000000..b0f453b
+--- /dev/null
++++ b/tests/CMakeLists.txt
+@@ -0,0 +1,5 @@
++enable_testing()
++
++add_subdirectory(tst_calendarevent)
++add_subdirectory(tst_calendarmanager)
++add_subdirectory(tst_calendaragendamodel)
+diff --git a/tests/common.pri b/tests/common.pri
+deleted file mode 100644
+index bab74e7..0000000
+--- a/tests/common.pri
++++ /dev/null
+@@ -1,9 +0,0 @@
+-SRCDIR = ../../src/
+-include(../src/src.pro)
+-INCLUDEPATH += $$SRCDIR
+-DEPENDPATH = $$INCLUDEPATH
+-QT += testlib
+-TEMPLATE = app
+-CONFIG -= app_bundle
+-
+-target.path = /opt/tests/nemo-qml-plugins-qt5/calendar
+diff --git a/tests/tests.pro b/tests/tests.pro
+deleted file mode 100644
+index 8405ea0..0000000
+--- a/tests/tests.pro
++++ /dev/null
+@@ -1,11 +0,0 @@
+-TEMPLATE = subdirs
+-SUBDIRS = \
+-    tst_calendarmanager \
+-    tst_calendarevent \
+-    tst_calendaragendamodel
+-
+-tests_xml.path = /opt/tests/nemo-qml-plugins-qt5/calendar
+-tests_xml.files = tests.xml
+-INSTALLS += tests_xml
+-
+-OTHER_FILES += tests.xml
+diff --git a/tests/tests.xml b/tests/tests.xml
+deleted file mode 100644
+index 2b91b34..0000000
+--- a/tests/tests.xml
++++ /dev/null
+@@ -1,16 +0,0 @@
+-<?xml version="1.0" encoding="UTF-8"?>
+-<testdefinition version="1.0">
+-  <suite name="nemo-qml-plugins-calendar-qt5-tests" domain="mw">
+-    <set name="unit-tests" feature="calendar mw">
+-      <case manual="false" name="calendarmanager">
+-        <step>rm -f /tmp/testdb; SQLITESTORAGEDB=/tmp/testdb /usr/sbin/run-blts-root /bin/su $USER -g privileged -c /opt/tests/nemo-qml-plugins-qt5/calendar/tst_calendarmanager</step>
+-      </case>
+-      <case manual="false" name="calendarevent">
+-        <step>rm -f /tmp/testdb; SQLITESTORAGEDB=/tmp/testdb MKCAL_PLUGIN_DIR=/opt/tests/nemo-qml-plugins-qt5/calendar/plugins /usr/sbin/run-blts-root /bin/su $USER -g privileged -c /opt/tests/nemo-qml-plugins-qt5/calendar/tst_calendarevent</step>
+-      </case>
+-      <case manual="false" name="calendaragendamodel">
+-        <step>rm -f /tmp/testdb; SQLITESTORAGEDB=/tmp/testdb /usr/sbin/run-blts-root /bin/su $USER -g privileged -c /opt/tests/nemo-qml-plugins-qt5/calendar/tst_calendaragendamodel</step>
+-      </case>
+-    </set>
+-  </suite>
+-</testdefinition>
+diff --git a/tests/tst_calendaragendamodel/CMakeLists.txt b/tests/tst_calendaragendamodel/CMakeLists.txt
+new file mode 100644
+index 0000000..09cfa06
+--- /dev/null
++++ b/tests/tst_calendaragendamodel/CMakeLists.txt
+@@ -0,0 +1,15 @@
++set(SRC tst_calendaragendamodel.cpp)
++
++add_executable(tst_calendaragendamodel ${SRC})
++
++target_include_directories(tst_calendaragendamodel PRIVATE
++	${PROJECT_SOURCE_DIR}/src
++	${TARGET_MOC_DIR})
++
++target_link_libraries(tst_calendaragendamodel
++	Qt5::Qml
++	Qt5::Test
++	KF5::CalendarCore
++	nemocalendar)
++
++add_test(tst_calendaragendamodel tst_calendaragendamodel)
+diff --git a/tests/tst_calendaragendamodel/tst_calendaragendamodel.pro b/tests/tst_calendaragendamodel/tst_calendaragendamodel.pro
+deleted file mode 100644
+index d9b67f3..0000000
+--- a/tests/tst_calendaragendamodel/tst_calendaragendamodel.pro
++++ /dev/null
+@@ -1,4 +0,0 @@
+-include(../common.pri)
+-
+-TARGET = tst_calendaragendamodel
+-SOURCES += tst_calendaragendamodel.cpp
+diff --git a/tests/tst_calendarevent/CMakeLists.txt b/tests/tst_calendarevent/CMakeLists.txt
+new file mode 100644
+index 0000000..50f49f5
+--- /dev/null
++++ b/tests/tst_calendarevent/CMakeLists.txt
+@@ -0,0 +1,17 @@
++set(SRC tst_calendarevent.cpp)
++
++add_executable(tst_calendarevent ${SRC})
++
++target_include_directories(tst_calendarevent PRIVATE
++	${PROJECT_SOURCE_DIR}/src
++	${TARGET_MOC_DIR})
++
++target_link_libraries(tst_calendarevent
++	Qt5::Qml
++	Qt5::Test
++	KF5::CalendarCore
++	nemocalendar)
++
++add_test(tst_calendarevent tst_calendarevent)
++
++add_subdirectory(test_plugin)
+diff --git a/tests/tst_calendarevent/test_plugin/CMakeLists.txt b/tests/tst_calendarevent/test_plugin/CMakeLists.txt
+new file mode 100644
+index 0000000..9188446
+--- /dev/null
++++ b/tests/tst_calendarevent/test_plugin/CMakeLists.txt
+@@ -0,0 +1,13 @@
++set(SRC test_plugin.cpp)
++
++add_library(tst_calendarevent_plugin ${SRC})
++
++target_include_directories(tst_calendarevent_plugin PRIVATE
++	${PROJECT_SOURCE_DIR}/src
++	${TARGET_MOC_DIR})
++
++target_link_libraries(tst_calendarevent_plugin
++	Qt5::Qml
++	Qt5::Test
++	KF5::CalendarCore
++	PkgConfig::MKCAL)
+diff --git a/tests/tst_calendarevent/test_plugin/test_plugin.pro b/tests/tst_calendarevent/test_plugin/test_plugin.pro
+deleted file mode 100644
+index 0ec993f..0000000
+--- a/tests/tst_calendarevent/test_plugin/test_plugin.pro
++++ /dev/null
+@@ -1,16 +0,0 @@
+-TARGET = testplugin
+-
+-TEMPLATE = lib
+-CONFIG += qt plugin hide_symbols
+-
+-QT -= gui
+-
+-target.path = /opt/tests/nemo-qml-plugins-qt5/calendar/plugins
+-PKGCONFIG += KF5CalendarCore libmkcal-qt5
+-
+-INSTALLS += target
+-
+-CONFIG += link_pkgconfig
+-
+-SOURCES += test_plugin.cpp
+-HEADERS += test_plugin.h
+diff --git a/tests/tst_calendarevent/tst_calendarevent.pro b/tests/tst_calendarevent/tst_calendarevent.pro
+deleted file mode 100644
+index a2d5722..0000000
+--- a/tests/tst_calendarevent/tst_calendarevent.pro
++++ /dev/null
+@@ -1,4 +0,0 @@
+-TEMPLATE = subdirs
+-SUBDIRS = \
+-    test_plugin \
+-    tst_calendareventbin.pro
+diff --git a/tests/tst_calendarevent/tst_calendareventbin.pro b/tests/tst_calendarevent/tst_calendareventbin.pro
+deleted file mode 100644
+index b52729e..0000000
+--- a/tests/tst_calendarevent/tst_calendareventbin.pro
++++ /dev/null
+@@ -1,5 +0,0 @@
+-include(../common.pri)
+-
+-TARGET = tst_calendarevent
+-SOURCES += tst_calendarevent.cpp
+-HEADERS += test_plugin_interface.h
+diff --git a/tests/tst_calendarmanager/CMakeLists.txt b/tests/tst_calendarmanager/CMakeLists.txt
+new file mode 100644
+index 0000000..66c959f
+--- /dev/null
++++ b/tests/tst_calendarmanager/CMakeLists.txt
+@@ -0,0 +1,15 @@
++set(SRC tst_calendarmanager.cpp)
++
++add_executable(tst_calendarmanager ${SRC})
++
++target_include_directories(tst_calendarmanager PRIVATE
++	${PROJECT_SOURCE_DIR}/src
++	${TARGET_MOC_DIR})
++
++target_link_libraries(tst_calendarmanager
++	Qt5::Qml
++	Qt5::Test
++	KF5::CalendarCore
++	nemocalendar)
++
++add_test(tst_calendarmanager tst_calendarmanager)
+diff --git a/tests/tst_calendarmanager/tst_calendarmanager.pro b/tests/tst_calendarmanager/tst_calendarmanager.pro
+deleted file mode 100644
+index ace2f6d..0000000
+--- a/tests/tst_calendarmanager/tst_calendarmanager.pro
++++ /dev/null
+@@ -1,4 +0,0 @@
+-include(../common.pri)
+-
+-TARGET = tst_calendarmanager
+-SOURCES += tst_calendarmanager.cpp
+diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
+new file mode 100644
+index 0000000..7d81e07
+--- /dev/null
++++ b/tools/CMakeLists.txt
+@@ -0,0 +1 @@
++add_subdirectory(icalconverter)
+diff --git a/tools/icalconverter/CMakeLists.txt b/tools/icalconverter/CMakeLists.txt
+new file mode 100644
+index 0000000..aa094ff
+--- /dev/null
++++ b/tools/icalconverter/CMakeLists.txt
+@@ -0,0 +1,10 @@
++set(SRC main.cpp)
++
++add_executable(icalconverter ${SRC})
++
++target_link_libraries(icalconverter
++	KF5::CalendarCore
++	PkgConfig::MKCAL)
++
++install(TARGETS icalconverter
++	DESTINATION ${CMAKE_INSTALL_BINDIR})
+diff --git a/tools/icalconverter/icalconverter.pro b/tools/icalconverter/icalconverter.pro
+deleted file mode 100644
+index fa373c2..0000000
+--- a/tools/icalconverter/icalconverter.pro
++++ /dev/null
+@@ -1,10 +0,0 @@
+-TEMPLATE=app
+-TARGET=icalconverter
+-QT-=gui
+-CONFIG += link_pkgconfig
+-PKGCONFIG += KF5CalendarCore libmkcal-qt5
+-QMAKE_CXXFLAGS += -fPIE -fvisibility=hidden -fvisibility-inlines-hidden
+-SOURCES+=main.cpp
+-
+-target.path = $$INSTALL_ROOT/usr/bin/
+-INSTALLS+=target
+diff --git a/tools/tools.pro b/tools/tools.pro
+deleted file mode 100644
+index 1827543..0000000
+--- a/tools/tools.pro
++++ /dev/null
+@@ -1,2 +0,0 @@
+-TEMPLATE=subdirs
+-SUBDIRS+=icalconverter
diff --git a/community/nemo-qml-plugin-calendar/APKBUILD b/community/nemo-qml-plugin-calendar/APKBUILD
index fbc3ff91f5d2..58e3888269de 100644
--- a/community/nemo-qml-plugin-calendar/APKBUILD
+++ b/community/nemo-qml-plugin-calendar/APKBUILD
@@ -1,7 +1,7 @@
 # Contributor: Bart Ribbers <bribbers@disroot.org>
 # Maintainer: Bart Ribbers <bribbers@disroot.org>
 pkgname=nemo-qml-plugin-calendar
-pkgver=0.6.21
+pkgver=0.6.46
 pkgrel=0
 pkgdesc="Nemo QML calendar plugin"
 url="https://github.com/sailfishos/nemo-qml-plugin-calendar"
@@ -15,25 +15,32 @@ makedepends="
 	mkcal-dev
 	qt5-qtbase-dev
 	qt5-qtdeclarative-dev
+	samurai
 	"
+checkdepends="xvfb-run"
 source="https://github.com/sailfishos/nemo-qml-plugin-calendar/archive/$pkgver/nemo-qml-plugin-calendar-$pkgver.tar.gz
 	0001-Port-to-CMake.patch
 	"
-options="!check"
+options="!check" # Broken
 
 build() {
-	cmake -B build \
-		-DCMAKE_BUILD_TYPE=None \
+	cmake -B build -G Ninja \
+		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
 		-DCMAKE_INSTALL_PREFIX=/usr \
 		-DINSTALL_QML_IMPORT_DIR=/usr/lib/qt5/qml
 	cmake --build build
 }
 
+check() {
+	cd build
+	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
+}
+
 package() {
 	DESTDIR="$pkgdir" cmake --install build
 }
 
 sha512sums="
-ec026bfe9df0262a1bb05084a93e38dff1c6661ad8e069d6dbf3a1173fd2d0f8b03e2bc7af4dd285cd2e692f1b83a7fa5fb8820e67bdbb36ec5398e73d721b64  nemo-qml-plugin-calendar-0.6.21.tar.gz
-80d80ef5b4fae6d15ff1447c4eb5c01c6d3b3eb992e46adc11d21353311f1cdd2a8cd4d08318f27f9934fb20549ae3e11bcb6cce60034a61ecbcf8279cf960c2  0001-Port-to-CMake.patch
+63e69f7dc0e9e8176b44de7c1f0ac18ab81cf50f494e1bbe478b01cc37207f72d7433e54c1deb5dfff01e35404a5df761fab7a5fdac8aa6db8afb16bb1fca3fd  nemo-qml-plugin-calendar-0.6.46.tar.gz
+97c43abf4e40dc058d4fa3fe1abdaa897264131f43e8256ba0d03473cf011edc24738016803f01a41eda575fdd1c0e554df9e12864b81fa3337b928e34f10278  0001-Port-to-CMake.patch
 "
-- 
GitLab