~ruther/guix-local

4f35ff1275e05be31f5d41464ccf147e9dbfd016 — Guillaume Le Vaillant 2 years ago 7e82d4e + 69aadc9
Merge branch 'lisp-team'
5 files changed, 173 insertions(+), 223 deletions(-)

M gnu/local.mk
M gnu/packages/lisp-xyz.scm
M gnu/packages/lisp.scm
M gnu/packages/maths.scm
D gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch
M gnu/local.mk => gnu/local.mk +0 -1
@@ 1946,7 1946,6 @@ dist_patch_DATA =						\
  %D%/packages/patches/sbcl-clml-fix-types.patch		\
  %D%/packages/patches/sbcl-eazy-gnuplot-skip-path-check.patch	\
  %D%/packages/patches/sbcl-png-fix-sbcl-compatibility.patch	\
  %D%/packages/patches/sbcl-riscv-Make-contribs-build-again.patch	\
  %D%/packages/patches/scalapack-gcc-10-compilation.patch	\
  %D%/packages/patches/scheme48-tests.patch			\
  %D%/packages/patches/scons-test-environment.patch		\

M gnu/packages/lisp-xyz.scm => gnu/packages/lisp-xyz.scm +81 -59
@@ 1281,27 1281,40 @@ timeouts.")
(define-public sbcl-bordeaux-threads
  (package
    (name "sbcl-bordeaux-threads")
    (version "0.8.8")
    (version "0.9.2")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/sionescu/bordeaux-threads")
                    (commit (string-append "v" version))))
              (sha256
               (base32 "19i443fz3488v1pbbr9x24y8h8vlyhny9vj6c9jk5prm702awrp6"))
              (file-name
               (git-file-name "bordeaux-threads" version))))
    (inputs (list sbcl-alexandria))
               (base32 "0d9sd7pm91yhln95z8nclhn6n4l5b2cp3pxpggpmpv7rsq84ssmh"))
              (file-name (git-file-name "cl-bordeaux-threads" version))))
    (inputs (list sbcl-alexandria
                  sbcl-global-vars
                  sbcl-trivial-features
                  sbcl-trivial-garbage))
    (native-inputs (list sbcl-fiveam))
    (build-system asdf-build-system/sbcl)
    (arguments
     (list
       #:phases
       #~(modify-phases %standard-phases
           (add-after 'unpack 'silence-deprecation-warning
             (lambda _
               ;; The deprecation warning for APIv1 makes the build of some
               ;; of the dependents of bordeaux-threads fail because they
               ;; interpret it as an error instead of a simple indication.
               ;; Let's silence this warning for now.
               (substitute* (cons* "apiv1/default-implementations.lisp"
                                   (find-files "apiv1" "impl-.*\\.lisp"))
                 (("\\(warn \"Bordeaux-Threads APIv1 is deprecated\\. Please migrate to APIv2\\.\"\\)")
                  ""))))
           (add-after 'unpack 'adjust-test-sleep
             (lambda _
               ;; 0.001 is too short for some slower machines.
               (substitute* "test/bordeaux-threads-test.lisp"
               (substitute* '("test/tests-v1.lisp"
                              "test/tests-v2.lisp")
                 (("sleep 0\\.001") "sleep 0.002")))))))
    (synopsis "Portable shared-state concurrency library for Common Lisp")
    (description "BORDEAUX-THREADS is a proposed standard for a minimal


@@ 22181,58 22194,67 @@ fit together as required by any particular game.")
  (sbcl-package->cl-source-package sbcl-trial))

