diff --git a/00-fix-vala-0.36.patch b/00-fix-vala-0.36.patch new file mode 100644 index 0000000..0ca13c7 --- /dev/null +++ b/00-fix-vala-0.36.patch @@ -0,0 +1,221 @@ +diff --git a/src/Widgets/calendar/CalendarModel.vala b/src/Widgets/calendar/CalendarModel.vala +index 9dc0438..9ff1755 100644 +--- a/src/Widgets/calendar/CalendarModel.vala ++++ b/src/Widgets/calendar/CalendarModel.vala +@@ -61,7 +61,7 @@ namespace DateTime.Widgets { + return summary; + } else if (alarm) { + return "%s - %s".printf (start_time.format (Util.TimeFormat ()), summary); +- } else if (range.days > 0 && date.compare (range.first) != 0) { ++ } else if (range.days > 0 && date.compare (range.first_dt) != 0) { + return summary; + } + return "%s - %s".printf (summary, start_time.format (Util.TimeFormat ())); +@@ -365,8 +365,8 @@ namespace DateTime.Widgets { + (Gee.EqualDataFunc? )Util.calcomponent_equal_func); + source_events.set (source, events); + /* query client view */ +- var iso_first = E.Util.isodate_from_time_t ((time_t)data_range.first.to_unix ()); +- var iso_last = E.Util.isodate_from_time_t ((time_t)data_range.last.add_days (1).to_unix ()); ++ var iso_first = E.Util.isodate_from_time_t ((time_t)data_range.first_dt.to_unix ()); ++ var iso_last = E.Util.isodate_from_time_t ((time_t)data_range.last_dt.add_days (1).to_unix ()); + var query = @"(occur-in-time-range? (make-time \"$iso_first\") (make-time \"$iso_last\"))"; + + E.CalClient client; +@@ -488,4 +488,4 @@ namespace DateTime.Widgets { + events_removed (source, removed_events.read_only_view); + } + } +-} +\ No newline at end of file ++} +diff --git a/src/Widgets/calendar/CalendarView.vala b/src/Widgets/calendar/CalendarView.vala +index 4615782..4ede210 100644 +--- a/src/Widgets/calendar/CalendarView.vala ++++ b/src/Widgets/calendar/CalendarView.vala +@@ -102,7 +102,7 @@ public class DateTime.Widgets.CalendarView : Gtk.Grid { + + void on_show_weeks_changed () { + var model = CalendarModel.get_default (); +- weeks.update (model.data_range.first, model.num_weeks); ++ weeks.update (model.data_range.first_dt, model.num_weeks); + } + + /* Indicates the month has changed */ +@@ -122,18 +122,18 @@ public class DateTime.Widgets.CalendarView : Gtk.Grid { + /* Sets the calendar widgets to the date range of the model */ + void sync_with_model () { + var model = CalendarModel.get_default (); +- if (grid.grid_range != null && (model.data_range.equals (grid.grid_range) || grid.grid_range.first.compare (model.data_range.first) == 0)) ++ if (grid.grid_range != null && (model.data_range.equals (grid.grid_range) || grid.grid_range.first_dt.compare (model.data_range.first_dt) == 0)) + return; // nothing to do + + GLib.DateTime previous_first = null; + if (grid.grid_range != null) +- previous_first = grid.grid_range.first; ++ previous_first = grid.grid_range.first_dt; + var previous_big_grid = big_grid; + big_grid = create_big_grid (); + stack.add (big_grid); + + header.update_columns (model.week_starts_on); +- weeks.update (model.data_range.first, model.num_weeks); ++ weeks.update (model.data_range.first_dt, model.num_weeks); + grid.set_range (model.data_range, model.month_start); + + // keep focus date on the same day of the month +@@ -151,7 +151,7 @@ public class DateTime.Widgets.CalendarView : Gtk.Grid { + } + + if (previous_first != null) { +- if (previous_first.compare (grid.grid_range.first) == -1) { ++ if (previous_first.compare (grid.grid_range.first_dt) == -1) { + stack.transition_type = Gtk.StackTransitionType.SLIDE_LEFT; + } else { + stack.transition_type = Gtk.StackTransitionType.SLIDE_RIGHT; +diff --git a/src/Widgets/calendar/Util.vala b/src/Widgets/calendar/Util.vala +index f0ffa08..e3fcb69 100644 +--- a/src/Widgets/calendar/Util.vala ++++ b/src/Widgets/calendar/Util.vala +@@ -22,8 +22,8 @@ + namespace Util { + /* Represents date range from 'first' to 'last' inclusive */ + public class DateRange : Object, Gee.Traversable, Gee.Iterable { +- public GLib.DateTime first { get; private set; } +- public GLib.DateTime last { get; private set; } ++ public GLib.DateTime first_dt { get; private set; } ++ public GLib.DateTime last_dt { get; private set; } + public bool @foreach (Gee.ForallFunc f) { + foreach (var date in this) { + if (f (date) == false) { +@@ -36,22 +36,22 @@ namespace Util { + + public int64 days { + get { +- return last.difference (first) / GLib.TimeSpan.DAY; ++ return last_dt.difference (first_dt) / GLib.TimeSpan.DAY; + } + } + + public DateRange (GLib.DateTime first, GLib.DateTime last) { + assert (first.compare (last) <= 0); +- this.first = first; +- this.last = last; ++ first_dt = first; ++ last_dt = last; + } + + public DateRange.copy (DateRange date_range) { +- this(date_range.first, date_range.last); ++ this(date_range.first_dt, date_range.last_dt); + } + + public bool equals (DateRange other) { +- return (first == other.first && last == other.last); ++ return (first_dt == other.first_dt && last_dt == other.last_dt); + } + + public Type element_type { +@@ -65,7 +65,7 @@ namespace Util { + } + + public bool contains (GLib.DateTime time) { +- return (first.compare (time) < 1) && (last.compare (time) > -1); ++ return (first_dt.compare (time) < 1) && (last_dt.compare (time) > -1); + } + + public Gee.SortedSet to_set () { +@@ -107,13 +107,13 @@ namespace Util { + + public DateIterator (DateRange range) { + this.range = range; +- this.current = range.first.add_days (-1); ++ this.current = range.first_dt.add_days (-1); + } + + public bool @foreach (Gee.ForallFunc f) { +- var element = range.first; ++ var element = range.first_dt; + +- while (element.compare (range.last) < 0) { ++ while (element.compare (range.last_dt) < 0) { + if (f (element) == false) { + return false; + } +@@ -135,11 +135,11 @@ namespace Util { + } + + public bool has_next () { +- return current.compare (range.last) < 0; ++ return current.compare (range.last_dt) < 0; + } + + public bool first () { +- current = range.first; ++ current = range.first_dt; + + return true; + } +@@ -384,8 +384,8 @@ namespace Util { + var exdate = property.get_exdate (); + var date = ical_to_date_time (exdate); + dateranges.@foreach ((daterange) => { +- var first = daterange.first; +- var last = daterange.last; ++ var first = daterange.first_dt; ++ var last = daterange.last_dt; + + if (first.get_year () <= date.get_year () && last.get_year () >= date.get_year ()) { + if (first.get_day_of_year () <= date.get_day_of_year () && last.get_day_of_year () >= date.get_day_of_year ()) { +@@ -426,7 +426,7 @@ namespace Util { + int i = 1; + int n = i * rrule.interval; + +- while (view_range.last.compare (start.add_days (n)) > 0) { ++ while (view_range.last_dt.compare (start.add_days (n)) > 0) { + dateranges.add (new Util.DateRange (start.add_days (n), end.add_days (n))); + i++; + n = i * rrule.interval; +@@ -456,7 +456,7 @@ namespace Util { + bool is_null_time = rrule.until.is_null_time () == 1; + var temp_start = start.add_years (n); + +- while (view_range.last.compare (temp_start) > 0) { ++ while (view_range.last_dt.compare (temp_start) > 0) { + if (is_null_time == false) { + if (temp_start.get_year () > rrule.until.year) { + break; +@@ -494,7 +494,7 @@ namespace Util { + var start_ical_day = get_date_from_ical_day (start.add_months (n), rrule.by_day[k]); + int week_of_month = (int)GLib.Math.ceil ((double)start.get_day_of_month () / 7); + +- while (view_range.last.compare (start_ical_day) > 0) { ++ while (view_range.last_dt.compare (start_ical_day) > 0) { + if (is_null_time == false) { + if (start_ical_day.get_year () > rrule.until.year) { + break; +@@ -541,7 +541,7 @@ namespace Util { + bool is_null_time = rrule.until.is_null_time () == 1; + var temp_start = start.add_months (n); + +- while (view_range.last.compare (temp_start) > 0) { ++ while (view_range.last_dt.compare (temp_start) > 0) { + if (is_null_time == false) { + if (temp_start.get_year () > rrule.until.year) { + break; +@@ -618,7 +618,7 @@ namespace Util { + bool is_null_time = rrule.until.is_null_time () == 1; + var temp_start = start.add_days (n); + +- while (view_range.last.compare (temp_start) > 0) { ++ while (view_range.last_dt.compare (temp_start) > 0) { + if (is_null_time == false) { + if (temp_start.get_year () > rrule.until.year) { + break; +@@ -810,4 +810,4 @@ namespace Util { + return false; + }); + } +-} +\ No newline at end of file ++} diff --git a/wingpanel-indicator-datetime.spec b/wingpanel-indicator-datetime.spec index af610e4..dd3fe39 100644 --- a/wingpanel-indicator-datetime.spec +++ b/wingpanel-indicator-datetime.spec @@ -3,12 +3,16 @@ Name: wingpanel-indicator-datetime Summary: Datetime Indicator for wingpanel Version: 2.0.2 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv3+ URL: https://github.com/elementary/%{name} Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +# Upstream patch to fix compilation with vala 0.36+ +# https://github.com/elementary/wingpanel-indicator-datetime/commit/834f0ff2c6aacc6f6453e22986a4d1e7e058d75e +Patch0: 00-fix-vala-0.36.patch + BuildRequires: cmake BuildRequires: gettext BuildRequires: vala >= 0.22.0 @@ -31,7 +35,7 @@ A datetime indicator for wingpanel. %prep -%autosetup +%autosetup -p1 %build @@ -59,6 +63,9 @@ popd %changelog +* Sat Nov 04 2017 Fabio Valentini - 2.0.2-4 +- Rebuild for granite soname bump. + * Thu Aug 03 2017 Fedora Release Engineering - 2.0.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild