portability issues with hildon-1 (latest maemo svn version)



Hi

I'm trying to get the hildon framework working on OpenBSD. The problem I have is with locale support, which seems to depend on Linux-specific functions.

In file hildon-weekday-picker.c:
- Function: static void hildon_weekday_picker_init(HildonWeekdayPicker *picker).
 The problem here is that OpenBSD (I think this is the case for all *BSD's) does not support _NL_TIME_FIRST_WEEKDAY. Other programs take different workarounds for this issue:
 * Some set a default
 * Some give a warning
 * Some use the fact that gtk is installed and use the dgettext function. Code snippet below. This seems to me the best workaround, since hildon depends on gtk anyway.

In file hildon-calendar.c:
- Function: static void locales_init (HildonCalendarPrivate *priv)
The problem here is that OpenBSD does not support the locale_t struct and nl_langinfo_l function. The month and day-names are not available in translated form. I read the bugzilla discussions about this (bug 343415) and I understand the reason why this function is written in this way. I think there are two options on making this function portable:
  - Use the translations of another package which includes the month and day-name translations. Does anyone know a package who has these?
  - Include the translations in the hildon package itself.
- Function: static void hildon_calendar_init(HildonCalendar *calendar)
Same problem as in hildon-weekday-picker.c. I think the same solution applies.

Does anyone have any suggestions on these issues? If hildon developers would like to make their software more portable, I'm happy to create a patch for these issues.

Thanks a lot!

Kind Regards

Thomas

=== Code snippet with dgettext function (from jpilot project, with patch from OpenBSD's ports tree):
#  ifdef ENABLE_GTK2
#     ifdef HAVE__NL_TIME_FIRST_WEEKDAY
         /* GTK 2.8 libraries */
         langinfo = nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
         first_weekday = langinfo[0];
         langinfo = nl_langinfo(_NL_TIME_WEEK_1STDAY);
         week_origin = GPOINTER_TO_INT(langinfo);
         if (week_origin == 19971130)      /* Sunday */
            week_1stday = 0;
         else if (week_origin == 19971201) /* Monday */
            week_1stday = 1;
         else
            g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.\n");

         pref_fdow = (week_1stday + first_weekday - 1) % 7;
#     else
         /* GTK 2.6 libraries */
#        if defined(ENABLE_NLS)
            week_start = dgettext("gtk20", "calendar:week_start:0");
            if (strncmp("calendar:week_start:", week_start, 20) == 0) {
               pref_fdow = *(week_start + 20) - '0';
            } else {
               pref_fdow = -1;
            }
#        endif
#     endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]