summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--x11/ede/distinfo3
-rw-r--r--x11/ede/patches/patch-fl_time_cpp95
2 files changed, 97 insertions, 1 deletions
diff --git a/x11/ede/distinfo b/x11/ede/distinfo
index c992b0b48c1..4b5eede4d8a 100644
--- a/x11/ede/distinfo
+++ b/x11/ede/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.3 2011/10/09 06:52:46 dholland Exp $
+$NetBSD: distinfo,v 1.4 2011/10/11 22:01:23 tron Exp $
SHA1 (ede-1.0.4.tar.bz2) = 22dfcb972ceef00fa4c79b971708b317095c612c
RMD160 (ede-1.0.4.tar.bz2) = 1165f448a4ee0d385cc0372c9b18d0f18ec669fe
@@ -6,4 +6,5 @@ Size (ede-1.0.4.tar.bz2) = 1372589 bytes
SHA1 (patch-aa) = 53580cfa4d25730fb7cc8cd417c293978e130c95
SHA1 (patch-esvrconf_escreensaver_cpp) = 7f63df9d0e8f5a0997704e00df7058950233262e
SHA1 (patch-eworkpanel_workpanel_cpp) = 1c918020ed748398f6e3b41792f560bee40df271
+SHA1 (patch-fl_time_cpp) = c4189968a471c0a861af2d2b77eb0ec3a7bbf0b2
SHA1 (patch-makeinclude.in) = 88dd36a2aee3069a99245fd77a2fcf87f816c6b1
diff --git a/x11/ede/patches/patch-fl_time_cpp b/x11/ede/patches/patch-fl_time_cpp
new file mode 100644
index 00000000000..f0ce06f70d3
--- /dev/null
+++ b/x11/ede/patches/patch-fl_time_cpp
@@ -0,0 +1,95 @@
+$NetBSD: patch-fl_time_cpp,v 1.1 2011/10/11 22:01:23 tron Exp $
+
+Fix build on systems where the "tv_sec" member of "struct timeval" is not
+not of type "time_t", e.g. NetBSD/amd64 5.1.
+
+--- etimedate/fl_time.cpp.orig 2005-08-31 20:50:39.000000000 +0100
++++ etimedate/fl_time.cpp 2011-10-11 22:57:46.000000000 +0100
+@@ -46,6 +46,15 @@
+ }
+ #endif /* HAVE_STIME */
+
++static struct tm *
++my_localtime(const struct timeval *tv)
++{
++ time_t clock;
++ clock = tv->tv_sec;
++ return localtime(&clock);
++}
++
++
+ Fl_Time::Fl_Time(int x, int y, int w, int h, char *l) : Fl_Group(x, y, w, h, l)
+ {
+ int button_width = (int)(w/7);
+@@ -98,7 +107,7 @@
+ gettimeofday(&current_tv, 0);
+ display_tv.tv_sec = current_tv.tv_sec;
+ display_tv.tv_usec = current_tv.tv_usec;
+- display_time_tm = localtime(&current_tv.tv_sec);
++ display_time_tm = my_localtime(&current_tv);
+
+ if(type() == FL_TIME_24HOUR) strftime(time_string, 19, "%2H:%2M", display_time_tm);
+ else strftime(time_string, 19, "%2I:%2M %p", display_time_tm);
+@@ -118,7 +127,7 @@
+ gettimeofday(&current_tv, 0);
+
+ display_tv.tv_sec = current_tv.tv_sec - different;
+- display_time_tm = localtime(&display_tv.tv_sec);
++ display_time_tm = my_localtime(&display_tv);
+
+ if(type() == FL_TIME_24HOUR) strftime(time_string, 19, "%2H:%2M", display_time_tm);
+ else strftime(time_string, 19, "%2I:%2M %p", display_time_tm);
+@@ -132,7 +141,7 @@
+ {
+ struct tm *display_time_tm;
+
+- display_time_tm = localtime(&display_tv.tv_sec);
++ display_time_tm = my_localtime(&display_tv);
+ return display_time_tm->tm_hour;
+ }
+
+@@ -141,7 +150,7 @@
+ {
+ struct tm *display_time_tm;
+
+- display_time_tm = localtime(&display_tv.tv_sec);
++ display_time_tm = my_localtime(&display_tv);
+ return display_time_tm->tm_min;
+ }
+
+@@ -150,7 +159,7 @@
+ {
+ struct tm *display_time_tm;
+
+- display_time_tm = localtime(&display_tv.tv_sec);
++ display_time_tm = my_localtime(&display_tv);
+
+ if(type() == FL_TIME_24HOUR) strftime(time_string, 19, "%2H:%2M", display_time_tm);
+ else strftime(time_string, 19, "%2I:%2M %p", display_time_tm);
+@@ -163,7 +172,7 @@
+ {
+ struct tm *display_time_tm;
+
+- display_time_tm = localtime(&display_tv.tv_sec);
++ display_time_tm = my_localtime(&display_tv);
+ display_time_tm->tm_hour = value;
+ display_tv.tv_sec = mktime(display_time_tm);
+ }
+@@ -173,7 +182,7 @@
+ {
+ struct tm *display_time_tm;
+
+- display_time_tm = localtime(&display_tv.tv_sec);
++ display_time_tm = my_localtime(&display_tv);
+ if(value < 0)
+ {
+ display_time_tm->tm_min = 59;
+@@ -194,7 +203,7 @@
+ void Fl_Time::settime()
+ {
+ struct tm *display_time_tm;
+- display_time_tm = localtime(&display_tv.tv_sec);
++ display_time_tm = my_localtime(&display_tv);
+ // return display_time_tm->tm_min;
+ time_t ct = mktime (display_time_tm);
+ if (stime(&ct)!=0)