(define-public sbcl-virality
  (package
    (name "sbcl-virality")
    (version "0.3.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/bufferswap/ViralityEngine")
             (commit (string-append "v" version))))
       (file-name (git-file-name "cl-virality" version))
       (sha256
        (base32 "0hvjcvyd628jh4if6swk1wrfb9qdlnpk9ax1y3jarr8ms7ghfcdb"))))
    (build-system asdf-build-system/sbcl)
    (arguments
     `(#:asd-systems '("virality"
                       "vorigin"
                       "vorigin.test"
                       "vshadow"
                       "vumbra"
                       "vutils")
       #:phases (modify-phases %standard-phases
                  (add-after 'unpack 'delete-examples
                    (lambda _
                      ;; Don't install the big "examples" directory.
                      (delete-file-recursively "examples"))))))
    (inputs
     (list sbcl-3b-bmfont
           sbcl-babel
           sbcl-cl-cpus
           sbcl-cl-graph
           sbcl-cl-opengl
           sbcl-cl-ppcre
           sbcl-cl-slug
           sbcl-closer-mop
           sbcl-fast-io
           sbcl-global-vars
           sbcl-glsl-packing
           sbcl-jsown
           sbcl-lparallel
           sbcl-pngload
           sbcl-printv
           sbcl-queues
           sbcl-sdl2
           sbcl-serapeum
           sbcl-split-sequence
           sbcl-static-vectors
           sbcl-trivial-features
           sbcl-varjo))
    (home-page "https://github.com/bufferswap/ViralityEngine")
    (synopsis "Component-based game engine written in Common Lisp")
    (description
     "Virality Engine provides a system and workflow that helps describe the
  (let ((commit "cdc19cca9b028f0c30d14ed8b3e51359dd46069a")
        (revision "1"))
    (package
      (name "sbcl-virality")
      (version (git-version "0.3.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/bufferswap/ViralityEngine")
               (commit commit)))
         (file-name (git-file-name "cl-virality" version))
         (sha256
          (base32 "1s25aapkqcr8fxi0i9wjw0n4jax7r4a9d9wflpr3sqz2vgrg2lz6"))))
      (build-system asdf-build-system/sbcl)
      (arguments
       `(#:asd-systems '("virality"
                         "vorigin"
                         "vorigin.test"
                         "vshadow"
                         "vumbra"
                         "vutils")
         #:phases (modify-phases %standard-phases
                    (add-after 'unpack 'delete-examples
                      (lambda _
                        ;; Don't install the big "examples" directory.
                        (delete-file-recursively "examples")
                        ;; Remove example asd files that cause issues during
                        ;; the 'copy-source' phase because they have the same
                        ;; names.
                        (for-each
                         delete-file
                         (find-files "."
                                     "^xXx-SYSTEM-NAME-xXx\\.asd$")))))))
      (inputs
       (list sbcl-3b-bmfont
             sbcl-babel
             sbcl-cl-cpus
             sbcl-cl-graph
             sbcl-cl-opengl
             sbcl-cl-ppcre
             sbcl-cl-slug
             sbcl-closer-mop
             sbcl-fast-io
             sbcl-global-vars
             sbcl-glsl-packing
             sbcl-jsown
             sbcl-lparallel
             sbcl-pngload
             sbcl-printv
             sbcl-queues
             sbcl-sdl2
             sbcl-serapeum
             sbcl-split-sequence
             sbcl-static-vectors
             sbcl-trivial-features
             sbcl-varjo))
      (home-page "https://github.com/bufferswap/ViralityEngine")
      (synopsis "Component-based game engine written in Common Lisp")
      (description
       "Virality Engine provides a system and workflow that helps describe the
elements needed to write 2D or 3D games.  It was designed with several domain
specific languages that make it easier to describe, manipulate, and use assets
commonly found in game making.  Such assets include (but are not limited to)


@@ 22246,7 22268,7 @@ can be used with them.  Components are added to Actors which represent game
concepts like players, scenery, effects, etc.  We define a component protocol
invoked by Virality Engine to move your components to the next state and
render them each frame.")
    (license license:expat)))
      (license license:expat))))

(define-public cl-virality
  (sbcl-package->cl-source-package sbcl-virality))

M gnu/packages/lisp.scm => gnu/packages/lisp.scm +10 -7
@@ 17,7 17,7 @@
;;; Copyright © 2019-2023 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2021, 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2021 Paul A. Patience <paul@apatience.com>
;;; Copyright © 2021 Charles Jackson <charles.b.jackson@protonmail.com>
;;; Copyright © 2022 Joeke de Graaf <joeke@posteo.net>


