mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 13:28:12 -05:00
gnu: oath-toolkit: Fix FTBFS with Glibc >= 2.28.
* gnu/packages/patches/oath-toolkit-glibc-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/authentication.scm (oath-toolkit)[source](patches): New field.
This commit is contained in:
parent
0171019418
commit
6bbbdb1a34
3 changed files with 93 additions and 0 deletions
|
@ -994,6 +994,7 @@ dist_patch_DATA = \
|
|||
%D%/packages/patches/nvi-db4.patch \
|
||||
%D%/packages/patches/nyacc-binary-literals.patch \
|
||||
%D%/packages/patches/nyx-show-header-stats-with-python3.patch \
|
||||
%D%/packages/patches/oath-toolkit-glibc-compat.patch \
|
||||
%D%/packages/patches/ocaml-bisect-fix-camlp4-in-another-directory.patch \
|
||||
%D%/packages/patches/ocaml-bitstring-fix-configure.patch \
|
||||
%D%/packages/patches/ocaml-CVE-2015-8869.patch \
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (gnu packages authentication)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages linux)
|
||||
#:use-module (gnu packages pkg-config)
|
||||
#:use-module (guix build-system gnu)
|
||||
|
@ -35,6 +36,7 @@ (define-public oath-toolkit
|
|||
(method url-fetch)
|
||||
(uri (string-append "https://download.savannah.nongnu.org/releases/"
|
||||
name "/" name "-" version ".tar.gz"))
|
||||
(patches (search-patches "oath-toolkit-glibc-compat.patch"))
|
||||
(sha256
|
||||
(base32 "182ah8vfbg0yhv6mh1b6ap944d0na6x7lpfkwkmzb6jl9gx4cd5h"))))
|
||||
(build-system gnu-build-system)
|
||||
|
|
90
gnu/packages/patches/oath-toolkit-glibc-compat.patch
Normal file
90
gnu/packages/patches/oath-toolkit-glibc-compat.patch
Normal file
|
@ -0,0 +1,90 @@
|
|||
Adjust the bundled Gnulib to cope with removal of libio interface in Glibc 2.28.
|
||||
|
||||
Based on this upstream gnulib patch:
|
||||
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
|
||||
|
||||
--- a/liboath/gl/fflush.c
|
||||
+++ b/liboath/gl/fflush.c
|
||||
@@ -33,7 +33,7 @@
|
||||
#undef fflush
|
||||
|
||||
|
||||
-#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 */
|
||||
|
||||
/* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
|
||||
static void
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
-#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 (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
|
||||
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
|
||||
@@ -148,7 +148,7 @@
|
||||
if (stream == NULL || ! freading (stream))
|
||||
return fflush (stream);
|
||||
|
||||
-#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 */
|
||||
|
||||
clear_ungetc_buffer_preserving_position (stream);
|
||||
|
||||
--- a/liboath/gl/fpurge.c
|
||||
+++ b/liboath/gl/fpurge.c
|
||||
@@ -62,7 +62,7 @@
|
||||
/* Most systems provide FILE as a struct and the necessary bitmask in
|
||||
<stdio.h>, because they need it for implementing getc() and putc() as
|
||||
fast macros. */
|
||||
-# 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->_IO_read_end = fp->_IO_read_ptr;
|
||||
fp->_IO_write_ptr = fp->_IO_write_base;
|
||||
/* Avoid memory leak when there is an active ungetc buffer. */
|
||||
--- a/libaoth/gl/freading.c
|
||||
+++ b/liboath/gl/freading.c
|
||||
@@ -31,7 +31,7 @@
|
||||
/* Most systems provide FILE as a struct and the necessary bitmask in
|
||||
<stdio.h>, because they need it for implementing getc() and putc() as
|
||||
fast macros. */
|
||||
-# 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 */
|
||||
return ((fp->_flags & _IO_NO_WRITES) != 0
|
||||
|| ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
|
||||
&& fp->_IO_read_base != NULL));
|
||||
--- 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__
|
||||
--- a/liboath/gl/stdio-impl.h
|
||||
+++ b/liboath/gl/stdio-impl.h
|
||||
@@ -18,6 +18,11 @@
|
||||
the same implementation of stdio extension API, except that some fields
|
||||
have different naming conventions, or their access requires some casts. */
|
||||
|
||||
+/* Glibc 2.28 made _IO_IN_BACKUP private, so define it here for now. */
|
||||
+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
|
||||
+# define _IO_IN_BACKUP 0x100
|
||||
+#endif
|
||||
+
|
||||
/* BSD stdio derived implementations. */
|
||||
|
||||
#if defined __NetBSD__ /* NetBSD */
|
Loading…
Reference in a new issue