summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrahmajit Das <brahmajit.xyz@gmail.com>2023-05-14 10:38:23 +0530
committerMatt Turner <mattst88@gentoo.org>2023-05-15 17:50:43 -0400
commit46e9abaf656222705085c2578770f7ff18c828aa (patch)
tree7c320f4bc65e102359e565565ea03f6fcf456dd3 /app-misc/tracker
parentsci-libs/proj: drop 7.2.1-r1, 9.1.0-r1 (diff)
downloadgentoo-46e9abaf656222705085c2578770f7ff18c828aa.tar.gz
gentoo-46e9abaf656222705085c2578770f7ff18c828aa.tar.bz2
gentoo-46e9abaf656222705085c2578770f7ff18c828aa.zip
app-misc/tracker: Fix implicit decl of gmtime_r
Closes: https://bugs.gentoo.org/906339 Closes: https://github.com/gentoo/gentoo/pull/31030 Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'app-misc/tracker')
-rw-r--r--app-misc/tracker/files/3.5.2-build-Define-_GNU_SOURCE-for-gmtime_r.patch46
-rw-r--r--app-misc/tracker/tracker-3.5.2.ebuild4
2 files changed, 50 insertions, 0 deletions
diff --git a/app-misc/tracker/files/3.5.2-build-Define-_GNU_SOURCE-for-gmtime_r.patch b/app-misc/tracker/files/3.5.2-build-Define-_GNU_SOURCE-for-gmtime_r.patch
new file mode 100644
index 000000000000..f60d86c0513a
--- /dev/null
+++ b/app-misc/tracker/files/3.5.2-build-Define-_GNU_SOURCE-for-gmtime_r.patch
@@ -0,0 +1,46 @@
+https://gitlab.gnome.org/GNOME/tracker/-/merge_requests/596
+
+From 4fc04fea1755c3c4f8913877c2c1889779d3d4d1 Mon Sep 17 00:00:00 2001
+From: Brahmajit Das <brahmajit.xyz@gmail.com>
+Date: Sun, 14 May 2023 09:59:58 +0530
+Subject: [PATCH] build: Define _GNU_SOURCE for gmtime_r
+
+Found while building tracker 3.5.2 with clang 16, which enable
+Wimplicit-function-declaration by default.
+
+Without _GNU_SOURCE defined, tracker would fail in the configure phase
+with Checking if "strftime 4-digit year modifier" runs: DID NOT
+COMPILE error. And investigating the meson log we see
+
+Compiler stderr:
+ /var/tmp/portage/app-misc/tracker-3.5.2/work/tracker-3.5.2-build/meson-private/tmplr2vm6b0/testfile.c:12:5: error: call to undeclared function 'gmtime_r'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
+ gmtime_r (&timestamp, &tm);
+
+And a little further up
+
+Command line: clang /var/tmp/portage/app-misc/tracker-3.5.2/work/tracker-3.5.2-build/meson-private/tmplr2vm6b0/testfile.c -o /var/tmp/portage/app-misc/tracker-3.5.2/work/tracker-3.5.2-build/meson-private/tmplr2vm6b0/output.exe -O2 -pipe -march=native -DTRACKER_DEBUG -DG_DISABLE_CAST_CHECKS -D_FILE_OFFSET_BITS=64 -O0 -Werror=implicit-function-declaration -std=c99 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed
+
+Seems like cc.run() doesn't pick up the general compiler args we set
+earlier. We have already set it for the main build, so adding it just
+for the configure test should be fine.
+
+Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
+---
+ meson.build | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/meson.build b/meson.build
+index 7b22cb1f9..00af07e6e 100644
+--- a/meson.build
++++ b/meson.build
+@@ -202,6 +202,7 @@ endif
+ # Get an appropriate 4-digit year modifier for strftime
+ ##################################################################
+ result = cc.run('''
++ #define _GNU_SOURCE
+ #include <stdio.h>
+ #include <string.h>
+ #include <time.h>
+--
+2.39.3
+
diff --git a/app-misc/tracker/tracker-3.5.2.ebuild b/app-misc/tracker/tracker-3.5.2.ebuild
index 69a65b9a77e5..584798e5fc46 100644
--- a/app-misc/tracker/tracker-3.5.2.ebuild
+++ b/app-misc/tracker/tracker-3.5.2.ebuild
@@ -45,6 +45,10 @@ BDEPEND="
"
PDEPEND="miners? ( >=app-misc/tracker-miners-${PV_SERIES} )"
+PATCHES=(
+ "${FILESDIR}/${PV}-build-Define-_GNU_SOURCE-for-gmtime_r.patch"
+)
+
python_check_deps() {
python_has_version -b \
"dev-python/pygobject[${PYTHON_USEDEP}]" \