@@ 25,6 25,7 @@
;;; Copyright © 2022 ( <paren@disroot.org>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
;;; Copyright © 2023 Andrew Kravchuk <awkravchuk@gmail.com.
;;;
;;; This file is part of GNU Guix.
;;;


@@ 266,7 267,7 @@ interface to the Tk widget system.")
(define-public ecl
  (package
    (name "ecl")
    (version "21.2.1")
    (version "23.9.9")
    (source
     (origin
       (method url-fetch)


@@ 274,7 275,7 @@ interface to the Tk widget system.")
             "https://ecl.common-lisp.dev/static/files/release/"
             name "-" version ".tgz"))
       (sha256
        (base32 "000906nnq25177bgsfndiw3iqqgrjc9spk10hzk653sbz3f7anmi"))))
        (base32 "107q6gmxlsya4yv38r1x1axrgyyfgdrfkkz97zfp64bcrasdl6y5"))))
    (build-system gnu-build-system)
    ;; src/configure uses 'which' to confirm the existence of 'gzip'.
    (native-inputs


@@ 381,6 382,10 @@ supporting ASDF, Sockets, Gray streams, MOP, and other useful components.")
                                                     (%current-target-system)))
                                 '("CFLAGS=-falign-functions=4")
                                 '())
                           ,@(if (target-x86-64?)
                                 '("--enable-portability"
                                   "--with-threads=POSIX_THREADS")
                                 '())
                            "--with-dynamic-ffi"
                            "--with-dynamic-modules"
                            "--with-ffcall"


