From 5c48f583cfdb46cffadc5995d0c3e18d66db9020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 13 Oct 2022 09:07:06 +0700 Subject: [PATCH] passwordsafe: fix build with gcc-12 --- srcpkgs/passwordsafe/patches/time.h.patch | 43 +++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 srcpkgs/passwordsafe/patches/time.h.patch diff --git a/srcpkgs/passwordsafe/patches/time.h.patch b/srcpkgs/passwordsafe/patches/time.h.patch new file mode 100644 index 00000000000..7baa5c800cd --- /dev/null +++ b/srcpkgs/passwordsafe/patches/time.h.patch @@ -0,0 +1,43 @@ +From d8e7ec230e5cd4fa67aff4d6227d73dd9ddb37dd Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Thu, 30 Jun 2022 21:34:29 +0000 +Subject: [PATCH] Fix build with GCC 12 (missing include) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes build failure with GCC 12: +``` +/var/tmp/portage/app-admin/passwordsafe-1.15.0/work/pwsafe-1.15.0/src/os/unix/pws_time.cpp: In function ‘int localtime64_r(const __time64_t*, tm*)’: +/var/tmp/portage/app-admin/passwordsafe-1.15.0/work/pwsafe-1.15.0/src/os/unix/pws_time.cpp:30:10: error: ‘localtime_r’ was not declared in this scope; did you mean ‘localtime64_r’? + 30 | return localtime_r(tp, result) != nullptr; + | ^~~~~~~~~~~ + | localtime64_r +/var/tmp/portage/app-admin/passwordsafe-1.15.0/work/pwsafe-1.15.0/src/os/unix/pws_time.cpp: In function ‘int pws_os::asctime(TCHAR*, size_t, const tm*)’: +/var/tmp/portage/app-admin/passwordsafe-1.15.0/work/pwsafe-1.15.0/src/os/unix/pws_time.cpp:36:3: error: ‘asctime_r’ was not declared in this scope + 36 | asctime_r(t, cbuf); + | ^~~~~~~~~ +``` + +We had it conditional for FreeBSD but it shouldn't be conditional at all; +it only worked by chance before by way of transitive includes. + +Bug: https://bugs.gentoo.org/854144 +--- + src/os/unix/pws_time.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/os/unix/pws_time.h b/src/os/unix/pws_time.h +index b11f26a3a..3abb1bc8e 100644 +--- a/src/os/unix/pws_time.h ++++ b/src/os/unix/pws_time.h +@@ -10,9 +10,7 @@ + + #include "../typedefs.h" + #include +-#ifdef __FreeBSD__ + #include +-#endif + + #ifndef __TIME64_T_TYPE + #define __TIME64_T_TYPE uint64_t