guix_mirror_bot pushed a commit to branch next-master
in repository guix.

commit c6fbec50f44bc5a94eb01e2f39fc21147c1cfe15
Author: Ludovic Courtès <[email protected]>
AuthorDate: Mon Dec 8 16:47:57 2025 +0100

    gnu: guile: Add 3.0.11.
    
    This reinstates 2b3782eb6efc95fe752fe3199fa54561ec8dd7fd, which was reverted
    in f54a032cec760ff2c3af87e5a45dd305a84dfa48; see
    <https://codeberg.org/guix/guix/pulls/4747>.
    
    * gnu/packages/guile.scm (guile-3.0.11): New variable.
    (guile-3.0-latest): Add comment.
    * gnu/packages/patches/guile-3.0.11-cross-compilation.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Add it.
    
    Change-Id: Id8ec934bb504750a5cefb5d417eab84175c47d01
    Co-authored-by: Yelninei <[email protected]>
    Signed-off-by: Ludovic Courtès <[email protected]>
    Merges: #5360
---
 gnu/local.mk                                       |  3 +-
 gnu/packages/guile.scm                             | 50 +++++++++++++++++++++-
 .../patches/guile-3.0.11-cross-compilation.patch   | 29 +++++++++++++
 3 files changed, 79 insertions(+), 3 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 497a93944b..17e7ac922c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2012-2025 Ludovic Courtès <[email protected]>
+# Copyright © 2012-2026 Ludovic Courtès <[email protected]>
 # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2022, 2023, 
2024, 2025 Andreas Enge <[email protected]>
 # Copyright © 2016 Mathieu Lirzin <[email protected]>
 # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Mark H 
Weaver <[email protected]>
@@ -1541,6 +1541,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/guile-default-utf8.patch                        \
   %D%/packages/patches/guile-2.2-default-utf8.patch            \
   %D%/packages/patches/guile-relocatable.patch                 \
+  %D%/packages/patches/guile-3.0.11-cross-compilation.patch    \
   %D%/packages/patches/guile-3.0-relocatable.patch             \
   %D%/packages/patches/guile-linux-syscalls.patch              \
   %D%/packages/patches/guile-3.0-linux-syscalls.patch          \
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 2980b46f2b..04d2f76e0d 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012-2025 Ludovic Courtès <[email protected]>
+;;; Copyright © 2012-2026 Ludovic Courtès <[email protected]>
 ;;; Copyright © 2014 Cyril Roelandt <[email protected]>
 ;;; Copyright © 2014, 2016, 2018 David Thompson <[email protected]>
 ;;; Copyright © 2014, 2017, 2018 Mark H Weaver <[email protected]>
@@ -474,7 +474,53 @@ without requiring the source code to be rewritten.")
             (variable "GUILE_EXTENSIONS_PATH")
             (files '("lib/guile/3.0/extensions")))))))
 
-(define-public guile-3.0-latest guile-3.0)
+(define-public guile-3.0.11
+  (package
+    (inherit guile-3.0)
+    (name "guile")
+    (version "3.0.11")
+    (source
+     (origin
+       (inherit (package-source guile-2.2))
+       (uri (string-append "mirror://gnu/guile/guile-" version ".tar.xz"))
+       (sha256
+        (base32 "0q4laxcraxh3r9s62p6nw3g3n6xlqxy16r5kdylpyyk56v97k341"))
+       (patches (search-patches "guile-3.0.11-cross-compilation.patch"))
+       ;; Replace the snippet because the oom-test still fails on some 32-bit
+       ;; architectures.
+       (snippet '(for-each delete-file
+                           (find-files "prebuilt" "\\.go$")))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments guile-3.0)
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            #$@(if (target-hurd?)
+                   #~((delete 'patch-posix-spawn-usage))
+                   #~())
+            #$@(if (system-hurd?)
+                   #~((replace 'disable-tests
+                        (lambda _
+                          (substitute* "test-suite/Makefile.in"
+                            ;; AF_UNIX/SOCK_STREAM: bind abstract - arguments: 
bind ENOENT
+                            (("tests/00-socket.test")
+                             "")
+                            ;; thread-sleep!: thread sleeps fractions of a 
second
+                            (("tests/srfi-18.test")
+                             "")
+                            ;; flaky: server is listening - arguments: connect 
EINVAL
+                            (("tests/web-server.test")
+                             ""))
+                          ;; failed to remove 't-guild-compile-7215.go.tdL7yC
+                          (substitute* "test-suite/standalone/Makefile.in"
+                            (("test-guild-compile ")
+                             ""))))
+                      (delete 'disable-threads.tests))
+                   #~())))))))
+
+(define-public guile-3.0-latest
+  ;; At the moment 3.0.11 leads to test failures in the 'guix' package so we
+  ;; cannot switch just yet: see <https://codeberg.org/guix/guix/pulls/5360>.
+  guile-3.0)
 
 ;;; The symbol guile-3.0/fixed should be used when guile-3.0 needs fixes
 ;;; (security or else) and this deprecation could be removed.
diff --git a/gnu/packages/patches/guile-3.0.11-cross-compilation.patch 
b/gnu/packages/patches/guile-3.0.11-cross-compilation.patch
new file mode 100644
index 0000000000..5464bdbaca
--- /dev/null
+++ b/gnu/packages/patches/guile-3.0.11-cross-compilation.patch
@@ -0,0 +1,29 @@
+Fix cross-compilation of Guile 3.0.11:
+
+  https://codeberg.org/guile/guile/issues/88
+
+--- a/module/system/base/target.scm
++++ b/module/system/base/target.scm
+@@ -45,15 +45,13 @@
+ ;;;
+ 
+ ;; Hacky way to get native pointer size without having to load (system
+-;; foreign).
+-(define-syntax %native-word-size
+-  (lambda (stx)
+-    (syntax-case stx ()
+-      (id (identifier? #'id)
+-          (cond
+-           ((< most-positive-fixnum (ash 1 32)) 4)
+-           ((< most-positive-fixnum (ash 1 64)) 8)
+-           (else (error "unexpected!" most-positive-fixnum)))))))
++;; foreign).  Note: Use the value of 'most-positive-fixnum' available at
++;; run time, not a macro-expansion time, to ensure the correct value is
++;; used when cross-compiling.
++(define %native-word-size
++  (cond ((< most-positive-fixnum (ash 1 32)) 4)
++        ((< most-positive-fixnum (ash 1 64)) 8)
++        (else (error "unexpected!" most-positive-fixnum))))
+ 
+ (define %target-type (make-fluid %host-type))
+ (define %target-endianness (make-fluid (native-endianness)))

Reply via email to