gnu: guile: Add 3.0.11.

This reinstates 2b3782eb6e, 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 <yelninei@tutamail.com>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #5360
This commit is contained in:
Ludovic Courtès 2025-12-08 16:47:57 +01:00 committed by Andreas Enge
parent b5ab02eada
commit ceaf4c4ead
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3
3 changed files with 79 additions and 3 deletions

View file

@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
# Copyright © 2012-2025 Ludovic Courtès <ludo@gnu.org>
# Copyright © 2012-2026 Ludovic Courtès <ludo@gnu.org>
# Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2022, 2023, 2024, 2025 Andreas Enge <andreas@enge.fr>
# Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
# Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Mark H Weaver <mhw@netris.org>
@ -1542,6 +1542,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 \

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012-2025 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2012-2026 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2014, 2016, 2018 David Thompson <davet@gnu.org>
;;; Copyright © 2014, 2017, 2018 Mark H Weaver <mhw@netris.org>
@ -477,7 +477,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.

View file

@ -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)))