guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: quirks: Build 'compute-guix-derivation' modules with 2.2 when nee


From: guix-commits
Subject: 01/04: quirks: Build 'compute-guix-derivation' modules with 2.2 when needed.
Date: Fri, 29 May 2020 12:32:41 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 36640207c9543e48cd6daa92930f023f80065a5d
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri May 29 16:33:09 2020 +0200

    quirks: Build 'compute-guix-derivation' modules with 2.2 when needed.
    
    Fixes <https://bugs.gnu.org/41595>.
    Reported by Jan Nieuwenhuizen <janneke@gnu.org>.
    
    * guix/quirks.scm (requires-guile-2.2?): New procedure.
    (%quirks): Add it.
    (%bug-41214-patch): Comment.
---
 guix/quirks.scm | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/guix/quirks.scm b/guix/quirks.scm
index d180bd2..d292f4e 100644
--- a/guix/quirks.scm
+++ b/guix/quirks.scm
@@ -57,6 +57,18 @@
           #f
           (apply throw args)))))
 
+(define (requires-guile-2.2? source)
+  "Return true if SOURCE uses Guile 2.2 for the shebang of
+'compute-guix-derivation'."
+  (define content
+    (call-with-input-file (string-append source "/" %self-build-file)
+      read-string))
+
+  ;; The 'find-best-packages-by-name' call is inserted by %BUG-41214-PATCH.
+  (string-contains content
+                   (object->string
+                    '(find-best-packages-by-name "guile" "2.2"))))
+
 (define (guile-2.2.4)
   (module-ref (resolve-interface '(gnu packages guile))
               'guile-2.2.4))
@@ -66,7 +78,8 @@
   ;; about specific Guile versions that old Guix revisions might need to use
   ;; just to be able to build and run the trampoline in %SELF-BUILD-FILE.  See
   ;; <https://bugs.gnu.org/37506>
-  `((,syscalls-reexports-local-variables? . ,guile-2.2.4)))
+  `((,syscalls-reexports-local-variables? . ,guile-2.2.4)
+    (,requires-guile-2.2? . ,guile-2.2.4)))
 
 
 ;;;
@@ -143,6 +156,7 @@ corresponds to the given Guix COMMIT, a SHA1 hexadecimal 
string."
     (define (build-with-guile-2.2 source)
       (substitute* (string-append source "/" %self-build-file)
         (("\\(default-guile\\)")
+         ;; Note: This goes hand in hand with the 'requires-guile-2.2?' quirk.
          (object->string '(car (find-best-packages-by-name "guile" "2.2"))))
         (("\\(find-best-packages-by-name \"guile-gcrypt\" #f\\)")
          (object->string '(find-best-packages-by-name "guile2.2-gcrypt" #f))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]