[packages/oath-toolkit] - fix build with recent glibc, other minor build fixes

hawk hawk at pld-linux.org
Thu Mar 14 13:09:24 CET 2019


commit d669c0db874659a0bb61ace91114676f2007a5f8
Author: Marcin Krol <hawk at tld-linux.org>
Date:   Thu Mar 14 13:08:16 2019 +0100

    - fix build with recent glibc, other minor build fixes

 glibc.patch       | 25 +++++++++++++++++++
 intprops.patch    | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 oath-toolkit.spec |  6 ++++-
 3 files changed, 102 insertions(+), 1 deletion(-)
---
diff --git a/oath-toolkit.spec b/oath-toolkit.spec
index f4dd8c5..f650c4d 100644
--- a/oath-toolkit.spec
+++ b/oath-toolkit.spec
@@ -2,11 +2,13 @@ Summary:	OATH Toolkit - easily build one-time password authentication systems
 Summary(pl.UTF-8):	OATH Toolkit - łatwe tworzenie systemów uwierzytelniania z jednorazowymi hasłami
 Name:		oath-toolkit
 Version:	2.6.2
-Release:	1
+Release:	2
 License:	LGPL v2.1+ (libraries), GPL v3+ (utilities and PAM module)
 Group:		Libraries
 Source0:	http://download.savannah.gnu.org/releases/oath-toolkit/%{name}-%{version}.tar.gz
 # Source0-md5:	4a05cd4768764843bd5493609a6bdb17
+Patch0:		glibc.patch
+Patch1:		intprops.patch
 URL:		http://www.nongnu.org/oath-toolkit/
 BuildRequires:	gtk-doc >= 1.1
 BuildRequires:	help2man
@@ -77,6 +79,8 @@ Dokumentacja API bibliotek OATH.
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
 
 %build
 %configure \
diff --git a/glibc.patch b/glibc.patch
new file mode 100644
index 0000000..eab3315
--- /dev/null
+++ b/glibc.patch
@@ -0,0 +1,25 @@
+Description: Check _IO_EOF_SEEN instead of _IO_ftrylockfile
+ Needed to get fseeko.c to build with glibc 2.28.
+ Inspired by https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a71827c0bc5e0ec67af23edef4f15cee8e.
+Author: Sascha Steinbiss <satta at debian.org>
+Last-Update: 2019-02-09
+--- a/liboath/gl/fseeko.c
++++ b/liboath/gl/fseeko.c
+@@ -47,7 +47,7 @@
+ #endif
+ 
+   /* These tests are based on fpurge.c.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_read_end == fp->_IO_read_ptr
+       && fp->_IO_write_ptr == fp->_IO_write_base
+       && fp->_IO_save_base == NULL)
+@@ -123,7 +123,7 @@
+           return -1;
+         }
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+       fp->_flags &= ~_IO_EOF_SEEN;
+       fp->_offset = pos;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
diff --git a/intprops.patch b/intprops.patch
new file mode 100644
index 0000000..061d62e
--- /dev/null
+++ b/intprops.patch
@@ -0,0 +1,72 @@
+diff -ur oath-toolkit-2.6.2.orig/liboath/gl/tests/intprops.h oath-toolkit-2.6.2/liboath/gl/tests/intprops.h
+--- oath-toolkit-2.6.2.orig/liboath/gl/tests/intprops.h	2016-08-27 13:15:06.000000000 +0200
++++ oath-toolkit-2.6.2/liboath/gl/tests/intprops.h	2019-03-14 13:02:37.921000000 +0100
+@@ -230,11 +230,11 @@
+    (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
+    that the result (e.g., A + B) has that type.  */
+ #if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+-# define _GL_ADD_OVERFLOW(a, b, min, max)
++# define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+    __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
+    __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
+    __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
+ #else
+ # define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+diff -ur oath-toolkit-2.6.2.orig/libpskc/gl/intprops.h oath-toolkit-2.6.2/libpskc/gl/intprops.h
+--- oath-toolkit-2.6.2.orig/libpskc/gl/intprops.h	2016-08-27 13:15:06.000000000 +0200
++++ oath-toolkit-2.6.2/libpskc/gl/intprops.h	2019-03-14 13:02:54.816000000 +0100
+@@ -230,11 +230,11 @@
+    (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
+    that the result (e.g., A + B) has that type.  */
+ #if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+-# define _GL_ADD_OVERFLOW(a, b, min, max)
++# define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+    __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
+    __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
+    __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
+ #else
+ # define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+diff -ur oath-toolkit-2.6.2.orig/oathtool/gl/intprops.h oath-toolkit-2.6.2/oathtool/gl/intprops.h
+--- oath-toolkit-2.6.2.orig/oathtool/gl/intprops.h	2016-08-27 13:15:06.000000000 +0200
++++ oath-toolkit-2.6.2/oathtool/gl/intprops.h	2019-03-14 12:59:53.022000000 +0100
+@@ -230,11 +230,11 @@
+    (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
+    that the result (e.g., A + B) has that type.  */
+ #if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+-# define _GL_ADD_OVERFLOW(a, b, min, max)
++# define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+    __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
+    __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
+    __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
+ #else
+ # define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+diff -ur oath-toolkit-2.6.2.orig/pskctool/gl/intprops.h oath-toolkit-2.6.2/pskctool/gl/intprops.h
+--- oath-toolkit-2.6.2.orig/pskctool/gl/intprops.h	2016-08-27 13:15:06.000000000 +0200
++++ oath-toolkit-2.6.2/pskctool/gl/intprops.h	2019-03-14 13:03:17.341000000 +0100
+@@ -230,11 +230,11 @@
+    (e.g., A and B) have the same type as MIN and MAX.  Instead, they assume
+    that the result (e.g., A + B) has that type.  */
+ #if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
+-# define _GL_ADD_OVERFLOW(a, b, min, max)
++# define _GL_ADD_OVERFLOW(a, b, min, max)                                \
+    __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
+-# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
++# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)                           \
+    __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
+-# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
++# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)                           \
+    __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
+ #else
+ # define _GL_ADD_OVERFLOW(a, b, min, max)                                \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/oath-toolkit.git/commitdiff/d669c0db874659a0bb61ace91114676f2007a5f8



More information about the pld-cvs-commit mailing list