io.elementary.calendar: update to 6.1.0.

This commit is contained in:
Michal Vasilek 2022-03-10 22:16:06 +01:00 committed by Echo
parent 0ed5f26303
commit 578d602535
3 changed files with 78 additions and 41 deletions

View file

@ -1,44 +1,49 @@
commit c9ba80af072819261a9e24a04a0859b93b5db810
Author: Cameron Nemo <camerontnorman@gmail.com>
Date: Thu Oct 18 11:33:15 2018 -0700
Check for _NL_TIME_FIRST_WEEKDAY declaration
diff --git core/Model/CalendarModel.vala core/Model/CalendarModel.vala
index 3e3b8cbd..b33f75f8 100644
--- a/core/Model/CalendarModel.vala
+++ b/core/Model/CalendarModel.vala
@@ -68,7 +68,11 @@ public class Maya.Model.CalendarModel : Object {
}
private CalendarModel () {
+#if HAVE_NL_TIME_FIRST_WEEKDAY
int week_start = Posix.NLTime.FIRST_WEEKDAY.to_string ().data[0];
+#else
+ int week_start = 0;
+#endif
if (week_start >= 1 && week_start <= 7) {
week_starts_on = (Maya.Settings.Weekday)week_start-1;
--- a/core/Services/Calendar/EventStore.vala
+++ b/core/Services/Calendar/EventStore.vala
@@ -304,6 +304,7 @@ public class Calendar.EventStore : Object {
// number we want, so we convert the pointer address to a uint to get
// the data. Since the pointer address is actually data, using it as a
// pointer will segfault.
+#if HAVE_NL_TIME_WEEK_1STDAY
uint week_day1 = (uint) Posix.NLTime.WEEK_1STDAY.to_string ();
var week_1stday = 0; // Default to 0 if unrecognized data
if (week_day1 == 19971130) { // Sunday
@@ -313,6 +314,9 @@ public class Calendar.EventStore : Object {
} else {
warning ("Unknown value of _NL_TIME_WEEK_1STDAY: %u", week_day1);
}
diff --git meson.build meson.build
index a0cd2dd7..02b4e1d1 100644
+#else
+ var week_1stday = 0;
+#endif
/* The offset between GLib and local POSIX numbering.
* If week_1stday is Monday, data is correct for GLib: Monday=1 through Sunday=7,
* so offset is 0.
@@ -323,7 +327,11 @@ public class Calendar.EventStore : Object {
// Get the start of week
// HACK This line produces a string of 3 bytes. It takes the raw value
// of the first one and uses that as the value of week_start.
+#if HAVE_NL_TIME_FIRST_WEEKDAY
int week_start_posix = Posix.NLTime.FIRST_WEEKDAY.to_string ().data[0];
+#else
+ int week_start_posix = 0;
+#endif
var week_start = week_start_posix + glib_offset;
if (week_start == 0) { // Sunday special case
--- a/meson.build
+++ b/meson.build
@@ -31,7 +31,17 @@ folks_dep = dependency('folks')
geocode_glib_dep = dependency('geocode-glib-1.0')
gclue_dep = dependency('libgeoclue-2.0')
@@ -48,7 +48,14 @@ else
add_project_arguments('--vapidir', join_paths(meson.current_source_dir(), 'vapi'), language: 'vala')
endif
-m_dep = meson.get_compiler('c').find_library('m', required : false)
+cc = meson.get_compiler('c')
+m_dep = cc.find_library('m', required : false)
+libnotify_dep = dependency('libnotify', required: false)
+
+if libnotify_dep.found()
+ add_project_arguments('--define=HAVE_LIBNOTIFY', language: 'vala')
+endif
+
+if cc.has_header_symbol('langinfo.h', '_NL_TIME_FIRST_WEEKDAY')
+ add_project_arguments('--define=HAVE_NL_TIME_FIRST_WEEKDAY', language: 'vala')
+endif
+if cc.has_header_symbol('langinfo.h', '_NL_TIME_WEEK_1STDAY')
+ add_project_arguments('--define=HAVE_NL_TIME_WEEK_1STDAY', language: 'vala')
+endif
gresource_calendar = gnome.compile_resources(

View file

@ -0,0 +1,32 @@
--- a/core/Tests/meson.build
+++ b/core/Tests/meson.build
@@ -18,15 +18,20 @@ util_tests = executable(
)
test('Utils Tests', util_tests, suite: 'core', is_parallel: false)
+locale_prog = find_program('locale', required: false)
# We need these three locales to run the tests
-locales = run_command('locale', '-a').stdout().split('\n')
-if locales.contains ('en_GB.utf8') and locales.contains ('en_US.utf8') and locales.contains ('ar_AE.utf8')
- eventstore_tests = executable(
- tests_name + '-eventstore',
- 'eventstore-tests.vala',
- dependencies: tests_deps
- )
- test('EventStore Tests', eventstore_tests, suite: 'core', is_parallel: false)
+if locale_prog.found()
+ locales = run_command(locale_prog, '-a').stdout().split('\n')
+ if locales.contains ('en_GB.utf8') and locales.contains ('en_US.utf8') and locales.contains ('ar_AE.utf8')
+ eventstore_tests = executable(
+ tests_name + '-eventstore',
+ 'eventstore-tests.vala',
+ dependencies: tests_deps
+ )
+ test('EventStore Tests', eventstore_tests, suite: 'core', is_parallel: false)
+ else
+ message('EventStore Tests have been disabled, a locale is missing in the system.')
+ endif
else
-message('EventStore Tests have been disabled, a locale is missing in the system.')
+ message('EventStore Tests have been disabled, the locale command is missing in the system.')
endif

View file

@ -1,22 +1,21 @@
# Template file for 'io.elementary.calendar'
pkgname=io.elementary.calendar
version=5.0
revision=6
_git_commit=46346e48b53e9d3d59d9f567b622532338f50f32
wrksrc="calendar-${_git_commit}"
version=6.1.0
revision=1
wrksrc="calendar-${version}"
build_style=meson
build_helper="gir"
hostmakedepends="intltool pkg-config vala desktop-file-utils AppStream
hostmakedepends="gettext pkg-config vala desktop-file-utils AppStream
glib-devel evolution-data-server-devel"
makedepends="granite-devel libglib-devel gtk+3-devel libgee08-devel
libchamplain-devel clutter-devel evolution-data-server-devel
libchamplain-devel clutter-devel evolution-data-server-devel libhandy1-devel
folks-devel geocode-glib-devel geoclue2-devel libical-devel libnotify-devel"
short_desc="Desktop calendar app designed for elementary OS"
maintainer="Cameron Nemo <cnemo@tutanota.com>"
license="GPL-3.0-only"
homepage="https://github.com/elementary/calendar"
distfiles="${homepage}/archive/${_git_commit}.tar.gz"
checksum=3be3851baeed67144e5cbed209b2c1b982fe9830db13372e3051423295dee345
distfiles="https://github.com/elementary/calendar/archive/refs/tags/${version}.tar.gz"
checksum=3cb4ba6f4d9fa6addfbe39b58cea282c0f0c6f139c49214c05e52adf457d949d
libio.elementary.calendar_package() {
short_desc+=" - library"
@ -28,7 +27,8 @@ libio.elementary.calendar_package() {
libio.elementary.calendar-devel_package() {
short_desc+=" - library development files"
depends="libio.elementary.calendar>=${version} evolution-data-server-devel
granite-devel gtk+3-devel libglib-devel libical-devel libsoup-devel"
granite-devel gtk+3-devel libglib-devel libical-devel libsoup-devel
libhandy1-devel"
pkg_install() {
vmove "usr/lib/*.so"
vmove usr/lib/pkgconfig