aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadpilot <madpilot@FreeBSD.org>2017-07-31 23:07:02 +0800
committermadpilot <madpilot@FreeBSD.org>2017-07-31 23:07:02 +0800
commit089eab16c038f7fcde36772ab079c4e475ca9e73 (patch)
tree45156be40a2bc638f7a28b72656c303d789b441f
parent346e78b7d903d87789b2739a038bea1367e112aa (diff)
downloadfreebsd-ports-gnome-089eab16c038f7fcde36772ab079c4e475ca9e73.tar.gz
freebsd-ports-gnome-089eab16c038f7fcde36772ab079c4e475ca9e73.tar.zst
freebsd-ports-gnome-089eab16c038f7fcde36772ab079c4e475ca9e73.zip
Apply patch submitted upstream to better emulate the USG UNIX
daylight global variable as implemented in glibc. Obtained from: https://github.com/Gnucash/gnucash/pull/116
-rw-r--r--finance/gnucash/Makefile1
-rw-r--r--finance/gnucash/files/patch-src_import-export_ofx_gnc-ofx-import.c20
2 files changed, 18 insertions, 3 deletions
diff --git a/finance/gnucash/Makefile b/finance/gnucash/Makefile
index b0362f6ad339..0d7eb41292b9 100644
--- a/finance/gnucash/Makefile
+++ b/finance/gnucash/Makefile
@@ -3,6 +3,7 @@
PORTNAME= gnucash
PORTVERSION= 2.6.17
+PORTREVISION= 1
CATEGORIES= finance gnome
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}%20%28stable%29/${PORTVERSION}
diff --git a/finance/gnucash/files/patch-src_import-export_ofx_gnc-ofx-import.c b/finance/gnucash/files/patch-src_import-export_ofx_gnc-ofx-import.c
index f8655357ed99..fa5311a4672a 100644
--- a/finance/gnucash/files/patch-src_import-export_ofx_gnc-ofx-import.c
+++ b/finance/gnucash/files/patch-src_import-export_ofx_gnc-ofx-import.c
@@ -1,12 +1,26 @@
--- src/import-export/ofx/gnc-ofx-import.c.orig 2016-12-15 21:46:51 UTC
+++ src/import-export/ofx/gnc-ofx-import.c
-@@ -337,7 +337,11 @@ fix_ofx_bug_39 (time64 t)
+@@ -336,8 +336,25 @@ fix_ofx_bug_39 (time64 t)
+ {
#if HAVE_OFX_BUG_39
struct tm stm;
- gnc_localtime_r(&t, &stm);
++
+#ifdef __FreeBSD__
-+ if (!stm.tm_isdst)
++ time64 now;
++ /*
++ * FreeBSD has it's own libc implementation which differs from glibc. In particular:
++ * There is no daylight global
++ * tzname members are set to the string " " (three spaces) when not explicitly populated
++ *
++ * To check that the current timezone does not observe DST I check if tzname[1] starts with a space.
++ */
++ now = gnc_time (NULL);
++ gnc_localtime_r(&now, &stm);
++ tzset();
++
++ if (tzname[1][0] != ' ' && !stm.tm_isdst)
+#else
+ gnc_localtime_r(&t, &stm);
if (daylight && !stm.tm_isdst)
+#endif
t += 3600;