Gentoo Archives: gentoo-commits

From: "Christoph Mende (angelos)" <angelos@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-office/orage/files: orage-4.5.14.0-bsd.patch
Date: Fri, 23 Jan 2009 16:30:14
Message-Id: E1LQOv6-0003si-2A@stork.gentoo.org
1 angelos 09/01/23 16:30:12
2
3 Added: orage-4.5.14.0-bsd.patch
4 Log:
5 Fixed building on on BSD, bug 255840
6 (Portage version: 2.2_rc23/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 app-office/orage/files/orage-4.5.14.0-bsd.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-office/orage/files/orage-4.5.14.0-bsd.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-office/orage/files/orage-4.5.14.0-bsd.patch?rev=1.1&content-type=text/plain
13
14 Index: orage-4.5.14.0-bsd.patch
15 ===================================================================
16 diff -u -r a/configure.in b/configure.in
17 --- a/configure.in 2009-01-23 17:22:08.468513692 +0100
18 +++ b/configure.in 2009-01-23 17:24:07.636680538 +0100
19 @@ -172,6 +172,21 @@
20 esac
21 AC_SUBST([PTHREAD_LIBS])
22
23 +dnl **********************************
24 +dnl *** check if we have _NL_TIME_FIRST_WEEKDAY
25 +dnl *** note that it is an enum and not a define
26 +dnl **********************************
27 +AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY])
28 +AC_TRY_LINK([#include <langinfo.h>], [
29 +char c;
30 +c = *((unsigned char *) nl_langinfo(_NL_TIME_FIRST_WEEKDAY));
31 +], nl_ok=yes, nl_ok=no)
32 +AC_MSG_RESULT($nl_ok)
33 +if test "$nl_ok" = "yes"; then
34 + AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1],
35 + [Define if _NL_TIME_FIRST_WEEKDAY is available])
36 +fi
37 +
38 AM_CONDITIONAL([INCLUDED_LIBICAL], [test x"$ac_INCLUDED_LIBICAL" = x"yes"])
39 AM_CONDITIONAL([HAVE_PTHREAD], [test x"$have_pthread" = x"yes"])
40 AM_CONDITIONAL([WITH_BDB4], [test x"$WITH_BDB4" = x"yes"])
41 diff -u -r a/src/parameters.c b/src/parameters.c
42 --- a/src/parameters.c 2009-01-23 17:22:08.529511185 +0100
43 +++ b/src/parameters.c 2009-01-23 17:23:43.167509746 +0100
44 @@ -30,7 +30,10 @@
45
46 #include <stdio.h>
47 #include <locale.h>
48 +
49 +#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
50 #include <langinfo.h>
51 +#endif
52
53 #include <glib.h>
54 #include <glib/gprintf.h>
55 @@ -129,6 +132,7 @@
56 * to return 0..6 mon..sun, which is what libical uses */
57 int get_first_weekday_from_locale()
58 {
59 +#ifdef HAVE__NL_TIME_FIRST_WEEKDAY
60 union { unsigned int word; char *string; } langinfo;
61 int week_1stday = 0;
62 int first_weekday = 1;
63 @@ -147,6 +151,10 @@
64 orage_message(150, "get_first_weekday: unknown value of _NL_TIME_WEEK_1STDAY.");
65
66 return((week_1stday + first_weekday - 2 + 7) % 7);
67 +#else
68 + orage_message(150, "get_first_weekday: Can not find first weekday. Using default: Monday=0. If this is wrong guess. please set undocumented parameter: Ical week start day (Sunday=6)");
69 + return(0);
70 +#endif
71 }
72
73 static void dialog_response(GtkWidget *dialog, gint response_id