From owner-svn-ports-all@freebsd.org Mon Jan 18 17:07:47 2021 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7464B4F0866; Mon, 18 Jan 2021 17:07:47 +0000 (UTC) (envelope-from nc@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DKJBW2rZmz4hCh; Mon, 18 Jan 2021 17:07:47 +0000 (UTC) (envelope-from nc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5257017A06; Mon, 18 Jan 2021 17:07:47 +0000 (UTC) (envelope-from nc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 10IH7lS0053344; Mon, 18 Jan 2021 17:07:47 GMT (envelope-from nc@FreeBSD.org) Received: (from nc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 10IH7k2i053342; Mon, 18 Jan 2021 17:07:46 GMT (envelope-from nc@FreeBSD.org) Message-Id: <202101181707.10IH7k2i053342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nc set sender to nc@FreeBSD.org using -f From: Neel Chauhan Date: Mon, 18 Jan 2021 17:07:46 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r561948 - in head/deskutils/elementary-calendar: . files X-SVN-Group: ports-head X-SVN-Commit-Author: nc X-SVN-Commit-Paths: in head/deskutils/elementary-calendar: . files X-SVN-Commit-Revision: 561948 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2021 17:07:47 -0000 Author: nc Date: Mon Jan 18 17:07:46 2021 New Revision: 561948 URL: https://svnweb.freebsd.org/changeset/ports/561948 Log: deskutils/elementary-calendar: Fix Segmentation fault. PR: 252741 Submitted by: 0mp Reviewed by: 0mp (mentor) Approved by: 0mp (mentor) MFH: 2021Q1 Differential Revision: https://reviews.freebsd.org/D28216 Added: head/deskutils/elementary-calendar/files/patch-src_MainWindow.vala (contents, props changed) Modified: head/deskutils/elementary-calendar/Makefile head/deskutils/elementary-calendar/files/patch-core_Services_Calendar_EventStore.vala Modified: head/deskutils/elementary-calendar/Makefile ============================================================================== --- head/deskutils/elementary-calendar/Makefile Mon Jan 18 17:07:34 2021 (r561947) +++ head/deskutils/elementary-calendar/Makefile Mon Jan 18 17:07:46 2021 (r561948) @@ -2,6 +2,7 @@ PORTNAME= elementary-calendar DISTVERSION= 5.1.1 +PORTREVISION= 1 CATEGORIES= deskutils MAINTAINER= nc@FreeBSD.org Modified: head/deskutils/elementary-calendar/files/patch-core_Services_Calendar_EventStore.vala ============================================================================== --- head/deskutils/elementary-calendar/files/patch-core_Services_Calendar_EventStore.vala Mon Jan 18 17:07:34 2021 (r561947) +++ head/deskutils/elementary-calendar/files/patch-core_Services_Calendar_EventStore.vala Mon Jan 18 17:07:46 2021 (r561948) @@ -1,20 +1,39 @@ --- core/Services/Calendar/EventStore.vala.orig 2020-10-08 20:26:30 UTC +++ core/Services/Calendar/EventStore.vala -@@ -303,7 +303,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. +@@ -298,19 +298,10 @@ public class Calendar.EventStore : Object { + */ + private GLib.DateWeekday get_week_start () { + // Set the "baseline" for start of week: Sunday or Monday? +- // HACK Dealing with NLTime is hacky and potentially prone to breaking. +- // This to_string call produces a string pointer whose address is the +- // 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. - uint week_day1 = (uint) Posix.NLTime.WEEK_1STDAY.to_string (); -+ uint week_day1 = (uint) Posix.NLItem.DAY_1.to_string (); - var week_1stday = 0; // Default to 0 if unrecognized data - if (week_day1 == 19971130) { // Sunday +- var week_1stday = 0; // Default to 0 if unrecognized data +- if (week_day1 == 19971130) { // Sunday ++ string locale = GLib.Intl.setlocale(ALL, null); ++ var week_1stday = 1; // Default to Monday ++ if (locale.contains("CA") || locale.contains("MX") || locale.contains("US")) { week_1stday = 0; -@@ -322,7 +322,7 @@ 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. -- int week_start_posix = Posix.NLTime.FIRST_WEEKDAY.to_string ().data[0]; -+ int week_start_posix = Posix.NLItem.DAY_1.to_string ().data[0]; +- } else if (week_day1 == 19971201) { // Monday +- week_1stday = 1; +- } else { +- warning ("Unknown value of _NL_TIME_WEEK_1STDAY: %u", week_day1); + } + /* The offset between GLib and local POSIX numbering. + * If week_1stday is Monday, data is correct for GLib: Monday=1 through Sunday=7, +@@ -319,12 +310,7 @@ public class Calendar.EventStore : Object { + * subtracted by 1, then Sunday has to be handled separately to wrap to 7. */ + var glib_offset = week_1stday - 1; - var week_start = week_start_posix + glib_offset; +- // 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. +- int week_start_posix = Posix.NLTime.FIRST_WEEKDAY.to_string ().data[0]; +- +- var week_start = week_start_posix + glib_offset; ++ var week_start = glib_offset; if (week_start == 0) { // Sunday special case + week_start = 7; + } Added: head/deskutils/elementary-calendar/files/patch-src_MainWindow.vala ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/deskutils/elementary-calendar/files/patch-src_MainWindow.vala Mon Jan 18 17:07:46 2021 (r561948) @@ -0,0 +1,14 @@ +--- src/MainWindow.vala.orig 2021-01-18 04:30:35 UTC ++++ src/MainWindow.vala +@@ -51,8 +51,9 @@ public class Maya.MainWindow : Gtk.ApplicationWindow { + construct { + add_action_entries (ACTION_ENTRIES, this); + +- foreach (var action in action_accelerators.get_keys ()) { +- ((Gtk.Application) GLib.Application.get_default ()).set_accels_for_action (ACTION_PREFIX + action, action_accelerators[action].to_array ()); ++ var iter = action_accelerators.map_iterator (); ++ while (iter.next ()) { ++ ((Gtk.Application) GLib.Application.get_default ()).set_accels_for_action (ACTION_PREFIX + iter.get_key (), { iter.get_value () }); + } + + weak Gtk.IconTheme default_theme = Gtk.IconTheme.get_default ();