Subject: [bug#54539] [PATCH v2 16/30] gnu: curl: Autoload unless used by Guix.

From: Maxime Devos <[email-masked]>
Date: Sat, 3 Sep 2022 18:43:18 +0200

See first commit in the series for the procedure.
This helps with, but is not sufficient for, avoiding loading the Go-related
modules when only the guix package is required.
---
 gnu/packages/curl.scm | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/curl.scm b/gnu/packages/curl.scm
index d82d94abff..88a9a9d070 100644
--- a/gnu/packages/curl.scm
+++ b/gnu/packages/curl.scm
@@ -44,20 +44,23 @@ (define-module (gnu packages curl)
   #:use-module (guix build-system meson)
   #:use-module ((guix search-paths) #:select ($SSL_CERT_DIR $SSL_CERT_FILE))
   #:use-module (gnu packages)
-  #:use-module (gnu packages check)
-  #:use-module (gnu packages compression)
-  #:use-module (gnu packages golang)
-  #:use-module (gnu packages guile)
-  #:use-module (gnu packages kerberos)
-  #:use-module (gnu packages logging)
-  #:use-module (gnu packages libevent)
-  #:use-module (gnu packages libidn)
-  #:use-module (gnu packages perl)
-  #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages python)
-  #:use-module (gnu packages ssh)
-  #:use-module (gnu packages tls)
-  #:use-module (gnu packages web)
+  #:autoload (gnu packages check) (doctest)
+  #:use-module (gnu packages compression) ; required by "guix build -d guix"
+  #:autoload (gnu packages golang)
+  (go-github-com-alsm-ioprogress
+   go-github-com-aki237-nscjar go-github-com-urfave-cli go-golang-org-x-crypto
+   go-golang-org-x-sys)
+  #:autoload (gnu packages guile) (guile-2.2 guile-3.0)
+  #:use-module (gnu packages kerberos) ; required by "guix build -d guix"
+  #:autoload (gnu packages logging) (spdlog)
+  #:autoload (gnu packages libevent) (libevent)
+  #:use-module (gnu packages libidn) ; required by "guix build -d guix"
+  #:use-module (gnu packages perl) ; required by "guix build -d guix"
+  #:use-module (gnu packages pkg-config) ; required by "guix build -d guix"
+  #:use-module (gnu packages python) ; required by "guix build -d guix"
+  #:autoload (gnu packages ssh) (libssh2)
+  #:use-module (gnu packages tls) ; required by "guix build -d guix"
+  #:use-module (gnu packages web) ; required by "guix build -d guix"
   #:use-module (srfi srfi-1))
 
 (define-public curl
-- 
2.37.2