%D%/packages/patches/jamvm-2.0.0-aarch64-support.patch \
%D%/packages/patches/jamvm-2.0.0-disable-branch-patching.patch \
%D%/packages/patches/jamvm-2.0.0-opcode-guard.patch \
+ %D%/packages/patches/janet-guix-janet-path.patch \
%D%/packages/patches/java-antlr4-Add-standalone-generator.patch \
%D%/packages/patches/java-antlr4-fix-code-too-large.java \
%D%/packages/patches/java-tunnelvisionlabs-antlr-code-too-large.patch \
(file-name (git-file-name name version))
(sha256
(base32 "0gl0p3x0ylj4hxiwjclg1waxq8csadw60qw6pa9h5y4w1bcqffmk"))
+ (patches
+ (search-patches "janet-guix-janet-path.patch"))))
(build-system gnu-build-system)
(arguments
`(#:make-flags (list
#:phases
(modify-phases %standard-phases
(delete 'configure))))
+ (native-search-paths
+ (list (search-path-specification
+ (variable "GUIX_JANET_PATH")
+ (separator ":")
+ (files '("lib/janet")))))
(home-page "https://janet-lang.org/")
(synopsis "Functional, imperative and embeddable programming language")
(description
--- /dev/null
+author: Jack Hill <jackhill@jackhill.us>
+Upstream discussion: https://github.com/janet-lang/janet/discussions/695
+diff --git a/src/boot/boot.janet b/src/boot/boot.janet
+index 59e0a016..f9174916 100644
+--- a/src/boot/boot.janet
++++ b/src/boot/boot.janet
+@@ -3328,6 +3328,30 @@
+ (if-let [jp (getenv-alias "JANET_HEADERPATH")] (setdyn :headerpath jp))
+ (if-let [jprofile (getenv-alias "JANET_PROFILE")] (setdyn :profilepath jprofile))
+
++ # Guix customization to make Janet respect GUIX_JANET_PATH
++ # environment variable. GUIX_JANET_PATH is a native search path
++ # added by Guix to tell Janet where to find modules install in the
++ # same profile via Guix packages. This is done by augmenting
++ # Janet's module/paths array.
++ (def- guix-janet-path (os/getenv "GUIX_JANET_PATH"))
++
++ # The Janet standard extensions and loaders. List copied from
++ # the calls to module/add-paths in src/boot/boot.janet.
++ (def- default-janet-loaders
++ [[":native:" :native]
++ ["/init.janet" :source]
++ [".janet" :source]
++ [".jimage" :image]])
++
++ (defn- add-guix-path [p]
++ (each [ext loader] default-janet-loaders
++ (array/push module/paths [(string p "/:all:" ext) loader check-is-dep])))
++
++ (if guix-janet-path
++ (each elem (string/split ":" guix-janet-path)
++ (add-guix-path elem)))
++ # End of Guix customization
++
+ # Flag handlers
+ (def handlers
+ {"h" (fn [&]
\ No newline at end of file