void-packages/srcpkgs/giggle/patches/cross.patch

61 lines
1.9 KiB
Diff

diff --git configure.ac configure.ac
index a7011f8..1ab7a52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,30 +125,6 @@ dnl ----------------------
AC_DEFINE(_GNU_SOURCE, 1, [Enable GNU Extensions])
-dnl Make sure that strptime can be used (read: has gnu extensions)
-AC_MSG_CHECKING([for GNU extensions of strptime()])
-AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <time.h>]],
- [[const char* date = "1168635922 +0100"; struct tm tm;
- char const* returned = strptime(date, "%s %z", &tm);
- return (!returned || *returned ? 1 : 0);]])],
- [AC_MSG_RESULT(available)
- AC_DEFINE([STRPTIME_HAS_GNU], [1],
- [strptime() has GNU extensions %s and %z])],
- [AC_MSG_RESULT(not available)])
-
-dnl Figure out which format string to use for time_t
-AC_MSG_CHECKING([size of time_t type])
-AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <time.h>]],
- [[return (sizeof (time_t) == sizeof (long) ? 0 : 1);]])],
- [AC_MSG_RESULT(long)
- AC_DEFINE([GIGGLE_FORMAT_TIME_T], ["ld"], [format string for time_t])],
- [AC_MSG_RESULT(int)
- AC_DEFINE([GIGGLE_FORMAT_TIME_T], ["d"], [format string for time_t])])
-
dnl ------------------
dnl | Language Support |---------------------------------------
dnl ------------------
diff --git libgiggle-git/giggle-git-revisions.c libgiggle-git/giggle-git-revisions.c
--- a/libgiggle-git/giggle-git-revisions.c
+++ b/libgiggle-git/giggle-git-revisions.c
@@ -130,7 +130,7 @@ git_revisions_get_command_line (GiggleJob *job,
static struct tm *
git_revisions_get_time (const gchar *date)
{
-#if STRPTIME_HAS_GNU
+#ifdef __GLIBC__
const gchar *returned;
struct tm *tm;
@@ -145,9 +145,11 @@ git_revisions_get_time (const gchar *date)
return tm;
#else
struct tm *tm = g_new0 (struct tm, 1);
+ gint64 ltime;
time_t time;
- sscanf (date, "%" GIGGLE_FORMAT_TIME_T, &time);
+ ltime = g_ascii_strtoull(date, NULL, 10);
+ time = ltime;
localtime_r (&time, tm);
return tm;