]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
guile: Remove support for the 1.8.x series.
authorLudovic Courtès <ludo@gnu.org>
Sun, 10 Jul 2022 15:03:03 +0000 (17:03 +0200)
committerLudovic Courtès <ludo@gnu.org>
Sun, 17 Jul 2022 20:54:56 +0000 (22:54 +0200)
The last Guile 1.8.x release dates back to 2010.

* configure.ac: Remove 1.8 from 'GUILE_PKG'.
* doc/gnutls-guile.texi (Guile Preparations): Remove mention of Guile 1.8.
* guile/src/core.c (mark_session_record_port)
(free_session_record_port): Remove.
(scm_init_gnutls_session_record_port_type): Remove corresponding
'scm_set_port_mark' and 'scm_set_port_free' calls.
* guile/modules/gnutls.in: Remove top-level 'cond-expand' forms for
Guile 1.8.
* guile/modules/gnutls/build/tests.scm: Likewise.
* NEWS: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
NEWS
configure.ac
doc/gnutls-guile.texi
guile/modules/gnutls.in
guile/modules/gnutls/build/tests.scm
guile/src/core.c

diff --git a/NEWS b/NEWS
index 79a6342b16f9e4901981b5c201cae3be9e6552b3..510e9fb942d81f46bd41773d3ce70d34ea055bc4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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()
index 0160a7a6bc119ad0448588b6a577581cc9bb68ec..940505ba9aa7122d731e043c753e3794f36eb6ba 100644 (file)
@@ -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
index 3e0b64d7eb4098e56f27629aa9d52be5a60993e5..d0cd1eb48be6f42cb6a8497dcd99789306d5a0eb 100644 (file)
@@ -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
index 03951962738490b8f0be5296ab4c2e4c73035005..7f59bbf401b0a7a484d606b89de1c4d11df3777c 100644 (file)
@@ -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
            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")
                         "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.
index 549917e838dc68e1ec52f8378f61a6c4ccc7a401..fd17c911108c133c75e87c9f06b979067f6d13b7 100644 (file)
@@ -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
index 4f2e3e3f924e8ab28af30ca5596307da17c19080..03d3f833e87fac784b9ad2d96b82debd4b288605 100644 (file)
@@ -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
 }
 \f