diff mbox series

[bug#55248,v3,2/9] gnu: racket: Fix out-of-source build.

Message ID a527742b7e3478147f9d3b27e7b815acad4dda91.1652075689.git.philip@philipmcgrath.com
State New
Headers show
Series gnu: Update Racket to 8.5 and Chez Scheme to 9.5.8. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Philip McGrath May 9, 2022, 6:02 a.m. UTC
* gnu/packages/racket.scm (racket-vm-cgc)[arguments]: Supply
'#:out-of-source? #t'. Wrap 'install-license-files' to work around
limitation.
---
 gnu/packages/racket.scm | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm
index 7d51707156..8438945ba0 100644
--- a/gnu/packages/racket.scm
+++ b/gnu/packages/racket.scm
@@ -276,8 +276,9 @@  (define-public racket-vm-cgc
        ;; main-distribution-test that aren't part of the main
        ;; distribution.
        #:tests? #f
-       ;; Upstream recommends #:out-of-source?, and it does
-       ;; help with debugging, but it confuses `install-license-files`.
+       ;; Upstream recommends #:out-of-source?, and it
+       ;; helps a lot with debugging.
+       #:out-of-source? #t
        #:modules '((ice-9 match)
                    (ice-9 regex)
                    (guix build gnu-build-system)
@@ -314,7 +315,18 @@  (define-public racket-vm-cgc
                                 #f)))))))
            (add-before 'configure 'chdir
              (lambda _
-               (chdir "racket/src"))))))
+               (chdir "racket/src")))
+           (replace 'install-license-files
+             ;; The #:out-of-source? mode for install-license-files fails
+             ;; to find the srcdir: as a workaround, navigate there ourselves.
+             (let ((install-license-files
+                    (assoc-ref %standard-phases 'install-license-files)))
+               (lambda args
+                 (with-directory-excursion "../src"
+                   (apply install-license-files
+                          `(,@args
+                            ;; if there are duplicate keywords, last is used
+                            #:out-of-source? #f)))))))))
      (home-page "https://racket-lang.org")
      (synopsis "Old Racket implementation used for bootstrapping")
      (description "This variant of the Racket BC (``before Chez'' or