Skip to content

Commit

Permalink
[kf5-calendarcore] Update to use ECM 5.75.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcaliste committed Nov 3, 2020
1 parent 7eed689 commit 6f8437f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 157 deletions.
@@ -1,4 +1,4 @@
From 402d509b02197ae0d36224af6bbedd3b25bdede9 Mon Sep 17 00:00:00 2001
From ef3122d9e20f5a1b9079c93c8314f282d5dc7736 Mon Sep 17 00:00:00 2001
From: Christoph Lenggenhager <clenggenhager@gmail.com>
Date: Wed, 10 Jun 2015 17:34:12 +0200
Subject: [PATCH 1/3] Use UTC times when calculating the transition dates of
Expand All @@ -15,18 +15,18 @@ See https://github.com/mer-packages/kcalcore/pull/9 for discussion on this issue
1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/src/icaltimezones.cpp b/src/icaltimezones.cpp
index c6d88918d..fb62f62b9 100644
index 361988a16..f8ea6f86d 100644
--- a/src/icaltimezones.cpp
+++ b/src/icaltimezones.cpp
@@ -631,7 +631,6 @@ bool ICalTimeZoneParser::parsePhase(icalcomponent *c, bool daylight, ICalTimeZon
@@ -617,7 +617,6 @@ bool ICalTimeZoneParser::parsePhase(icalcomponent *c, bool daylight, ICalTimeZon
}

// Convert DTSTART to QDateTime, and from local time to UTC
- const QDateTime localStart = toQDateTime(dtstart); // local time
dtstart.second -= prevOffset;
#if defined(USE_ICAL_3)
dtstart = icaltime_convert_to_zone(dtstart, icaltimezone_get_utc_timezone());
@@ -692,21 +691,16 @@ bool ICalTimeZoneParser::parsePhase(icalcomponent *c, bool daylight, ICalTimeZon
@@ -678,21 +677,16 @@ bool ICalTimeZoneParser::parsePhase(icalcomponent *c, bool daylight, ICalTimeZon
ICalFormat icf;
ICalFormatImpl impl(&icf);
impl.readRecurrence(icalproperty_get_rrule(p), &r);
Expand Down Expand Up @@ -57,5 +57,5 @@ index c6d88918d..fb62f62b9 100644
break;
}
--
2.17.1
2.28.0

148 changes: 15 additions & 133 deletions rpm/0002-Adjust-for-lower-Qt-versions.patch
@@ -1,36 +1,26 @@
From c4a696ad8c4b8d51f6b46638a5b83618f5e00e7a Mon Sep 17 00:00:00 2001
From be90d546451837df25f944eed4f8f4e628598bbc Mon Sep 17 00:00:00 2001
From: Damien Caliste <dcaliste@free.fr>
Date: Tue, 14 May 2019 11:35:15 +0200
Subject: [PATCH 1/2] Adjust for lower Qt versions.
Subject: [PATCH 2/3] Adjust for lower Qt versions.

---
CMakeLists.txt | 6 +++---
CMakeLists.txt | 2 +-
autotests/testmemorycalendar.cpp | 2 +-
autotests/testrecurtodo.cpp | 5 +++++
src/CMakeLists.txt | 35 ++++++++++++++++----------------
src/calendar.cpp | 1 +
src/icalformat.cpp | 1 +
src/icalformat_p.cpp | 3 +++
src/memorycalendar.cpp | 4 ++--
src/occurrenceiterator.cpp | 1 +
src/recurrence.cpp | 2 --
src/recurrence.h | 5 -----
src/recurrencerule.cpp | 32 +++++++++++++++++++++++++++++
src/recurrencerule.cpp | 32 ++++++++++++++++++++++++++++++++
src/utils_p.h | 8 ++++++++
13 files changed, 75 insertions(+), 30 deletions(-)
10 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ecf1986ca..413cd71ee 100644
index 74f453288..829fe7dd1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,19 +5,19 @@ project(KCalendarCore VERSION ${KF5_VERSION})

# ECM setup
include(FeatureSummary)
-find_package(ECM 5.75.0 NO_MODULE)
+find_package(ECM 5.44.0 NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules")
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
@@ -11,7 +11,7 @@ feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKA

set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

Expand All @@ -39,15 +29,8 @@ index ecf1986ca..413cd71ee 100644

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

-include(ECMGenerateExportHeader)
+include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)

diff --git a/autotests/testmemorycalendar.cpp b/autotests/testmemorycalendar.cpp
index 77241eb43..6a424b2f1 100644
index 6a6910f5b..0b503f62f 100644
--- a/autotests/testmemorycalendar.cpp
+++ b/autotests/testmemorycalendar.cpp
@@ -121,7 +121,7 @@ void MemoryCalendarTest::testIncidences()
Expand All @@ -60,10 +43,10 @@ index 77241eb43..6a424b2f1 100644
QVERIFY(todo->locationIsRich());
cal->close();
diff --git a/autotests/testrecurtodo.cpp b/autotests/testrecurtodo.cpp
index a9d439888..6bacabff1 100644
index 9270c0c21..29204c830 100644
--- a/autotests/testrecurtodo.cpp
+++ b/autotests/testrecurtodo.cpp
@@ -149,7 +149,12 @@ void RecurTodoTest::testRecurTodo_data()
@@ -165,7 +165,12 @@ void RecurTodoTest::testRecurTodo_data()
QTest::addColumn<QDateTime>("dtdue");

// Can't use QDateTime::currentDateTimeUtc() due to milliseconds mismatching
Expand All @@ -76,66 +59,8 @@ index a9d439888..6bacabff1 100644
const QDateTime tomorrow = today.addDays(1);
const QDateTime invalid;

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b0630cdcd..92616cdf7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -41,23 +41,24 @@ ecm_qt_declare_logging_category(kcalcore_LIB_SRCS
HEADER kcalendarcore_debug.h
IDENTIFIER KCALCORE_LOG
CATEGORY_NAME kf.calendarcore
- OLD_CATEGORY_NAMES log_kcalcore org.kde.pim.kcalcore
- DESCRIPTION "KCalendarCore"
- EXPORT KCALENDARCORE
+# OLD_CATEGORY_NAMES log_kcalcore org.kde.pim.kcalcore
+# DESCRIPTION "KCalendarCore"
+# EXPORT KCALENDARCORE
)

add_library(KF5CalendarCore ${kcalcore_LIB_SRCS})
add_library(KF5::CalendarCore ALIAS KF5CalendarCore)

-ecm_generate_export_header(KF5CalendarCore
- BASE_NAME kcalendarcore
- GROUP_BASE_NAME KF
- VERSION ${KF5_VERSION}
- DEPRECATED_BASE_VERSION 0
- DEPRECATION_VERSIONS 5.64
- EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
-)
-
+#ecm_generate_export_header(KF5CalendarCore
+# BASE_NAME kcalendarcore
+# GROUP_BASE_NAME KF
+# VERSION ${KF5_VERSION}
+# DEPRECATED_BASE_VERSION 0
+# DEPRECATION_VERSIONS 5.64
+# EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT}
+#)
+generate_export_header(KF5CalendarCore
+ BASE_NAME kcalendarcore)

# backward compatibility with the old name
if (NOT KCALENDARCORE_NO_DEPRECATED_NAMESPACE)
@@ -163,11 +164,11 @@ if (NOT KCALENDARCORE_NO_DEPRECATED_NAMESPACE)
)
endif()

-ecm_qt_install_logging_categories(
- EXPORT KCALENDARCORE
- FILE kcalendarcore.categories
- DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
-)
+#ecm_qt_install_logging_categories(
+# EXPORT KCALENDARCORE
+# FILE kcalendarcore.categories
+# DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
+#)

ecm_generate_pri_file(BASE_NAME KCalendarCore LIB_NAME KF5CalendarCore DEPS "Core" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KCalendarCore/KCalendarCore)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
diff --git a/src/calendar.cpp b/src/calendar.cpp
index 267031ec5..87489a677 100644
index f81ba1783..f0d92bbcb 100644
--- a/src/calendar.cpp
+++ b/src/calendar.cpp
@@ -27,6 +27,7 @@
Expand All @@ -147,7 +72,7 @@ index 267031ec5..87489a677 100644
#include "kcalendarcore_debug.h"

diff --git a/src/icalformat.cpp b/src/icalformat.cpp
index 6ea563e9a..6593db302 100644
index 4c31c3143..fe372ba2d 100644
--- a/src/icalformat.cpp
+++ b/src/icalformat.cpp
@@ -22,6 +22,7 @@
Expand All @@ -159,7 +84,7 @@ index 6ea563e9a..6593db302 100644
#include <QSaveFile>
#include <QFile>
diff --git a/src/icalformat_p.cpp b/src/icalformat_p.cpp
index 62ab47db8..f1de95ac5 100644
index 51ebda04a..8683816fc 100644
--- a/src/icalformat_p.cpp
+++ b/src/icalformat_p.cpp
@@ -32,6 +32,7 @@
Expand All @@ -170,7 +95,7 @@ index 62ab47db8..f1de95ac5 100644

#include "kcalendarcore_debug.h"

@@ -2557,7 +2558,9 @@ QDateTime ICalFormatImpl::readICalDateTimeProperty(icalproperty *p, const ICalTi
@@ -2556,7 +2557,9 @@ QDateTime ICalFormatImpl::readICalDateTimeProperty(icalproperty *p, const ICalTi
break;
}
} //end of ICAL_X_PROPERTY
Expand Down Expand Up @@ -207,49 +132,6 @@ index 82d9964f9..76b352546 100644

#include <QDate>

diff --git a/src/recurrence.cpp b/src/recurrence.cpp
index a685a534f..7ac18ed95 100644
--- a/src/recurrence.cpp
+++ b/src/recurrence.cpp
@@ -137,7 +137,6 @@ bool Recurrence::operator==(const Recurrence &recurrence) const
return *d == *recurrence.d;
}

