diff options
author | Daiki Ueno <ueno@gnu.org> | 2022-07-18 00:02:34 +0000 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2022-07-18 00:02:34 +0000 |
commit | 9b8753904d46552e8bff11e50132e237cd667152 (patch) | |
tree | e905cd288cfbd8d2ef9cdab9bcc3e6c8e738b7fb | |
parent | 04bb0fd2764c6f08e27179887a5402c0f60f1708 (diff) | |
parent | e727eb7901a3f1754de970c8529925ae3d591b90 (diff) | |
download | gnutls-9b8753904d46552e8bff11e50132e237cd667152.tar.gz |
Merge branch 'wip-remove-guile-1.8-support' into 'master'
Remove support for Guile 1.8.
See merge request gnutls/gnutls!1608
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | doc/gnutls-guile.texi | 4 | ||||
-rw-r--r-- | guile/modules/gnutls.in | 59 | ||||
-rw-r--r-- | guile/modules/gnutls/build/tests.scm | 57 | ||||
-rw-r--r-- | guile/src/core.c | 51 | ||||
-rw-r--r-- | m4/guile.m4 | 19 |
7 files changed, 62 insertions, 134 deletions
@@ -31,6 +31,8 @@ Reading from the session record port now returns the end-of-file object instead of throwing an exception, just like it would for a proper session termination. +** guile: Guile 1.8 is no longer supported + * Version 3.7.6 (released 2022-05-27) ** libgnutls: Fixed invalid write when gnutls_realloc_zero() diff --git a/configure.ac b/configure.ac index 0160a7a6bc..940505ba9a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -# Copyright (C) 2000-2012, 2016, 2019 Free Software Foundation, Inc. +# Copyright (C) 2000-2012, 2016, 2019, 2022 Free Software Foundation, Inc. # # Author: Nikos Mavrogiannopoulos, Simon Josefsson # @@ -1174,7 +1174,7 @@ if test "$opt_guile_bindings" = "yes"; then AC_PATH_PROG([GUILD], [guild]) AC_SUBST([GUILD]) - GUILE_PKG([3.0 2.2 2.0 1.8]) + GUILE_PKG([3.0 2.2 2.0]) GUILE_PROGS GUILE_SITE_DIR GUILE_FLAGS diff --git a/doc/gnutls-guile.texi b/doc/gnutls-guile.texi index 3e0b64d7eb..d0cd1eb48b 100644 --- a/doc/gnutls-guile.texi +++ b/doc/gnutls-guile.texi @@ -17,7 +17,7 @@ This manual is last updated @value{UPDATED} for version @value{VERSION} of GnuTLS. -Copyright @copyright{} 2001-2012, 2014, 2016, 2019 Free Software Foundation, Inc. +Copyright @copyright{} 2001-2012, 2014, 2016, 2019, 2022 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -86,7 +86,7 @@ a large subset thereof is available. @chapter Guile Preparations The GnuTLS Guile bindings are available for the Guile 3.0 and 2.2 -series, as well as the legacy 2.0 and even 1.8 series. +series, as well as the legacy 2.0 series. By default they are installed under the GnuTLS installation directory, typically @file{/usr/local/share/guile/site/}). Normally Guile diff --git a/guile/modules/gnutls.in b/guile/modules/gnutls.in index 0395196273..7f59bbf401 100644 --- a/guile/modules/gnutls.in +++ b/guile/modules/gnutls.in @@ -1,5 +1,5 @@ ;;; GnuTLS --- Guile bindings for GnuTLS. -;;; Copyright (C) 2007-2012, 2014, 2015, 2016, 2019, 2021 Free Software +;;; Copyright (C) 2007-2012, 2014, 2015, 2016, 2019, 2021-2022 Free Software ;;; Foundation, Inc. ;;; ;;; GnuTLS is free software; you can redistribute it and/or @@ -513,12 +513,6 @@ openpgp-certificate-format/raw openpgp-certificate-format/base64)) -(cond-expand - ((not guile-2) ;silly 1.8 - (define-macro (eval-when foo a b) - `(begin ,a ,b))) - (else #t)) - (eval-when (expand load eval) (define %libdir (or (getenv "GNUTLS_GUILE_EXTENSION_DIR") @@ -533,39 +527,34 @@ "guile-gnutls-v-2") "scm_init_gnutls"))) -(cond-expand - ((not guile-2) - (define-macro (define-deprecated new) - `(define ,new ,(symbol-append '% new)))) - (else - (define-syntax define-deprecated - (lambda (s) - "Define a deprecated variable or procedure, along these lines: +(define-syntax define-deprecated + (lambda (s) + "Define a deprecated variable or procedure, along these lines: (define-deprecated variable alias) This defines 'variable' as an alias for 'alias', and emits a warning when 'variable' is used." - (syntax-case s () - ((_ variable) - (with-syntax ((alias (datum->syntax - #'variable - (symbol-append - '% (syntax->datum #'variable))))) - #'(define-deprecated variable alias))) - ((_ variable alias) - (identifier? #'variable) - #`(define-syntax variable - (lambda (s) - (issue-deprecation-warning - (format #f "GnuTLS variable '~a' is deprecated" - (syntax->datum #'variable))) - (syntax-case s () - ((_ args (... ...)) - #'(alias args (... ...))) - (id - (identifier? #'id) - #'alias)))))))))) + (syntax-case s () + ((_ variable) + (with-syntax ((alias (datum->syntax + #'variable + (symbol-append + '% (syntax->datum #'variable))))) + #'(define-deprecated variable alias))) + ((_ variable alias) + (identifier? #'variable) + #`(define-syntax variable + (lambda (s) + (issue-deprecation-warning + (format #f "GnuTLS variable '~a' is deprecated" + (syntax->datum #'variable))) + (syntax-case s () + ((_ args (... ...)) + #'(alias args (... ...))) + (id + (identifier? #'id) + #'alias)))))))) ;; Renaming. diff --git a/guile/modules/gnutls/build/tests.scm b/guile/modules/gnutls/build/tests.scm index 549917e838..fd17c91110 100644 --- a/guile/modules/gnutls/build/tests.scm +++ b/guile/modules/gnutls/build/tests.scm @@ -1,5 +1,5 @@ ;;; GnuTLS --- Guile bindings for GnuTLS. -;;; Copyright (C) 2011-2012, 2016, 2021 Free Software Foundation, Inc. +;;; Copyright (C) 2011-2012, 2016, 2021-2022 Free Software Foundation, Inc. ;;; ;;; GnuTLS is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,9 @@ ;;; Written by Ludovic Courtès <ludo@gnu.org>. (define-module (gnutls build tests) + #:use-module (rnrs io ports) + #:use-module (rnrs bytevectors) + #:use-module (ice-9 match) #:export (run-test with-child-process)) @@ -56,44 +59,26 @@ process exits upon failure." (primitive-exit 2))) (parent pid)))) -(cond-expand - ((not guile-2) ;1.8, yay! - (use-modules (ice-9 syncase)) +(define-syntax-rule (define-replacement (name args ...) body ...) + ;; Define a compatibility replacement for NAME, if needed. + (define-public name + (if (module-defined? the-scm-module 'name) + (module-ref the-scm-module 'name) + (lambda (args ...) + body ...)))) - (define-syntax define-syntax-rule - (syntax-rules () - ((_ (name args ...) docstring body) - (define-syntax name - (syntax-rules () - ((_ args ...) body)))))) +;; 'uniform-vector-read!' and 'uniform-vector-write' are deprecated in 2.0 +;; and absent in 2.2. +;; TODO: Switch to the R6RS bytevector and I/O interface. - (export define-syntax-rule)) - - (else ;2.0 and 2.2 - (use-modules (rnrs io ports) - (rnrs bytevectors) - (ice-9 match)) - - (define-syntax-rule (define-replacement (name args ...) body ...) - ;; Define a compatibility replacement for NAME, if needed. - (define-public name - (if (module-defined? the-scm-module 'name) - (module-ref the-scm-module 'name) - (lambda (args ...) - body ...)))) - - ;; 'uniform-vector-read!' and 'uniform-vector-write' are deprecated in 2.0 - ;; and absent in 2.2. - - (define-replacement (uniform-vector-read! buf port) - (match (get-bytevector-n! port buf - 0 (bytevector-length buf)) - ((? eof-object?) 0) - ((? integer? n) n))) - - (define-replacement (uniform-vector-write buf port) - (put-bytevector port buf)))) +(define-replacement (uniform-vector-read! buf port) + (match (get-bytevector-n! port buf + 0 (bytevector-length buf)) + ((? eof-object?) 0) + ((? integer? n) n))) +(define-replacement (uniform-vector-write buf port) + (put-bytevector port buf)) (define-syntax-rule (with-child-process pid parent child) "Fork and evaluate expression PARENT in the current process, with PID bound diff --git a/guile/src/core.c b/guile/src/core.c index 4f2e3e3f92..03d3f833e8 100644 --- a/guile/src/core.c +++ b/guile/src/core.c @@ -848,49 +848,6 @@ static scm_t_port_type *session_record_port_type; #define SCM_GNUTLS_SESSION_RECORD_PORT_BUFFER_SIZE 4096 -#if SCM_MAJOR_VERSION == 1 && SCM_MINOR_VERSION <= 8 - -/* Mark the session associated with PORT. */ -static SCM -mark_session_record_port (SCM port) -{ - return (SCM_GNUTLS_SESSION_RECORD_PORT_SESSION (port)); -} - -static size_t -free_session_record_port (SCM port) -#define FUNC_NAME "free_session_record_port" -{ - SCM session; - scm_t_port *c_port; - - session = SCM_GNUTLS_SESSION_RECORD_PORT_SESSION (port); - - /* SESSION _can_ be invalid at this point: it can be freed in the same GC - cycle as PORT, just before PORT. Thus, we need to check whether SESSION - still points to a session SMOB. */ - if (SCM_SMOB_PREDICATE (scm_tc16_gnutls_session, session)) - { - /* SESSION is still valid. Disassociate PORT from SESSION. */ - gnutls_session_t c_session; - - c_session = scm_to_gnutls_session (session, 1, FUNC_NAME); - SCM_GNUTLS_SET_SESSION_RECORD_PORT (c_session, SCM_BOOL_F); - } - - /* Free the input buffer of PORT. */ - c_port = SCM_PTAB_ENTRY (port); - scm_gc_free (c_port->read_buf, c_port->read_buf_size, - session_record_port_gc_hint); - - return 0; -} - -#undef FUNC_NAME - -#endif /* SCM_MAJOR_VERSION == 1 && SCM_MINOR_VERSION <= 8 */ - - #if USING_GUILE_BEFORE_2_2 /* Data passed to `do_fill_port ()'. */ @@ -1180,14 +1137,6 @@ scm_init_gnutls_session_record_port_type (void) scm_set_port_read_wait_fd (session_record_port_type, session_record_port_fd); #endif - - /* Guile >= 1.9.3 doesn't need a custom mark procedure, and doesn't need a - finalizer (since memory associated with the port is automatically - reclaimed.) */ -#if SCM_MAJOR_VERSION == 1 && SCM_MINOR_VERSION <= 8 - scm_set_port_mark (session_record_port_type, mark_session_record_port); - scm_set_port_free (session_record_port_type, free_session_record_port); -#endif } diff --git a/m4/guile.m4 b/m4/guile.m4 index 89823e9c38..48642f027f 100644 --- a/m4/guile.m4 +++ b/m4/guile.m4 @@ -1,6 +1,6 @@ ## Autoconf macros for working with Guile. ## -## Copyright (C) 1998,2001, 2006, 2010, 2012, 2013, 2014 Free Software Foundation, Inc. +## Copyright (C) 1998,2001, 2006, 2010, 2012, 2013, 2014, 2020 Free Software Foundation, Inc. ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public License @@ -17,7 +17,7 @@ ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ## 02110-1301 USA -# serial 10 +# serial 11 ## Index ## ----- @@ -47,8 +47,8 @@ # for an available version of Guile. # # By default, this macro will search for the latest stable version of -# Guile (e.g. 2.2), falling back to the previous stable version -# (e.g. 2.0) if it is available. If no guile-@var{VERSION}.pc file is +# Guile (e.g. 3.0), falling back to the previous stable version +# (e.g. 2.2) if it is available. If no guile-@var{VERSION}.pc file is # found, an error is signalled. The found version is stored in # @var{GUILE_EFFECTIVE_VERSION}. # @@ -60,8 +60,11 @@ # @code{AC_SUBST}. # AC_DEFUN([GUILE_PKG], - [PKG_PROG_PKG_CONFIG - _guile_versions_to_search="m4_default([$1], [2.2 2.0 1.8])" + [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + if test "x$PKG_CONFIG" = x; then + AC_MSG_ERROR([pkg-config is missing, please install it]) + fi + _guile_versions_to_search="m4_default([$1], [3.0 2.2 2.0])" if test -n "$GUILE_EFFECTIVE_VERSION"; then _guile_tmp="" for v in $_guile_versions_to_search; do @@ -221,7 +224,7 @@ AC_DEFUN([GUILE_SITE_DIR], # as well. # # By default, this macro will search for the latest stable version of -# Guile (e.g. 2.2). x.y or x.y.z versions can be specified. If an older +# Guile (e.g. 3.0). x.y or x.y.z versions can be specified. If an older # version is found, the macro will signal an error. # # The effective version of the found @code{guile} is set to @@ -237,7 +240,7 @@ AC_DEFUN([GUILE_SITE_DIR], AC_DEFUN([GUILE_PROGS], [_guile_required_version="m4_default([$1], [$GUILE_EFFECTIVE_VERSION])" if test -z "$_guile_required_version"; then - _guile_required_version=2.2 + _guile_required_version=3.0 fi _guile_candidates=guile |