projects/guix·commit ca719424

Switch to Guile-Gcrypt.

ca719424 · Ludovic Courtès <[email protected]> · 2018-08-31 17:07:07 +02:00

This removes (guix hash) and (guix pk-crypto), which now live as part of
Guile-Gcrypt (version 0.1.0.)

* guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm,
tests/hash.scm, tests/pk-crypto.scm: Remove.
* configure.ac: Test for Guile-Gcrypt.  Remove LIBGCRYPT and
LIBGCRYPT_LIBDIR assignments.
* m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove.
* README: Add Guile-Gcrypt to the dependencies; move libgcrypt as
"required unless --disable-daemon".
* doc/guix.texi (Requirements): Likewise.
* gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm,
guix/git.scm, guix/http-client.scm, guix/import/cpan.scm,
guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm,
guix/import/gnu.scm, guix/import/hackage.scm,
guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm,
guix/pki.scm, guix/scripts/archive.scm,
guix/scripts/authenticate.scm, guix/scripts/download.scm,
guix/scripts/hash.scm, guix/scripts/pack.scm,
guix/scripts/publish.scm, guix/scripts/refresh.scm,
guix/scripts/substitute.scm, guix/store.scm,
guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm,
tests/builders.scm, tests/challenge.scm, tests/cpan.scm,
tests/crate.scm, tests/derivations.scm, tests/gem.scm,
tests/nar.scm, tests/opam.scm, tests/pki.scm,
tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm,
tests/store.scm, tests/substitute.scm: Adjust imports.
* gnu/system/vm.scm: Likewise.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this.  Add GUILE-GCRYPT.
(expression->derivation-in-linux-vm)[config]: Remove.
(iso9660-image)[config]: Remove.
(qemu-image)[config]: Remove.
(system-docker-image)[config]: Remove.
* guix/scripts/pack.scm: Adjust imports.
(guile-sqlite3&co): Rename to...
(gcrypt-sqlite3&co): ... this.  Add GUILE-GCRYPT.
(self-contained-tarball)[build]: Call 'make-config.scm' without
 #:libgcrypt argument.