-#if KCALENDARCORE_BUILD_DEPRECATED_SINCE(5, 64)
Recurrence &Recurrence::operator=(const Recurrence &recurrence)
{
// check for self assignment
@@ -150,7 +149,6 @@ Recurrence &Recurrence::operator=(const Recurrence &recurrence)
QT_WARNING_POP
return *this;
}
-#endif

void Recurrence::addObserver(RecurrenceObserver *observer)
{
diff --git a/src/recurrence.h b/src/recurrence.h
index 2d728c138..720a2f02b 100644
--- a/src/recurrence.h
+++ b/src/recurrence.h
@@ -133,18 +133,13 @@ public:
return !operator==(r);
}

-#if KCALENDARCORE_BUILD_DEPRECATED_SINCE(5, 64)
/**
Assignment operator.
@param r the recurrence which will be assigned to this.
@deprecated Do not use, will be removed in KF6
@warning Broken implementation, do not use!
*/
- KCALENDARCORE_DEPRECATED_VERSION(5, 64, "Do not use")
Recurrence &operator=(const Recurrence &r);
-#else
- Recurrence &operator=(const Recurrence &r) = delete;
-#endif

/** Return the start date/time of the recurrence (Time for all-day recurrences will be 0:00).
@return the current start/time of the recurrence. */
diff --git a/src/recurrencerule.cpp b/src/recurrencerule.cpp
index cf009a6d9..5a70da143 100644
--- a/src/recurrencerule.cpp
Expand Down Expand Up @@ -394,5 +276,5 @@ index c2ae0e3e0..b205877d3 100644