@@ 434,17 439,15 @@ an interpreter, a compiler, a debugger, and much more.")
(define-public sbcl
  (package
    (name "sbcl")
    (version "2.3.5")
    (version "2.3.7")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "mirror://sourceforge/sbcl/sbcl/" version "/sbcl-"
                           version "-source.tar.bz2"))
       (sha256
        (base32 "11ji5n65l31249r0v7hm0wc0yk2ila0y746nj36xn1cxrwh0gjc9"))
        (base32 "1xwr1pnwd3xj375ainlad7mm479rk2mrks8dc6d92cash3xl90b9"))
       (modules '((guix build utils)))
       ;; backport from upstream.
       (patches (search-patches "sbcl-riscv-Make-contribs-build-again.patch"))
       (snippet
        '(begin
           ;; Don't force ARMv5.

M gnu/packages/maths.scm => gnu/packages/maths.scm +82 -85
@@ 48,7 48,7 @@
;;; Copyright © 2021, 2022 Paul A. Patience <paul@apatience.com>
;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me>
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2021, 2023 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2021 Pierre-Antoine Bouttier <pierre-antoine.bouttier@univ-grenoble-alpes.fr>
;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>


@@ 4312,102 4312,99 @@ to BMP, JPEG or PNG image formats.")
(define-public maxima
  (package
    (name "maxima")
    (version "5.46.0")
    (version "5.47.0")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "mirror://sourceforge/maxima/Maxima-source/"
                           version "-source/" name "-" version ".tar.gz"))
       (sha256
        (base32
         "01wbm8jj43p7gpdj4h55aij0b44bjydn4bwb7q1wjrfs91mz143k"))
        (base32 "0yhgsi7s22bpblrmrj60x0jsjdz98b5hjdcq7b0fhlzx4hdh414i"))
       (patches (search-patches "maxima-defsystem-mkdir.patch"))))
    (build-system gnu-build-system)
    (inputs
     `(("bash" ,bash-minimal)
       ("gnuplot" ,gnuplot)                       ;for plots
       ("sbcl" ,sbcl)
       ("sed" ,sed)
       ("tk" ,tk)))                               ;Tcl/Tk is used by 'xmaxima'
     (list bash-minimal
           gnuplot                       ;for plots
           sbcl
           sed
           tk))                          ;Tcl/Tk is used by 'xmaxima'
    (native-inputs
     (list texinfo perl python))
    (arguments
     `(#:configure-flags
       ,#~(list "--enable-sbcl"
                (string-append "--with-sbcl=" #$sbcl "/bin/sbcl")
                (string-append "--with-posix-shell=" #$bash-minimal "/bin/sh")
                (string-append "--with-wish=" #$tk "/bin/wish"
                               #$(version-major+minor (package-version tk))))
       ;; By default Maxima attempts to write temporary files to
       ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
       ;; Work around that.
       #:make-flags (list "TMPDIR=/tmp")
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-paths
           (lambda* (#:key inputs #:allow-other-keys)
             (let* ((sed (search-input-file inputs "/bin/sed"))
                    (coreutils (assoc-ref inputs "coreutils"))
                    (dirname (string-append coreutils "/bin/dirname"))
                    (head (string-append coreutils "/bin/head"))
                    (perl (search-input-file inputs "/bin/perl"))
                    (python (search-input-file inputs "/bin/python3")))
               (substitute* "src/maxima.in"
                 (("sed ") (string-append sed " "))
                 (("dirname") dirname)
                 (("head") head))
               (substitute* "doc/info/Makefile.in"
                 (("/usr/bin/env perl") perl))
               (substitute* "doc/info/build_html.sh.in"
                 (("python") python))
               #t)))
         (add-before 'check 'pre-check
           (lambda _
             (chmod "src/maxima" #o555)
             #t))
         (replace 'check
           (lambda _
             ;; This is derived from the testing code in the "debian/rules" file
             ;; of Debian's Maxima package.
             ;; If Maxima can successfully run this, the binary to be installed
             ;; should be fine.
             (invoke "sh" "-c"
                     (string-append
                      "./maxima-local "
                      "--lisp=sbcl "
                      "--batch-string=\"run_testsuite();\" "
                      "| grep -q \"No unexpected errors found\""))))
         ;; Make sure the doc and emacs files are found in the
         ;; standard location.  Also configure maxima to find gnuplot
         ;; without having it on the PATH.
         (add-after 'install 'post-install
           (lambda* (#:key outputs inputs #:allow-other-keys)
             (let* ((gnuplot (assoc-ref inputs "gnuplot"))
                    (out (assoc-ref outputs "out"))
                    (datadir (string-append out "/share/maxima/" ,version))
                    (binutils (dirname (search-input-file inputs "/bin/as"))))
               (with-directory-excursion out
                 (mkdir-p "share/emacs")
                 (mkdir-p "share/doc")
                 (symlink
                  (string-append datadir "/doc/")
                  (string-append out "/share/doc/maxima"))
                 (with-atomic-file-replacement
                  (string-append datadir "/share/maxima-init.lisp")
                  (lambda (in out)
                    (format out "~a ~s~a~%"
                            "(setf $gnuplot_command "
                            (string-append gnuplot "/bin/gnuplot") ")")
                    (dump-port in out))))
               ;; Ensure that Maxima will have access to the GNU binutils
               ;; components at runtime.
               (wrap-program (string-append out "/bin/maxima")
                 `("PATH" prefix (,binutils))))
             #t))
         ;; The Maxima command ‘describe’ allows picking the relevant portions
         ;; from Maxima’s Texinfo docs.  However it does not support reading
         ;; gzipped info files.
         (delete 'compress-documentation))))
     (list
      #:configure-flags
      #~(list "--enable-sbcl"
              (string-append "--with-sbcl=" #$sbcl "/bin/sbcl")
              (string-append "--with-posix-shell=" #$bash-minimal "/bin/sh")
              (string-append "--with-wish=" #$tk "/bin/wish"
                             #$(version-major+minor (package-version tk))))
      ;; By default Maxima attempts to write temporary files to
      ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
      ;; Work around that.
      #:make-flags #~(list "TMPDIR=/tmp")
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'patch-paths
            (lambda* (#:key inputs #:allow-other-keys)
              (let* ((sed (search-input-file inputs "/bin/sed"))
                     (coreutils (assoc-ref inputs "coreutils"))
                     (dirname (string-append coreutils "/bin/dirname"))
                     (head (string-append coreutils "/bin/head"))
                     (perl (search-input-file inputs "/bin/perl"))
                     (python (search-input-file inputs "/bin/python3")))
                (substitute* "src/maxima.in"
                  (("sed ") (string-append sed " "))
                  (("dirname") dirname)
                  (("head") head))
                (substitute* "doc/info/Makefile.in"
                  (("/usr/bin/env perl") perl))
                (substitute* "doc/info/build_html.sh.in"
                  (("python") python)))))
          (add-before 'check 'pre-check
            (lambda _
              (chmod "src/maxima" #o555)))
          (replace 'check
            (lambda _
              ;; This is derived from the testing code in the "debian/rules" file
              ;; of Debian's Maxima package.
              ;; If Maxima can successfully run this, the binary to be installed
              ;; should be fine.
              (invoke "sh" "-c"
                      (string-append
                       "./maxima-local "
                       "--lisp=sbcl "
                       "--batch-string=\"run_testsuite();\" "
                       "| grep -q \"No unexpected errors found\""))))
          ;; Make sure the doc and emacs files are found in the
          ;; standard location.  Also configure maxima to find gnuplot
          ;; without having it on the PATH.
          (add-after 'install 'post-install
            (lambda* (#:key outputs inputs #:allow-other-keys)
              (let* ((gnuplot (assoc-ref inputs "gnuplot"))
                     (out (assoc-ref outputs "out"))
                     (datadir (string-append out "/share/maxima/" #$version))
                     (binutils (dirname (search-input-file inputs "/bin/as"))))
                (with-directory-excursion out
                  (mkdir-p "share/emacs")
                  (mkdir-p "share/doc")
                  (symlink
                   (string-append datadir "/doc/")
                   (string-append out "/share/doc/maxima"))
                  (with-atomic-file-replacement
                   (string-append datadir "/share/maxima-init.lisp")
                   (lambda (in out)
                     (format out "~a ~s~a~%"
                             "(setf $gnuplot_command "
                             (string-append gnuplot "/bin/gnuplot") ")")
                     (dump-port in out))))
                ;; Ensure that Maxima will have access to the GNU binutils
                ;; components at runtime.
                (wrap-program (string-append out "/bin/maxima")
                  `("PATH" prefix (#$binutils))))))
          ;; The Maxima command ‘describe’ allows picking the relevant portions
          ;; from Maxima’s Texinfo docs.  However it does not support reading
          ;; gzipped info files.
          (delete 'compress-documentation))))
    (home-page "https://maxima.sourceforge.io")
    (synopsis "Numeric and symbolic expression manipulation")
    (description "Maxima is a system for the manipulation of symbolic and

D gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch => gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch +0 -71
@@ 1,71 0,0 @@
From 8704f528f227f587d0e06dfd2f807aeca7a69a71 Mon Sep 17 00:00:00 2001
From: Charles Zhang <charleszhang99@yahoo.com>
Date: Thu, 1 Jun 2023 16:39:26 +0200
Subject: [PATCH] riscv: Make contribs build again.

The issue was that the LINKAGE_TEMP_REG being NL3 was a C argument
register, so of course that caused clashing on C call-out, causing
problems with run-program. Going back to NL7 didn't work either
because it wasn't getting saved before entry into the trampoline. The
code here used to have NL7 before the trampoline code was gutted and
then restored, so I'm wondering how this ever worked before, because
it definitely did. Pick LIP as the TEMP_REG now because not only does
it get saved, it's also the least likely thing to get disturbed by
clobbering.

Fixes #lp2002930.

Also remove assembly routine printing because it doesn't need to be
part of the build script (unlike the other files in output/ which
can't trivially be recovered from a built image), and because not all
disassembler printers have been written on riscv yet.
---
 NEWS                     | 3 +++
 make-target-2-load.lisp  | 4 ----
 src/runtime/riscv-arch.c | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index 17537ff92..5c0f7777b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 ;;;; -*- coding: utf-8; fill-column: 78 -*-
 
+changes relative to sbcl-2.3.5:
+  * bug fix: riscv can build contribs again.
+
 changes in sbcl-2.3.5 relative to sbcl-2.3.4:
   * enhancement: Unicode support has been updated to support version 15.0.0 of
     the Unicode standard, including addition of characters and their collation
diff --git a/make-target-2-load.lisp b/make-target-2-load.lisp
index 885ebda74..b9a1a1e36 100644
--- a/make-target-2-load.lisp
+++ b/make-target-2-load.lisp
@@ -6,10 +6,6 @@
 (defvar *compile-files-p* nil)
 (load (merge-pathnames "src/cold/warm.lisp" *load-pathname*))
 
-(with-open-file (stream "output/asm-routines.txt" :direction :output
-                        :if-does-not-exist :create :if-exists :supersede)
-  (sb-c:dis sb-fasl:*assembler-routines* stream))
-
 ;; sb-xref-for-internals is actively harmful to tree-shaking.
 ;; Remove some symbols to make the hide-packages test pass.
 #+sb-xref-for-internals
diff --git a/src/runtime/riscv-arch.c b/src/runtime/riscv-arch.c
index 6c1994829..062623899 100644
--- a/src/runtime/riscv-arch.c
+++ b/src/runtime/riscv-arch.c
@@ -159,7 +159,7 @@ arch_install_interrupt_handlers(void)
  * Linkage entry size is 8 or 20, because we need 2 instructions for the 32-bit case and we need 3 instructions and an 8 byte address in the 64-bit case.
  */
 
-#define LINKAGE_TEMP_REG reg_NL3
+#define LINKAGE_TEMP_REG reg_LIP // Lisp needs to save before entry.
 
 void arch_write_linkage_table_entry(int index, void *target_addr, int datap)
 {
-- 
2.40.1