(squashfs-image)[libgcrypt]: Remove.
[build]: Call 'make-config.scm' without #:libgcrypt.
(docker-image)[config, json]: Remove.
[build]: Add GUILE-GCRYPT to the extensions  Remove (guix config) from
the imported modules.
* guix/self.scm (specification->package): Remove "libgcrypt", add
"guile-gcrypt".
(compiled-guix): Remove #:libgcrypt.
[guile-gcrypt]: New variable.
[dependencies]: Add it.
[*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call.
Add #:extensions.
[*config*]: Remove #:libgcrypt from 'make-config.scm' call.
(%dependency-variables): Remove %libgcrypt.
(make-config.scm): Remove #:libgcrypt.
* build-aux/build-self.scm (guile-gcrypt): New variable.
(make-config.scm): Remove #:libgcrypt.
(build-program)[fake-gcrypt-hash]: New variable.
Add (gcrypt hash) to the imported modules.  Adjust load path
assignments.
* gnu/packages/package-management.scm (guix)[propagated-inputs]: Add
GUILE-GCRYPT.
[arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search
path.
Commit
ca719424455465fca4b872c371daf2a46de88b33
Parents
7e1d2290

Changes

56 files changed · +180 −1241

FileStatusAddDelContent
Makefile.ammodified+0−5View file
READMEmodified+2−1View file
build-aux/build-self.scmmodified+70−13View file
configure.acmodified+6−7View file
doc/guix.teximodified+3−1View file
gnu/packages/bash.scmmodified+1−1View file
gnu/packages/package-management.scmmodified+4−1View file
gnu/system/vm.scmmodified+19−29View file
guix/derivations.scmmodified+1−1View file
guix/docker.scmmodified+1−1View file
guix/gcrypt.scmdeleted+0−49View before deletion
guix/git.scmmodified+1−1View file
guix/hash.scmdeleted+0−184View before deletion
guix/http-client.scmmodified+1−1View file
guix/import/cpan.scmmodified+1−1View file
guix/import/cran.scmmodified+1−1View file
guix/import/crate.scmmodified+1−1View file
guix/import/elpa.scmmodified+1−1View file
guix/import/gnu.scmmodified+1−1View file
guix/import/hackage.scmmodified+1−1View file
guix/import/texlive.scmmodified+1−1View file
guix/import/utils.scmmodified+1−1View file
guix/nar.scmmodified+2−2View file
guix/pk-crypto.scmdeleted+0−407View before deletion
guix/pki.scmmodified+1−1View file
guix/scripts/archive.scmmodified+1−1View file
guix/scripts/authenticate.scmmodified+1−1View file
guix/scripts/download.scmmodified+1−1View file
guix/scripts/hash.scmmodified+3−3View file
guix/scripts/pack.scmmodified+16−44View file
guix/scripts/publish.scmmodified+2−2View file
guix/scripts/refresh.scmmodified+1−1View file
guix/scripts/substitute.scmmodified+2−2View file
guix/self.scmmodified+11−15View file
guix/store.scmmodified+1−1View file
guix/store/deduplication.scmmodified+1−1View file
guix/tests.scmmodified+1−1View file
m4/guix.m4modified+0−18View file
tests/base32.scmmodified+1−1View file
tests/builders.scmmodified+1−1View file
tests/challenge.scmmodified+1−1View file
tests/cpan.scmmodified+1−1View file
tests/crate.scmmodified+1−1View file
tests/derivations.scmmodified+1−1View file
tests/gem.scmmodified+1−1View file
tests/hash.scmdeleted+0−128View before deletion
tests/nar.scmmodified+1−1View file
tests/opam.scmmodified+1−1View file
tests/packages.scmmodified+1−1View file
tests/pk-crypto.scmdeleted+0−290View before deletion
tests/pki.scmmodified+2−2View file
tests/publish.scmmodified+2−2View file
tests/pypi.scmmodified+1−1View file
tests/store-deduplication.scmmodified+1−1View file
tests/store.scmmodified+1−1View file
tests/substitute.scmmodified+2−2View file

Only the first 600 diff lines are shown. Download the complete patch.

Makefile.am

View file
diff --git a/Makefile.am b/Makefile.am
index af6870c..a349846 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -63,9 +63,6 @@ MODULES = \
guix/base64.scm \
guix/cpio.scm \
guix/records.scm \
- guix/gcrypt.scm \
- guix/hash.scm \
- guix/pk-crypto.scm \
guix/pki.scm \
guix/progress.scm \
guix/combinators.scm \
@@ -331,8 +328,6 @@ SCM_TESTS = \
tests/base32.scm \
tests/base64.scm \
tests/cpio.scm \
- tests/hash.scm \
- tests/pk-crypto.scm \
tests/pki.scm \
tests/print.scm \
tests/sets.scm \

README

View file
diff --git a/README b/README
index 348a7ad..4c76c4b 100644
--- a/README
+++ b/README
@@ -21,7 +21,7 @@ Guix is based on the [[https://nixos.org/nix/][Nix]] package manager.
GNU Guix currently depends on the following packages:
- [[https://gnu.org/software/guile/][GNU Guile 2.2.x or 2.0.x]], version 2.0.13 or later
- - [[https://gnupg.org/][GNU libgcrypt]]
+ - [[https://notabug.org/cwebber/guile-gcrypt][Guile-Gcrypt]] 0.1.0 or later
- [[https://www.gnu.org/software/make/][GNU Make]]
- [[https://www.gnutls.org][GnuTLS]] compiled with guile support enabled
- [[https://notabug.org/civodul/guile-sqlite3][Guile-SQLite3]], version 0.1.0 or later
@@ -31,6 +31,7 @@ GNU Guix currently depends on the following packages:
Unless `--disable-daemon' was passed, the following packages are needed:
+ - [[https://gnupg.org/][GNU libgcrypt]]
- [[https://sqlite.org/][SQLite 3]]
- [[https://gcc.gnu.org][GCC's g++]]
- optionally [[http://www.bzip.org][libbz2]]

build-aux/build-self.scm

View file
diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm
index 3ecdc93..f472724 100644
--- a/build-aux/build-self.scm
+++ b/build-aux/build-self.scm
@@ -22,6 +22,7 @@
#:use-module (guix ui)
#:use-module (guix config)
#:use-module (guix modules)
+ #:use-module (guix build-system gnu)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-19)
#:use-module (rnrs io ports)
@@ -72,7 +73,7 @@
(variables rest ...))))))
(variables %localstatedir %storedir %sysconfdir %system)))
-(define* (make-config.scm #:key libgcrypt zlib gzip xz bzip2
+(define* (make-config.scm #:key zlib gzip xz bzip2
(package-name "GNU Guix")
(package-version "0")
(bug-report-address "[email protected]")
@@ -92,7 +93,6 @@
%state-directory
%store-database-directory
%config-directory
- %libgcrypt
%libz
%gzip
%bzip2
@@ -137,9 +137,6 @@
(define %xz
#+(and xz (file-append xz "/bin/xz")))
- (define %libgcrypt
- #+(and libgcrypt
- (file-append libgcrypt "/lib/libgcrypt")))
(define %libz
#+(and zlib
(file-append zlib "/lib/libz")))))))
@@ -200,6 +197,44 @@ person's version identifier."
;; XXX: Replace with a Git commit id.
(date->string (current-date 0) "~Y~m~d.~H"))
+(define guile-gcrypt
+ ;; The host Guix may or may not have 'guile-gcrypt', which was introduced in
+ ;; August 2018. If it has it, it's at least version 0.1.0, which is good
+ ;; enough. If it doesn't, specify our own package because the target Guix
+ ;; requires it.
+ (match (find-best-packages-by-name "guile-gcrypt" #f)
+ (()
+ (package
+ (name "guile-gcrypt")
+ (version "0.1.0")
+ (home-page "https://notabug.org/cwebber/guile-gcrypt")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append home-page "/archive/v" version ".tar.gz"))
+ (sha256
+ (base32
+ "1gir7ifknbmbvjlql5j6wzk7bkb5lnmq80q59ngz43hhpclrk5k3"))
+ (file-name (string-append name "-" version ".tar.gz"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("pkg-config" ,(specification->package "pkg-config"))
+ ("autoconf" ,(specification->package "autoconf"))
+ ("automake" ,(specification->package "automake"))
+ ("texinfo" ,(specification->package "texinfo"))))
+ (inputs
+ `(("guile" ,(specification->package "guile"))
+ ("libgcrypt" ,(specification->package "libgcrypt"))))
+ (synopsis "Cryptography library for Guile using Libgcrypt")
+ (description
+ "Guile-Gcrypt provides a Guile 2.x interface to a subset of the
+GNU Libgcrypt crytographic library. It provides modules for cryptographic
+hash functions, message authentication codes (MAC), public-key cryptography,
+strong randomness, and more. It is implemented using the foreign function
+interface (FFI) of Guile.")
+ (license #f))) ;license:gpl3+
+ ((package . _)
+ package)))
+
(define* (build-program source version
#:optional (guile-version (effective-version))
#:key (pull-version 0))
@@ -212,10 +247,21 @@ person's version identifier."
(('gnu _ ...) #t)
(_ #f)))
+ (define fake-gcrypt-hash
+ ;; Fake (gcrypt hash) module; see below.
+ (scheme-file "hash.scm"
+ #~(define-module (gcrypt hash)
+ #:export (sha1 sha256))))
+
(with-imported-modules `(((guix config)
- => ,(make-config.scm
- #:libgcrypt
- (specification->package "libgcrypt")))
+ => ,(make-config.scm))
+
+ ;; To avoid relying on 'with-extensions', which was
+ ;; introduced in 0.15.0, provide a fake (gcrypt
+ ;; hash) just so that we can build modules, and
+ ;; adjust %LOAD-PATH later on.
+ ((gcrypt hash) => ,fake-gcrypt-hash)
+
,@(source-module-closure `((guix store)
(guix self)
(guix derivations)
@@ -237,13 +283,24 @@ person's version identifier."
(match %load-path
((front _ ...)
(unless (string=? front source) ;already done?
- (set! %load-path (list source front)))))))
-
- ;; Only load our own modules or those of Guile.
+ (set! %load-path
+ (list source
+ (string-append #$guile-gcrypt
+ "/share/guile/site/"
+ (effective-version))
+ front)))))))
+
+ ;; Only load Guile-Gcrypt, our own modules, or those
+ ;; of Guile.
(match %load-compiled-path
((front _ ... sys1 sys2)
- (set! %load-compiled-path
- (list front sys1 sys2)))))
+ (unless (string-prefix? #$guile-gcrypt front)
+ (set! %load-compiled-path
+ (list (string-append #$guile-gcrypt
+ "/lib/guile/"
+ (effective-version)
+ "/site-ccache")
+ front sys1 sys2))))))
(use-modules (guix store)
(guix self)

configure.ac

View file
diff --git a/configure.ac b/configure.ac
index b34f15a..c83d4d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,6 +130,11 @@ 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.])
+fi
+
dnl Make sure we have a full-fledged Guile.
GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
@@ -213,16 +218,10 @@ AC_ARG_WITH([libgcrypt-libdir],
esac])
dnl If none of the --with-libgcrypt-* options was used, try to determine the
-dnl absolute file name of libgcrypt.so.
+dnl the library directory.
case "x$LIBGCRYPT_PREFIX$LIBGCRYPT_LIBDIR" in
xnono)
GUIX_LIBGCRYPT_LIBDIR([LIBGCRYPT_LIBDIR])
- if test "x$LIBGCRYPT_LIBDIR" != x; then
- LIBGCRYPT="$LIBGCRYPT_LIBDIR/libgcrypt"
- else
- dnl 'config-daemon.ac' expects "no" in this case.
- LIBGCRYPT_LIBDIR="no"
- fi
;;
esac

doc/guix.texi

View file
diff --git a/doc/guix.texi b/doc/guix.texi
index 307f915..9375aac 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -620,7 +620,8 @@ GNU Guix depends on the following packages:
@itemize
@item @url{http://gnu.org/software/guile/, GNU Guile}, version 2.0.13 or
later, including 2.2.x;
-@item @url{http://gnupg.org/, GNU libgcrypt};
+@item @url{https://notabug.org/cwebber/guile-gcrypt, Guile-Gcrypt}, version
+0.1.0 or later;
@item
@uref{http://gnutls.org/, GnuTLS}, specifically its Guile bindings
(@pxref{Guile Preparations, how to install the GnuTLS bindings for
@@ -662,6 +663,7 @@ Unless @code{--disable-daemon} was passed to @command{configure}, the
following packages are also needed:
@itemize
+@item @url{http://gnupg.org/, GNU libgcrypt};
@item @url{http://sqlite.org, SQLite 3};
@item @url{http://gcc.gnu.org, GCC's g++}, with support for the
C++11 standard.

gnu/packages/bash.scm

View file
diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 64f7782..121a459 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -36,7 +36,7 @@
#:use-module (guix store)
#:use-module (guix build-system gnu)
#:autoload (guix gnupg) (gnupg-verify*)
- #:autoload (guix hash) (port-sha256)
+ #:autoload (gcrypt hash) (port-sha256)
#:autoload (guix base32) (bytevector->nix-base32-string)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)

gnu/packages/package-management.scm

View file
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 78db0ab..e40a94a 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -213,6 +213,7 @@
;; Guile-JSON, and Guile-Git automatically.
(let* ((out (assoc-ref outputs "out"))
(guile (assoc-ref inputs "guile"))
+ (gcrypt (assoc-ref inputs "guile-gcrypt"))
(json (assoc-ref inputs "guile-json"))
(sqlite (assoc-ref inputs "guile-sqlite3"))
(git (assoc-ref inputs "guile-git"))
@@ -220,7 +221,8 @@
"guile-bytestructures"))
(ssh (assoc-ref inputs "guile-ssh"))
(gnutls (assoc-ref inputs "gnutls"))
- (deps (list json sqlite gnutls git bs ssh))
+ (deps (list gcrypt json sqlite gnutls
+ git bs ssh))
(effective
(read-line
(open-pipe* OPEN_READ
@@ -279,6 +281,7 @@
'())))
(propagated-inputs
`(("gnutls" ,gnutls)
+ ("guile-gcrypt" ,guile-gcrypt)
("guile-json" ,guile-json)
("guile-sqlite3" ,guile-sqlite3)
("guile-ssh" ,guile-ssh)

gnu/system/vm.scm

View file
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index b505b0c..3898872 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -32,7 +32,7 @@
#:use-module (guix modules)
#:use-module (guix scripts pack)
#:use-module (guix utils)
- #:use-module (guix hash)
+ #:use-module (gcrypt hash)
#:use-module (guix base32)
#:use-module ((guix self) #:select (make-config.scm))
@@ -43,7 +43,7 @@
#:use-module (gnu packages cdrom)
#:use-module (gnu packages compression)
#:use-module (gnu packages guile)
- #:autoload (gnu packages gnupg) (libgcrypt)
+ #:autoload (gnu packages gnupg) (guile-gcrypt)
#:use-module (gnu packages gawk)
#:use-module (gnu packages bash)
#:use-module (gnu packages less)
@@ -124,10 +124,12 @@
(('gnu rest ...) #t)
(rest #f)))
-(define guile-sqlite3&co
- ;; Guile-SQLite3 and its propagated inputs.
- (cons guile-sqlite3
- (package-transitive-propagated-inputs guile-sqlite3)))
+(define gcrypt-sqlite3&co
+ ;; Guile-Gcrypt, Guile-SQLite3, and their propagated inputs.
+ (append-map (lambda (package)
+ (cons package
+ (package-transitive-propagated-inputs package)))
+ (list guile-gcrypt guile-sqlite3)))
(define* (expression->derivation-in-linux-vm name exp
#:key
@@ -164,10 +166,6 @@ based on the size of the closure of REFERENCES-GRAPHS.
When REFERENCES-GRAPHS is true, it must be a list of file name/store path
pairs, as for `derivation'. The files containing the reference graphs are
made available under the /xchg CIFS share."
- (define config
- ;; (guix config) module for consumption by (guix gcrypt).
- (make-config.scm #:libgcrypt libgcrypt))
-
(define user-builder
(program-file "builder-in-linux-vm" exp))
@@ -195,12 +193,14 @@ made available under the /xchg CIFS share."
(define builder
;; Code that launches the VM that evaluates EXP.
- (with-extensions guile-sqlite3&co
+ (with-extensions gcrypt-sqlite3&co
(with-imported-modules `(,@(source-module-closure
'((guix build utils)
(gnu build vm))
#:select? not-config?)
- ((guix config) => ,config))
+
+ ;; For consumption by (gnu store database).
+ ((guix config) => ,(make-config.scm)))
#~(begin
(use-modules (guix build utils)
(gnu build vm))
@@ -255,9 +255,6 @@ made available under the /xchg CIFS share."
"Return a bootable, stand-alone iso9660 image.
INPUTS is a list of inputs (as for packages)."
- (define config
- (make-config.scm #:libgcrypt libgcrypt))
-
(define schema
(and register-closures?
(local-file (search-path %load-path
@@ -265,12 +262,12 @@ INPUTS is a list of inputs (as for packages)."
(expression->derivation-in-linux-vm
name
- (with-extensions guile-sqlite3&co
+ (with-extensions gcrypt-sqlite3&co
(with-imported-modules `(,@(source-module-closure '((gnu build vm)
(guix store database)
(guix build utils))
#:select? not-config?)
- ((guix config) => ,config))
+ ((guix config) => ,(make-config.scm)))
#~(begin
(use-modules (gnu build vm)
(guix store database)
@@ -347,9 +344,6 @@ INPUTS is a list of inputs (as for packages). When COPY-INPUTS? is true, copy
all of INPUTS into the image being built. When REGISTER-CLOSURES? is true,
register INPUTS in the store database of the image so that Guix can be used in
the image."
- (define config
- (make-config.scm #:libgcrypt libgcrypt))
-
(define schema
(and register-closures?
(local-file (search-path %load-path
@@ -357,13 +351,13 @@ the image."
(expression->derivation-in-linux-vm
name
- (with-extensions guile-sqlite3&co
+ (with-extensions gcrypt-sqlite3&co
(with-imported-modules `(,@(source-module-closure '((gnu build vm)
(gnu build bootloader)
(guix store database)
(guix build utils))
#:select? not-config?)
- ((guix config) => ,config))
+ ((guix config) => ,(make-config.scm)))
#~(begin
(use-modules (gnu build bootloader)
(gnu build vm)
@@ -462,10 +456,6 @@ makes sense when you want to build a GuixSD Docker image that has Guix
installed inside of it. If you don't need Guix (e.g., your GuixSD Docker
image just contains a web server that is started by the Shepherd), then you
should set REGISTER-CLOSURES? to #f."
- (define config
- ;; (guix config) module for consumption by (guix gcrypt).
- (make-config.scm #:libgcrypt libgcrypt))
-
(define schema
(and register-closures?
(local-file (search-path %load-path
@@ -475,8 +465,8 @@ should set REGISTER-CLOSURES? to #f."
(name -> (string-append name ".tar.gz"))
(graph -> "system-graph"))
(define build
- (with-extensions (cons guile-json ;for (guix docker)
- guile-sqlite3&co) ;for (guix store database)
+ (with-extensions (cons guile-json ;for (guix docker)
+ gcrypt-sqlite3&co) ;for (guix store database)
(with-imported-modules `(,@(source-module-closure
'((guix docker)
(guix store database)
@@ -484,7 +474,7 @@ should set REGISTER-CLOSURES? to #f."
(guix build store-copy)
(gnu build vm))
#:select? not-config?)
- ((guix config) => ,config))
+ ((guix config) => ,(make-config.scm)))
#~(begin
(use-modules (guix docker)
(guix build utils)

guix/derivations.scm

View file
diff --git a/guix/derivations.scm b/guix/derivations.scm
index da686e8..7afecb1 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -35,7 +35,7 @@
#:use-module (guix memoization)
#:use-module (guix combinators)
#:use-module (guix monads)
- #:use-module (guix hash)
+ #:use-module (gcrypt hash)
#:use-module (guix base32)
#:use-module (guix records)
#:use-module (guix sets)

guix/docker.scm

View file
diff --git a/guix/docker.scm b/guix/docker.scm
index b869901..0757d33 100644
--- a/guix/docker.scm
+++ b/guix/docker.scm
@@ -19,7 +19,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (guix docker)
- #:use-module (guix hash)
+ #:use-module (gcrypt hash)
#:use-module (guix base16)
#:use-module ((guix build utils)
#:select (mkdir-p

guix/gcrypt.scm

View before deletion
diff --git a/guix/gcrypt.scm b/guix/gcrypt.scm
deleted file mode 100644
index 1517501..0000000
--- a/guix/gcrypt.scm
+++ /dev/null
@@ -1,49 +0,0 @@
-;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <[email protected]>
-;;;
-;;; This file is part of GNU Guix.
-;;;
-;;; GNU Guix is free software; you can redistribute it and/or modify it
-;;; under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 3 of the License, or (at
-;;; your option) any later version.
-;;;
-;;; GNU Guix is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
-
-(define-module (guix gcrypt)
- #:use-module (guix config)
- #:use-module (system foreign)
- #:export (gcrypt-version
- libgcrypt-func))
-
-;;; Commentary:
-;;;
-;;; Common code for the GNU Libgcrypt bindings. Loading this module
-;;; initializes Libgcrypt as a side effect.
-;;;
-;;; Code:
-
-(define libgcrypt-func
- (let ((lib (dynamic-link %libgcrypt)))
- (lambda (func)
- "Return a pointer to symbol FUNC in libgcrypt."
- (dynamic-func func lib))))
-
-(define gcrypt-version
- ;; According to the manual, this function must be called before any other,
- ;; and it's not clear whether it can be called more than once. So call it
- ;; right here from the top level.
- (let* ((ptr (libgcrypt-func "gcry_check_version"))
- (proc (pointer->procedure '* ptr '(*)))
- (version (pointer->string (proc %null-pointer))))
- (lambda ()
- "Return the version number of libgcrypt as a string."
- version)))
-
-;;; gcrypt.scm ends here

guix/git.scm

View file
diff --git a/guix/git.scm b/guix/git.scm
index 193e2df..c577eba 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -21,7 +21,7 @@
#:use-module (git)
#:use-module (git object)
#:use-module (guix base32)
- #:use-module (guix hash)
+ #:use-module (gcrypt hash)
#:use-module ((guix build utils) #:select (mkdir-p))
#:use-module (guix store)
#:use-module (guix utils)
diff --git a/guix/hash.scm b/guix/hash.scm
deleted file mode 100644
index 8d7ba21..0000000
--- a/guix/hash.scm
+++ /dev/null
@@ -1,184 +0,0 @@
-;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <[email protected]>
-;;;
-;;; This file is part of GNU Guix.
-;;;
-;;; GNU Guix is free software; you can redistribute it and/or modify it
-;;; under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 3 of the License, or (at
-;;; your option) any later version.
-;;;
-;;; GNU Guix is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
-
-(define-module (guix hash)
- #:use-module (guix gcrypt)
- #:use-module (rnrs bytevectors)
- #:use-module (ice-9 binary-ports)
- #:use-module (system foreign)
- #:use-module ((guix build utils) #:select (dump-port))
- #:use-module (srfi srfi-11)
- #:use-module (srfi srfi-26)
- #:export (sha1
- sha256
- open-sha256-port
- port-sha256
- file-sha256
- open-sha256-input-port))
-
-;;; Commentary:
-;;;
-;;; Cryptographic hashes.
-;;;
-;;; Code:
-
-
-;;;
-;;; Hash.
-;;;
-
-(define-syntax GCRY_MD_SHA256
- ;; Value as of Libgcrypt 1.5.2.
- (identifier-syntax 8))
-
-(define-syntax GCRY_MD_SHA1
- (identifier-syntax 2))
-
-(define bytevector-hash
- (let ((hash (pointer->procedure void
- (libgcrypt-func "gcry_md_hash_buffer")
- `(,int * * ,size_t))))
- (lambda (bv type size)
- "Return the hash TYPE, of SIZE bytes, of BV as a bytevector."
- (let ((digest (make-bytevector size)))
- (hash type (bytevector->pointer digest)
- (bytevector->pointer bv) (bytevector-length bv))
- digest))))
-
-(define sha1
- (cut bytevector-hash <> GCRY_MD_SHA1 20))
-
-(define sha256
- (cut bytevector-hash <> GCRY_MD_SHA256 (/ 256 8)))
-
-(define open-sha256-md

This diff is incomplete. Download the complete patch.

guix/http-client.scm

View file

This diff is incomplete. Download the complete patch.

guix/import/cpan.scm

View file

This diff is incomplete. Download the complete patch.

guix/import/cran.scm

View file

This diff is incomplete. Download the complete patch.

guix/import/crate.scm

View file

This diff is incomplete. Download the complete patch.

guix/import/elpa.scm

View file

This diff is incomplete. Download the complete patch.

guix/import/gnu.scm

View file

This diff is incomplete. Download the complete patch.

guix/import/hackage.scm

View file

This diff is incomplete. Download the complete patch.

guix/import/texlive.scm

View file

This diff is incomplete. Download the complete patch.

guix/import/utils.scm

View file

This diff is incomplete. Download the complete patch.

guix/nar.scm

View file

This diff is incomplete. Download the complete patch.

guix/pk-crypto.scm

View before deletion

This diff is incomplete. Download the complete patch.

guix/pki.scm

View file

This diff is incomplete. Download the complete patch.

guix/scripts/archive.scm

View file

This diff is incomplete. Download the complete patch.

guix/scripts/authenticate.scm

View file

This diff is incomplete. Download the complete patch.

guix/scripts/download.scm

View file

This diff is incomplete. Download the complete patch.

guix/scripts/hash.scm

View file

This diff is incomplete. Download the complete patch.

guix/scripts/pack.scm

View file

This diff is incomplete. Download the complete patch.

guix/scripts/publish.scm

View file

This diff is incomplete. Download the complete patch.

guix/scripts/refresh.scm

View file

This diff is incomplete. Download the complete patch.

guix/scripts/substitute.scm

View file

This diff is incomplete. Download the complete patch.

guix/self.scm

View file

This diff is incomplete. Download the complete patch.

guix/store.scm

View file

This diff is incomplete. Download the complete patch.

guix/store/deduplication.scm

View file

This diff is incomplete. Download the complete patch.

guix/tests.scm

View file

This diff is incomplete. Download the complete patch.

m4/guix.m4

View file

This diff is incomplete. Download the complete patch.

tests/base32.scm

View file

This diff is incomplete. Download the complete patch.

tests/builders.scm

View file

This diff is incomplete. Download the complete patch.

tests/challenge.scm

View file

This diff is incomplete. Download the complete patch.

tests/cpan.scm

View file

This diff is incomplete. Download the complete patch.

tests/crate.scm

View file

This diff is incomplete. Download the complete patch.

tests/derivations.scm

View file

This diff is incomplete. Download the complete patch.

tests/gem.scm

View file

This diff is incomplete. Download the complete patch.

tests/hash.scm

View before deletion

This diff is incomplete. Download the complete patch.

tests/nar.scm

View file

This diff is incomplete. Download the complete patch.

tests/opam.scm

View file

This diff is incomplete. Download the complete patch.

tests/packages.scm

View file

This diff is incomplete. Download the complete patch.

tests/pk-crypto.scm

View before deletion

This diff is incomplete. Download the complete patch.

tests/pki.scm

View file

This diff is incomplete. Download the complete patch.

tests/publish.scm

View file

This diff is incomplete. Download the complete patch.

tests/pypi.scm

View file

This diff is incomplete. Download the complete patch.

tests/store-deduplication.scm

View file

This diff is incomplete. Download the complete patch.

tests/store.scm

View file

This diff is incomplete. Download the complete patch.

tests/substitute.scm

View file

This diff is incomplete. Download the complete patch.