Subject: [PATCH]: Update sbcl to 2.2.7

From: André A. Gomes <[email-masked]>
Date: Wed, 10 Aug 2022 12:00:14 +0300

Hi Guix,

The tagged 2.2.7 version of sbcl has some issues.  For instance, maxima
failed to build.

This patch updates sbcl while ensuring that all packages that depend on
it build successfully.  I tested it by issuing

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix build $(./pre-inst-env guix refresh -l sbcl | cut -d ':' -f 2)
--8<---------------cut here---------------end--------------->8---

Find the patched attached.  Thanks.

-- 
André A. Gomes
"You cannot even find the ruins..."
>From e7687c803d2bb021c4ca89185620383761598303 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20A=2E=20Gomes?= <[email-masked]>
Date: Wed, 10 Aug 2022 11:46:15 +0300
Subject: [PATCH 1/2] gnu: sbcl: Update to 2.2.7-0.390809a.

* gnu/packages/lisp.scm (sbcl): Update to 2.2.7-0.390809a.  The tagged 2.2.7
version has issues, hence the revision.
---
 gnu/packages/lisp.scm | 513 +++++++++++++++++++++---------------------
 1 file changed, 260 insertions(+), 253 deletions(-)

diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index 8e59ec956b..142b800632 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -411,262 +411,269 @@ (define-public clisp
     (license license:gpl2+)))
 
 (define-public sbcl
-  (package
-    (name "sbcl")
-    (version "2.2.6")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
-                           version "-source.tar.bz2"))
-       (sha256
-        (base32 "18044dqx37mkipnrzs7jrp0cbnwp6snb5gi06a8zn9m8iy6088ry"))))
-    (build-system gnu-build-system)
-    (outputs '("out" "doc"))
-    (native-inputs
-     ;; From INSTALL:
-     ;;     Supported build hosts are:
-     ;;       SBCL
-     ;;       CMUCL
-     ;;       CCL (formerly known as OpenMCL)
-     ;;       ABCL (recent versions only)
-     ;;       CLISP (only some versions: 2.44.1 is OK, 2.47 is not)
-     ;;       XCL
-     ;;
-     ;; From NEWS:
-     ;;     * build enhancement: new host quirks mechanism, support for building under
-     ;;     ABCL and ECL (as well as CCL, CMUCL, CLISP and SBCL itself)
-     ;;
-     ;; CCL is not bootstrappable so it won't do.  CLISP 2.49 seems to work.
-     ;; ECL too.  As of 2020-07-01, ECL was last updated in 2020 while CLISP
-     ;; was last updated in 2010, and both take about the same time to build SBCL.
-     ;;
-     ;; For now we stick to CLISP as the default for all systems.  In any event, keep
-     ;; the `match' here to make it easier to change the host compiler for various
-     ;; architectures.  Consider switching to ECL if it gets faster than CLISP
-     ;; (maybe post 2020 release).
-     (list (match (%current-system)
-             ("powerpc-linux"       ; CLISP fails to build, needs investigating.
-              ecl)
-             (_
-              clisp))
-           cl-asdf
-           ed
-           inetutils         ;for hostname(1)
-           texinfo
-           (texlive-updmap.cfg (list texlive-tex-texinfo))
-           which))
-    (inputs
-     (list gmp                          ; for sb-gmp
-           mpfr                         ; for sb-mpfr
-           (list zstd "lib")))
-    (arguments
-     `(#:modules ((guix build gnu-build-system)
-                  (guix build utils)
-                  (srfi srfi-1))
-       #:phases
-       (modify-phases %standard-phases
-         ,@(if (target-arm32?)
-             ;; TODO: Move to snippet in staging.
-             `((add-after 'unpack 'dont-force-armv5
-                 (lambda _
-                   (substitute* "src/runtime/Config.arm-linux"
-                     (("-march=armv5") "")))))
-             '())
-         (delete 'configure)
-         (add-after 'unpack 'fix-build-id
-           ;; One of the build scripts makes a build id using the current date.
-           ;; Replace it with a reproducible id using a part of the output hash.
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((hash (substring (assoc-ref outputs "out")
-                                    (+ (string-length (%store-directory)) 1)
-                                    (+ (string-length (%store-directory)) 9))))
-               (substitute* "make-config.sh"
-                 (("echo .* > output/build-id.inc")
-                  (string-append "echo '\"'guix-sbcl-"
-                                 hash
-                                 "'\"' > output/build-id.inc"))))))
-         (add-after 'unpack 'replace-asdf
-           ;; SBCL developers have not committed to keeping ASDF up to date
-           ;; due to breaking changes [1]. Guix can handle this situation
-           ;; easily, and it behooves us to have more control over what version
-           ;; of ASDF we use to build software; therefore, replace the contrib
-           ;; ASDF with the version packaged into Guix.
-           ;; [1] - https://bugs.launchpad.net/sbcl/+bug/1823442
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
-                    (guix-asdf (string-append
-                                cl-asdf
-                                "/share/common-lisp/source/asdf/asdf.lisp"))
-                    (contrib-asdf "contrib/asdf/asdf.lisp"))
-               (copy-file guix-asdf contrib-asdf))
-             #t))
-         (add-before 'build 'patch-unix-tool-paths
-           (lambda* (#:key outputs inputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out"))
-                   (bash (assoc-ref inputs "bash"))
-                   (coreutils (assoc-ref inputs "coreutils"))
-                   (ed (assoc-ref inputs "ed")))
-               (define (quoted-path input path)
-                 (string-append "\"" input path "\""))
-               ;; Patch absolute paths in string literals.  Note that this
-               ;; occurs in some .sh files too (which contain Lisp code).  Use
-               ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
-               (with-fluids ((%default-port-encoding #f))
-                 ;; The removed file is utf-16-be encoded, which gives substitute*
-                 ;; trouble. It does not contain references to the listed programs.
-                 (substitute* (delete
-                               "./tests/data/compile-file-pos-utf16be.lisp"
-                               (find-files "." "\\.(lisp|sh)$"))
-                   (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
-                   (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
-                   (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
-                   (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
-                   (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
-                   (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
-               ;; This one script has a non-string occurrence of /bin/sh.
-               (substitute* '("tests/foreign.test.sh")
-                 ;; Leave whitespace so we don't match the shebang.
-                 ((" /bin/sh ") " sh "))
-               ;; This file contains a module that can create executable files
-               ;; which depend on the presence of SBCL.  It generates shell
-               ;; scripts doing "exec sbcl ..." to achieve this.  We patch both
-               ;; the shebang and the reference to "sbcl", tying the generated
-               ;; executables to the exact SBCL package that generated them.
-               (substitute* '("contrib/sb-executable/sb-executable.lisp")
-                 (("/bin/sh") (string-append bash "/bin/sh"))
-                 (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
-               ;; Disable some tests that fail in our build environment.
-               (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
-                 ;; This requires /etc/protocols.
-                 (("\\(deftest get-protocol-by-name/error" all)
-                  (string-append "#+nil ;disabled by Guix\n" all)))
-               (substitute* '("contrib/sb-posix/posix-tests.lisp")
-                 ;; These assume some users/groups which we don't have.
-                 (("\\(deftest pwent\\.[12]" all)
-                  (string-append "#+nil ;disabled by Guix\n" all))
-                 (("\\(deftest grent\\.[12]" all)
-                  (string-append "#+nil ;disabled by Guix\n" all))))
-             #t))
-         (add-before 'build 'fix-shared-library-makefile
-           (lambda _
-             (substitute* '("src/runtime/GNUmakefile")
-               (("	cc") "	$(CC)"))
-             #t))
-         (add-before 'build 'fix-contrib-library-path
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((gmp (assoc-ref inputs "gmp"))
-                   (mpfr (assoc-ref inputs "mpfr")))
-               (substitute* '("contrib/sb-gmp/gmp.lisp")
-                 (("\"libgmp\\.so") (string-append "\"" gmp "/lib/libgmp.so")))
-               (substitute* '("contrib/sb-mpfr/mpfr.lisp")
-                 (("\"libmpfr\\.so") (string-append "\"" mpfr "/lib/libmpfr.so"))))
-             #t))
-         (replace 'build
-           (lambda* (#:key outputs #:allow-other-keys)
-             (setenv "CC" "gcc")
-             (invoke "sh" "make.sh" ,@(match (%current-system)
-                                        ("powerpc-linux"
-                                         `("ecl"))
-                                        (_
-                                         `("clisp")))
-                     (string-append "--prefix="
-                                    (assoc-ref outputs "out"))
-                     ,@(if (target-ppc32?)
-                         ;; 3072 is too much for this architecture.
-                         `("--dynamic-space-size=2048")
-                         `("--dynamic-space-size=3072"))
-                     "--with-sb-core-compression"
-                     "--with-sb-xref-for-internals"
-                     ;; SB-SIMD will only be built on x86_64 CPUs supporting
-                     ;; AVX2 instructions. Some x86_64 CPUs don't, so for reproducibility
-                     ;; we disable it and we don't build its documentation (see the
-                     ;; 'build-doc' phase).
-                     "--without-sb-simd")))
-         (add-after 'build 'build-shared-library
-           (lambda* (#:key outputs #:allow-other-keys)
-             (setenv "CC" "gcc")
-             (invoke "sh" "make-shared-library.sh")))
-         (replace 'install
-           (lambda _
-             (invoke "sh" "install.sh")))
-         (add-after 'build 'build-doc
-           (lambda _
-             ;; Don't build the documentation for SB-SIMD as it is disabled in
-             ;; the 'build' phase.
-             (substitute* "doc/manual/generate-texinfo.lisp"
-               (("exclude '\\(\"asdf\"\\)")
-                "exclude '(\"asdf\" \"sb-simd\")"))
-             (with-directory-excursion "doc/manual"
-               (and  (invoke "make" "info")
-                     (invoke "make" "dist")))))
-         (add-after 'build 'build-source
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (rc (string-append out "/lib/sbcl/sbclrc"))
-                    (source-dir (string-append out "/share/sbcl")))
-               (for-each (lambda (p)
-                           (copy-recursively p (string-append source-dir "/" p)))
-                         '("src" "contrib"))
-               (mkdir-p (dirname rc))
-               (with-output-to-file rc
-                 (lambda ()
-                   (display
-                    (string-append "(sb-ext:set-sbcl-source-location \""
-                                   source-dir "\")") )))
-               #t)))
-         (add-after 'install 'remove-coreutils-references
-           ;; They are only useful on non-Linux, non-SBCL.
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (share-dir (string-append out "/share/sbcl/")))
-               (substitute* (string-append share-dir "src/code/run-program.lisp")
-                 (("\\(run-program \".*uname\"")
-                  "(run-program \"uname\""))
-               (substitute* (string-append share-dir "contrib/asdf/asdf.lisp")
-                 (("\\(\".*/usr/bin/env\"")
-                  "(\"/usr/bin/env\""))
-               (substitute* (string-append share-dir "contrib/asdf/uiop.lisp")
-                 (("\\(\".*/usr/bin/env\"")
-                  "(\"/usr/bin/env\""))
-               #t)))
-         (add-after 'install 'install-shared-library
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (lib-dir (string-append out "/lib")))
-               (install-file "src/runtime/libsbcl.so" lib-dir)
-               #t)))
-         (add-after 'install 'install-doc
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (doc (assoc-ref outputs "doc"))
-                    (old-doc-dir (string-append out "/share/doc"))
-                    (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
-               (rmdir (string-append old-doc-dir "/sbcl/html"))
-               (mkdir-p new-doc/sbcl-dir)
-               (copy-recursively (string-append old-doc-dir "/sbcl")
-                                 new-doc/sbcl-dir)
-               (delete-file-recursively old-doc-dir)
-               #t))))
-       ;; No 'check' target, though "make.sh" (build phase) runs tests.
-       #:tests? #f))
-    (native-search-paths
-     (list (search-path-specification
-            (variable "XDG_DATA_DIRS")
-            (files '("share")))
-           (search-path-specification
-            (variable "XDG_CONFIG_DIRS")
-            (files '("etc")))))
-    (home-page "http://www.sbcl.org/")
-    (synopsis "Common Lisp implementation")
-    (description "Steel Bank Common Lisp (SBCL) is a high performance Common
+  (let ((commit "390809ae6f32b8dfbf4f5bd3a10425553f0fb7cd")
+        (revision "0"))
+    (package
+      (name "sbcl")
+      (version (git-version "2.2.7" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference (url "https://git.code.sf.net/p/sbcl/sbcl")
+                             (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0zlypy366zsk0rm91ad27cmary91xpgrbm7al1f1w5cw03yd6k4l"))
+         (snippet
+          '(let ((file (open-file "version.lisp-expr" "w")))
+             (display "\"2.2.7\"" file)
+             (close-port file)))))
+      (build-system gnu-build-system)
+      (outputs '("out" "doc"))
+      (native-inputs
+       ;; From INSTALL:
+       ;;     Supported build hosts are:
+       ;;       SBCL
+       ;;       CMUCL
+       ;;       CCL (formerly known as OpenMCL)
+       ;;       ABCL (recent versions only)
+       ;;       CLISP (only some versions: 2.44.1 is OK, 2.47 is not)
+       ;;       XCL
+       ;;
+       ;; From NEWS:
+       ;;     * build enhancement: new host quirks mechanism, support for building under
+       ;;     ABCL and ECL (as well as CCL, CMUCL, CLISP and SBCL itself)
+       ;;
+       ;; CCL is not bootstrappable so it won't do.  CLISP 2.49 seems to work.
+       ;; ECL too.  As of 2020-07-01, ECL was last updated in 2020 while CLISP
+       ;; was last updated in 2010, and both take about the same time to build SBCL.
+       ;;
+       ;; For now we stick to CLISP as the default for all systems.  In any event, keep
+       ;; the `match' here to make it easier to change the host compiler for various
+       ;; architectures.  Consider switching to ECL if it gets faster than CLISP
+       ;; (maybe post 2020 release).
+       (list (match (%current-system)
+               ("powerpc-linux"   ; CLISP fails to build, needs investigating.
+                ecl)
+               (_
+                clisp))
+             cl-asdf
+             ed
+             inetutils                  ;for hostname(1)
+             texinfo
+             (texlive-updmap.cfg (list texlive-tex-texinfo))
+             which))
+      (inputs
+       (list gmp                        ; for sb-gmp
+             mpfr                       ; for sb-mpfr
+             (list zstd "lib")))
+      (arguments
+       `(#:modules ((guix build gnu-build-system)
+                    (guix build utils)
+                    (srfi srfi-1))
+         #:phases
+         (modify-phases %standard-phases
+           ,@(if (target-arm32?)
+                 ;; TODO: Move to snippet in staging.
+                 `((add-after 'unpack 'dont-force-armv5
+                     (lambda _
+                       (substitute* "src/runtime/Config.arm-linux"
+                         (("-march=armv5") "")))))
+                 '())
+           (delete 'configure)
+           (add-after 'unpack 'fix-build-id
+             ;; One of the build scripts makes a build id using the current date.
+             ;; Replace it with a reproducible id using a part of the output hash.
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((hash (substring (assoc-ref outputs "out")
+                                      (+ (string-length (%store-directory)) 1)
+                                      (+ (string-length (%store-directory)) 9))))
+                 (substitute* "make-config.sh"
+                   (("echo .* > output/build-id.inc")
+                    (string-append "echo '\"'guix-sbcl-"
+                                   hash
+                                   "'\"' > output/build-id.inc"))))))
+           (add-after 'unpack 'replace-asdf
+             ;; SBCL developers have not committed to keeping ASDF up to date
+             ;; due to breaking changes [1]. Guix can handle this situation
+             ;; easily, and it behooves us to have more control over what version
+             ;; of ASDF we use to build software; therefore, replace the contrib
+             ;; ASDF with the version packaged into Guix.
+             ;; [1] - https://bugs.launchpad.net/sbcl/+bug/1823442
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let* ((cl-asdf (assoc-ref inputs "cl-asdf"))
+                      (guix-asdf (string-append
+                                  cl-asdf
+                                  "/share/common-lisp/source/asdf/asdf.lisp"))
+                      (contrib-asdf "contrib/asdf/asdf.lisp"))
+                 (copy-file guix-asdf contrib-asdf))
+               #t))
+           (add-before 'build 'patch-unix-tool-paths
+             (lambda* (#:key outputs inputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out"))
+                     (bash (assoc-ref inputs "bash"))
+                     (coreutils (assoc-ref inputs "coreutils"))
+                     (ed (assoc-ref inputs "ed")))
+                 (define (quoted-path input path)
+                   (string-append "\"" input path "\""))
+                 ;; Patch absolute paths in string literals.  Note that this
+                 ;; occurs in some .sh files too (which contain Lisp code).  Use
+                 ;; ISO-8859-1 because some of the files are ISO-8859-1 encoded.
+                 (with-fluids ((%default-port-encoding #f))
+                   ;; The removed file is utf-16-be encoded, which gives substitute*
+                   ;; trouble. It does not contain references to the listed programs.
+                   (substitute* (delete
+                                 "./tests/data/compile-file-pos-utf16be.lisp"
+                                 (find-files "." "\\.(lisp|sh)$"))
+                     (("\"/bin/sh\"") (quoted-path bash "/bin/sh"))
+                     (("\"/usr/bin/env\"") (quoted-path coreutils "/usr/bin/env"))
+                     (("\"/bin/cat\"") (quoted-path coreutils "/bin/cat"))
+                     (("\"/bin/ed\"") (quoted-path ed "/bin/ed"))
+                     (("\"/bin/echo\"") (quoted-path coreutils "/bin/echo"))
+                     (("\"/bin/uname\"") (quoted-path coreutils "/bin/uname"))))
+                 ;; This one script has a non-string occurrence of /bin/sh.
+                 (substitute* '("tests/foreign.test.sh")
+                   ;; Leave whitespace so we don't match the shebang.
+                   ((" /bin/sh ") " sh "))
+                 ;; This file contains a module that can create executable files
+                 ;; which depend on the presence of SBCL.  It generates shell
+                 ;; scripts doing "exec sbcl ..." to achieve this.  We patch both
+                 ;; the shebang and the reference to "sbcl", tying the generated
+                 ;; executables to the exact SBCL package that generated them.
+                 (substitute* '("contrib/sb-executable/sb-executable.lisp")
+                   (("/bin/sh") (string-append bash "/bin/sh"))
+                   (("exec sbcl") (string-append "exec " out "/bin/sbcl")))
+                 ;; Disable some tests that fail in our build environment.
+                 (substitute* '("contrib/sb-bsd-sockets/tests.lisp")
+                   ;; This requires /etc/protocols.
+                   (("\\(deftest get-protocol-by-name/error" all)
+                    (string-append "#+nil ;disabled by Guix\n" all)))
+                 (substitute* '("contrib/sb-posix/posix-tests.lisp")
+                   ;; These assume some users/groups which we don't have.
+                   (("\\(deftest pwent\\.[12]" all)
+                    (string-append "#+nil ;disabled by Guix\n" all))
+                   (("\\(deftest grent\\.[12]" all)
+                    (string-append "#+nil ;disabled by Guix\n" all))))
+               #t))
+           (add-before 'build 'fix-shared-library-makefile
+             (lambda _
+               (substitute* '("src/runtime/GNUmakefile")
+                 (("	cc") "	$(CC)"))
+               #t))
+           (add-before 'build 'fix-contrib-library-path
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((gmp (assoc-ref inputs "gmp"))
+                     (mpfr (assoc-ref inputs "mpfr")))
+                 (substitute* '("contrib/sb-gmp/gmp.lisp")
+                   (("\"libgmp\\.so") (string-append "\"" gmp "/lib/libgmp.so")))
+                 (substitute* '("contrib/sb-mpfr/mpfr.lisp")
+                   (("\"libmpfr\\.so") (string-append "\"" mpfr "/lib/libmpfr.so"))))
+               #t))
+           (replace 'build
+             (lambda* (#:key outputs #:allow-other-keys)
+               (setenv "CC" "gcc")
+               (invoke "sh" "make.sh" ,@(match (%current-system)
+                                          ("powerpc-linux"
+                                           `("ecl"))
+                                          (_
+                                           `("clisp")))
+                       (string-append "--prefix="
+                                      (assoc-ref outputs "out"))
+                       ,@(if (target-ppc32?)
+                             ;; 3072 is too much for this architecture.
+                             `("--dynamic-space-size=2048")
+                             `("--dynamic-space-size=3072"))
+                       "--with-sb-core-compression"
+                       "--with-sb-xref-for-internals"
+                       ;; SB-SIMD will only be built on x86_64 CPUs supporting
+                       ;; AVX2 instructions. Some x86_64 CPUs don't, so for reproducibility
+                       ;; we disable it and we don't build its documentation (see the
+                       ;; 'build-doc' phase).
+                       "--without-sb-simd")))
+           (add-after 'build 'build-shared-library
+             (lambda* (#:key outputs #:allow-other-keys)
+               (setenv "CC" "gcc")
+               (invoke "sh" "make-shared-library.sh")))
+           (replace 'install
+             (lambda _
+               (invoke "sh" "install.sh")))
+           (add-after 'build 'build-doc
+             (lambda _
+               ;; Don't build the documentation for SB-SIMD as it is disabled in
+               ;; the 'build' phase.
+               (substitute* "doc/manual/generate-texinfo.lisp"
+                 (("exclude '\\(\"asdf\"\\)")
+                  "exclude '(\"asdf\" \"sb-simd\")"))
+               (with-directory-excursion "doc/manual"
+                 (and  (invoke "make" "info")
+                       (invoke "make" "dist")))))
+           (add-after 'build 'build-source
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (rc (string-append out "/lib/sbcl/sbclrc"))
+                      (source-dir (string-append out "/share/sbcl")))
+                 (for-each (lambda (p)
+                             (copy-recursively p (string-append source-dir "/" p)))
+                           '("src" "contrib"))
+                 (mkdir-p (dirname rc))
+                 (with-output-to-file rc
+                   (lambda ()
+                     (display
+                      (string-append "(sb-ext:set-sbcl-source-location \""
+                                     source-dir "\")") )))
+                 #t)))
+           (add-after 'install 'remove-coreutils-references
+             ;; They are only useful on non-Linux, non-SBCL.
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (share-dir (string-append out "/share/sbcl/")))
+                 (substitute* (string-append share-dir "src/code/run-program.lisp")
+                   (("\\(run-program \".*uname\"")
+                    "(run-program \"uname\""))
+                 (substitute* (string-append share-dir "contrib/asdf/asdf.lisp")
+                   (("\\(\".*/usr/bin/env\"")
+                    "(\"/usr/bin/env\""))
+                 (substitute* (string-append share-dir "contrib/asdf/uiop.lisp")
+                   (("\\(\".*/usr/bin/env\"")
+                    "(\"/usr/bin/env\""))
+                 #t)))
+           (add-after 'install 'install-shared-library
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (lib-dir (string-append out "/lib")))
+                 (install-file "src/runtime/libsbcl.so" lib-dir)
+                 #t)))
+           (add-after 'install 'install-doc
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (doc (assoc-ref outputs "doc"))
+                      (old-doc-dir (string-append out "/share/doc"))
+                      (new-doc/sbcl-dir (string-append doc "/share/doc/sbcl")))
+                 (rmdir (string-append old-doc-dir "/sbcl/html"))
+                 (mkdir-p new-doc/sbcl-dir)
+                 (copy-recursively (string-append old-doc-dir "/sbcl")
+                                   new-doc/sbcl-dir)
+                 (delete-file-recursively old-doc-dir)
+                 #t))))
+         ;; No 'check' target, though "make.sh" (build phase) runs tests.
+         #:tests? #f))
+      (native-search-paths
+       (list (search-path-specification
+              (variable "XDG_DATA_DIRS")
+              (files '("share")))
+             (search-path-specification
+              (variable "XDG_CONFIG_DIRS")
+              (files '("etc")))))
+      (home-page "http://www.sbcl.org/")
+      (synopsis "Common Lisp implementation")
+      (description "Steel Bank Common Lisp (SBCL) is a high performance Common
 Lisp compiler.  In addition to the compiler and runtime system for ANSI Common
 Lisp, it provides an interactive environment including a debugger, a
 statistical profiler, a code coverage tool, and many other extensions.")
-    ;; Public domain in jurisdictions that allow it, bsd-2 otherwise.  MIT
-    ;; loop macro has its own license.  See COPYING file for further notes.
-    (license (list license:public-domain license:bsd-2
-                   (license:x11-style "file://src/code/loop.lisp")))))
+      ;; Public domain in jurisdictions that allow it, bsd-2 otherwise.  MIT
+      ;; loop macro has its own license.  See COPYING file for further notes.
+      (license (list license:public-domain license:bsd-2
+                     (license:x11-style "file://src/code/loop.lisp"))))))
 
 (define-public ccl
   ;; Warning: according to upstream, CCL is not bootstrappable.
-- 
2.37.1

>From a663ce96fe0a0ce9f5fe2b7c70b14a1ac9ebebac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20A=2E=20Gomes?= <[email-masked]>
Date: Wed, 10 Aug 2022 11:50:26 +0300
Subject: [PATCH 2/2] gnu: stumpwm: Update to 22.05-0.9f47673.

* gnu/packages/wm.scm (stumpwm): Update to 22.05-0.9f47673.
---
 gnu/packages/wm.scm | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index f4dcbf742e..24f6a7ef9c 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -1819,23 +1819,24 @@ (define-public kanshi
     (license license:expat))) ; MIT license
 
 (define-public stumpwm
-  (package
+  (let ((commit "9f476737d4431d88728738408592bd7004f71255")
+        (revision "0"))
+    (package
     (name "stumpwm")
-    (version "22.05")
+    (version (git-version "22.05" revision commit))
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
              (url "https://github.com/stumpwm/stumpwm")
-             (commit version)))
-       (file-name (git-file-name "stumpwm" version))
+             (commit commit)))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "12hf70mpwy0ixiyvv8sf8pkwrzz8nb12a8ybvsdpibsxfjxgxnan"))))
+        (base32 "04jifrsp2zs0wvfh87k4xjvndqg4fs4m8ixrlvrilbcl0x01fl36"))))
     (build-system asdf-build-system/sbcl)
     (native-inputs
      (list sbcl-fiasco
            texinfo
-
            ;; To build the manual.
            autoconf
            automake))
@@ -1891,7 +1892,7 @@ (define-public stumpwm
 productive, customizable lisp based systems.")
     (home-page "https://github.com/stumpwm/stumpwm")
     (license license:gpl2+)
-    (properties `((cl-source-variant . ,(delay cl-stumpwm))))))
+    (properties `((cl-source-variant . ,(delay cl-stumpwm)))))))
 
 (define-public sbcl-stumpwm
   (deprecated-package "sbcl-stumpwm" stumpwm))
-- 
2.37.1