summaryrefslogtreecommitdiff
path: root/sci-chemistry/openbabel/files/openbabel-3.1.1-fix-time-check-cmake.patch
diff options
context:
space:
mode:
Diffstat (limited to 'sci-chemistry/openbabel/files/openbabel-3.1.1-fix-time-check-cmake.patch')
-rw-r--r--sci-chemistry/openbabel/files/openbabel-3.1.1-fix-time-check-cmake.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/sci-chemistry/openbabel/files/openbabel-3.1.1-fix-time-check-cmake.patch b/sci-chemistry/openbabel/files/openbabel-3.1.1-fix-time-check-cmake.patch
new file mode 100644
index 000000000000..69e41211023b
--- /dev/null
+++ b/sci-chemistry/openbabel/files/openbabel-3.1.1-fix-time-check-cmake.patch
@@ -0,0 +1,32 @@
+https://github.com/openbabel/openbabel/pull/2493
+
+From: Sam James <sam@gentoo.org>
+Date: Sun, 12 Jun 2022 11:23:59 +0100
+Subject: [PATCH] CMake: fix time check typo (fixes build failure w/ GCC 12)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Without this fixed check, we get a build failure with GCC 12:
+```
+/var/tmp/portage/sci-chemistry/openbabel-3.1.1_p20210225/work/openbabel-08e23f39b0cc39b4eebd937a5a2ffc1a7bac3e1b/include/openbabel/obutil.h:65:14: error: ‘clock’ was not declared in this scope; did you mean ‘clock_t’?
+ 65 | start= clock();
+ | ^~~~~
+ | clock_t
+```
+
+Bug: https://bugs.gentoo.org/851510
+--- a/src/config.h.cmake
++++ b/src/config.h.cmake
+@@ -182,8 +182,8 @@
+ #define OB_MODULE_PATH "@OB_MODULE_PATH@"
+
+ #ifndef TIME_WITH_SYS_TIME
+- #ifdef HAVE_SYS_TIME
+- #ifdef HAVE_TIME
++ #ifdef HAVE_SYS_TIME_H
++ #ifdef HAVE_TIME_H
+ #define TIME_WITH_SYS_TIME 1
+ #else
+ #define TIME_WITH_SYS_TIME 0
+