projects/guix·blob python-team · refs

65 lines · 2.4 KiB

1From 6b3aed3d71ea9481762de7bd42395704176b6625 Mon Sep 17 00:00:00 2001
2From: Suhail <[email protected]>
3Date: Mon, 16 Dec 2024 15:07:55 -0500
4Subject: [PATCH v2] racket: raco: Ensure launchers of packages include config
5 directory.
6
7Currently, binaries installed via "raco" (included in Guix's "racket" package)
8don't include the -G / --config configuration option specifying the "Main
9configuration directory". This is problematic.
10
11Specifically, when installing "rash" via raco using the below:
12
13#+begin_src sh
14 raco pkg install rash
15#+end_src
16
17The resulting rash-repl binary (which is missing the -G configuration option
18in the call to the racket binary), when invoked, results in the following
19error:
20
21#+begin_src sh
22 standard-module-name-resolver: collection not found
23 for module path: (lib "rash/repl.rkt")
24 collection: "rash"
25 in collection directories:
26 ${HOME}/.local/share/racket/8.14/collects
27 /gnu/store/...-racket-vm-cs-8.14/opt/racket-vm/collects/
28#+end_src
29
30Adding the -G configuration option in the call to the racket binary fixes the
31above error.
32
33The executable scripts (at least on linux) are generated via
34make-unix-launcher in ./racket/collects/launcher/launcher.rkt . The patch
35below ensures that the -G flag is added to such launcher scripts. The patch
36is conservative in that it allows it to be overwritten by callers of
37launcher.rkt as desired.
38
39---
40 racket/collects/launcher/launcher.rkt | 9 ++++++++-
41 1 file changed, 8 insertions(+), 1 deletion(-)
42
43diff --git a/racket/collects/launcher/launcher.rkt b/racket/collects/launcher/launcher.rkt
44index 0faacec4ce..2c77d55caf 100644
45--- a/racket/collects/launcher/launcher.rkt
46+++ b/racket/collects/launcher/launcher.rkt
47@@ -405,7 +405,14 @@
48 [x-flags? (and (eq? kind 'mred)
49 (eq? (cross-system-type) 'unix)
50 (not (script-variant? variant)))]
51- [flags (let ([m (assq 'wm-class aux)])
52+ [flags (let ([m (assq 'wm-class aux)]
53+ [flags (if (or (member "-G" flags)
54+ (member "--config" flags))
55+ flags
56+ (list* "-G"
57+ (format "~a"
58+ (find-system-path 'config-dir))
59+ flags))])
60 (if m
61 (list* "-J" (cdr m) flags)
62 flags))]
63--
642.47.1
65