[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/03: maint: Check whether Guile-Gcrypt is recent enough.
From: |
guix-commits |
Subject: |
02/03: maint: Check whether Guile-Gcrypt is recent enough. |
Date: |
Wed, 27 May 2020 19:03:16 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit c1dc50ab202fafedde3a6b70ce6339496ad53a51
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed May 27 14:28:00 2020 +0200
maint: Check whether Guile-Gcrypt is recent enough.
Suggested by Danny Milosavljevic <dannym@scratchpost.org>
in <https://bugs.gnu.org/41494>.
* m4/guix.m4 (GUIX_CHECK_GUILE_GCRYPT): New macro.
* configure.ac: Use it.
---
configure.ac | 6 +++---
m4/guix.m4 | 20 +++++++++++++++++++-
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 0a20b47..cbf92da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -136,9 +136,9 @@ if test "x$guix_cv_have_recent_guile_sqlite3" != "xyes";
then
AC_MSG_ERROR([A recent Guile-SQLite3 could not be found; please install it.])
fi
-GUILE_MODULE_AVAILABLE([have_guile_gcrypt], [(gcrypt hash)])
-if test "x$have_guile_gcrypt" != "xyes"; then
- AC_MSG_ERROR([Guile-Gcrypt could not be found; please install it.])
+GUIX_CHECK_GUILE_GCRYPT
+if test "x$guix_cv_have_recent_guile_gcrypt" != "xyes"; then
+ AC_MSG_ERROR([A recent Guile-Gcrypt could not be found; please install it.])
fi
dnl Guile-newt is used by the graphical installer.
diff --git a/m4/guix.m4 b/m4/guix.m4
index 961ce83..9eb3863 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -1,5 +1,5 @@
dnl GNU Guix --- Functional package management for GNU
-dnl Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019 Ludovic Courtès
<ludo@gnu.org>
+dnl Copyright © 2012, 2013, 2014, 2015, 2016, 2018, 2019, 2020 Ludovic Courtès
<ludo@gnu.org>
dnl Copyright © 2014 Mark H Weaver <mhw@netris.org>
dnl Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
dnl
@@ -194,6 +194,24 @@ AC_DEFUN([GUIX_CHECK_GUILE_JSON], [
fi])
])
+dnl GUIX_CHECK_GUILE_GCRYPT
+dnl
+dnl Check whether a recent-enough Guile-Gcrypt is available.
+AC_DEFUN([GUIX_CHECK_GUILE_GCRYPT], [
+ dnl Check whether we're using Guile-Gcrypt 0.2.x or later. 0.2.0
+ dnl introduced the 'hash-algorithm' macro and related code.
+ AC_CACHE_CHECK([whether Guile-Gcrypt is available and recent enough],
+ [guix_cv_have_recent_guile_gcrypt],
+ [GUILE_CHECK([retval],
+ [(use-modules (gcrypt hash))
+ (equal? (hash-algorithm sha256)
+ (lookup-hash-algorithm 'sha256))])
+ if test "$retval" = 0; then
+ guix_cv_have_recent_guile_gcrypt="yes"
+ else
+ guix_cv_have_recent_guile_gcrypt="no"
+ fi])
+])
dnl GUIX_TEST_ROOT_DIRECTORY
AC_DEFUN([GUIX_TEST_ROOT_DIRECTORY], [