Subject: [bug#78826] [PATCH 64/88] gnu: ruby-importmap-rails: Pin the %ruby-rails-version.

From: Nicolas Graves <[email-masked]>
Date: Wed, 18 Jun 2025 16:27:51 +0200

* gnu/packages/rails.scm
  (ruby-importmap-rails, ruby-importmap-rails-bootstrap)
  [arguments]{phases}: Add phase 'patch-rails-version.
---
 gnu/packages/rails.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/rails.scm b/gnu/packages/rails.scm
index 5d91b3fa46..784b312628 100644
--- a/gnu/packages/rails.scm
+++ b/gnu/packages/rails.scm
@@ -943,7 +943,16 @@ (define ruby-importmap-rails-bootstrap
                (base32
                 "1mv223davpm0z50i787yiy49fiakd8ay5slmimyrg5cl3cjrvzm9"))))
     (build-system ruby-build-system)
-    (arguments (list #:tests? #f))             ;avoid all extra dependencies
+    (arguments
+     (list #:tests? #f ;avoid all extra dependencies
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'patch-rails-version
+                 (lambda _
+                   (substitute* (cons* "Appraisals"
+                                       (find-files "gemfiles" "\\.gemfile$"))
+                     (("7\\.1\\.0")
+                      #$%ruby-rails-version)))))))
     ;; Leave out ruby-railties, for bootstrapping purposes.
     (propagated-inputs (list ruby-actionpack))
     (synopsis "Tool to manage modern JavaScript in Rails")
@@ -963,6 +972,12 @@ (define-public ruby-importmap-rails
     (arguments
      (list #:phases
            #~(modify-phases %standard-phases
+               (add-after 'unpack 'patch-rails-version
+                 (lambda _
+                   (substitute* (cons* "Appraisals"
+                                       (find-files "gemfiles" "\\.gemfile$"))
+                     (("7\\.1\\.0")
+                      #$%ruby-rails-version))))
                (add-after 'extract-gemspec 'relax-requirements
                  (lambda _
                    (delete-file "gemfiles/rails_7_1_propshaft.gemfile.lock")
-- 
2.49.0