Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jun 2023 15:25:05 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 2cfe4f64726f - main - sysutils/tracker3: fix meson configuration on i386
Message-ID:  <202306171525.35HFP5Fx017226@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2cfe4f64726fc29828d85528541007d68047bc22

commit 2cfe4f64726fc29828d85528541007d68047bc22
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-06-17 15:16:45 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-06-17 15:24:55 +0000

    sysutils/tracker3: fix meson configuration on i386
    
    Tracker's meson script has a check for "4-digit year modifier for
    strftime", but it semi-intentially uses a date which does not work on
    i386, due to its 32-bit time_t. Since we will never fix the Y2038
    problem on i386, work around the bad test by using 1970-01-01 instead.
    
    PR:             272017
    Reported by:    jbeich
    MFH:            2023Q2
---
 sysutils/tracker3/files/patch-meson.build | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/sysutils/tracker3/files/patch-meson.build b/sysutils/tracker3/files/patch-meson.build
new file mode 100644
index 000000000000..e74a60d0e1b9
--- /dev/null
+++ b/sysutils/tracker3/files/patch-meson.build
@@ -0,0 +1,19 @@
+--- meson.build.orig	2023-05-31 21:18:27 UTC
++++ meson.build
+@@ -210,14 +210,14 @@ result = cc.run('''
+ 
+   int main (int argc, char *argv[]) {
+     char *modifiers[] = { "%Y", "%C%y", "%4Y", "%2C%y", NULL };
+-    time_t timestamp = -58979923200; /* 0101-01-01T01:01:01Z */
++    time_t timestamp = 0; /* 1970-01-01T00:00:00Z */
+     char *buf[100];
+     struct tm tm;
+     int i;
+     gmtime_r (&timestamp, &tm);
+     for (i = 0; modifiers[i]; i++) {
+       strftime (&buf, sizeof buf, modifiers[i], &tm);
+-      if (strcmp (&buf, "0101") == 0) {
++      if (strcmp (&buf, "1970") == 0) {
+         printf ("%s", modifiers[i]);
+ 	return 0;
+       }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202306171525.35HFP5Fx017226>