#endif
--
2.17.1
2.28.0

8 changes: 4 additions & 4 deletions rpm/0003-Add-pkgconfig-packaging.patch
@@ -1,4 +1,4 @@
From b1f9685c59a4658a69f49a23914c50f921b6e555 Mon Sep 17 00:00:00 2001
From 096260fda4c824e721588943edec228ec793bc82 Mon Sep 17 00:00:00 2001
From: Damien Caliste <dcaliste@free.fr>
Date: Tue, 14 May 2019 13:30:00 +0200
Subject: [PATCH 3/3] Add pkgconfig packaging.
Expand All @@ -10,10 +10,10 @@ Subject: [PATCH 3/3] Add pkgconfig packaging.
create mode 100644 KF5CalendarCore.pc.in

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 873eb2ca7..283415226 100644
index 829fe7dd1..aae2c5615 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,4 +122,15 @@ endif()
@@ -120,4 +120,15 @@ if (NOT KCALENDARCORE_NO_DEPRECATED_NAMESPACE)
)
endif()

Expand Down Expand Up @@ -48,5 +48,5 @@ index 000000000..b17360158
+Libs: -L${libdir} @PRIVATE_LIBS@
+Cflags: -I${includedir}
--
2.17.1
2.28.0

24 changes: 9 additions & 15 deletions rpm/kf5-calendarcore.spec
@@ -1,10 +1,9 @@
Name: kf5-calendarcore
Summary: KDE calendar library
Version: 5.67.0
Version: 5.75.0
Release: 1
Group: System/Libraries
License: LGPLv2
URL: https://phabricator.kde.org/source/kcalcore
License: LGPLv2+ and BSD
URL: https://invent.kde.org/frameworks/kcalendarcore
Source0: %{name}-%{version}.tar.bz2
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
Expand All @@ -13,7 +12,7 @@ BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(libical)
BuildRequires: extra-cmake-modules >= 5.44.0
BuildRequires: extra-cmake-modules >= 5.75.0

Patch1: 0001-Use-UTC-times-when-calculating-the-transition-dates-.patch
Patch2: 0002-Adjust-for-lower-Qt-versions.patch
Expand All @@ -24,39 +23,34 @@ KDE Framework calendar core library

%package devel
Summary: Development files for kcalcore
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
This package contains the files necessary to develop
applications using %{name}

%prep
%setup -q -n %{name}-%{version}

%patch1 -d upstream -p1
%patch2 -d upstream -p1
%patch3 -d upstream -p1
%autosetup -p1 -n %{name}-%{version}/upstream

%build
if [ ! -d upstream/build ] ; then mkdir upstream/build ; fi ; cd upstream/build
if [ ! -d build ] ; then mkdir build ; fi ; cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make %{?_smp_mflags}
%make_build

%define pkg_config_dir %{buildroot}/usr/lib/pkgconfig/

%install
cd upstream/build
cd build
make install DESTDIR=%{buildroot}
mkdir -p %{pkg_config_dir}
install KF5CalendarCore.pc %{pkg_config_dir}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_datadir}/qlogging-categories5/*categories
%{_libdir}/libKF5CalendarCore.so.*

%files devel
Expand Down

0 comments on commit 6f8437f

Please sign in to comment.