[bug#38546,04/11] use wrapper to set JULIA_LOAD_PATH and JULIA_DEPOT_PATH
diff mbox series

Message ID 87lfq4vqev.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me
State Accepted
Headers show
Series
  • Julia: fix package build and add julia-xyz
Related show

Checks

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

Commit Message

Nicolò Balzarotti Jan. 18, 2020, 1:23 p.m. UTC
---
 gnu/packages/julia.scm | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm
index e1c4685227..39c7d6d34f 100644
--- a/gnu/packages/julia.scm
+++ b/gnu/packages/julia.scm
@@ -297,7 +297,9 @@ 
                 ;; running order.  I think it depends on the number of
                 ;; runners, disabling it for now
                 ;; https://github.com/JuliaLang/julia/issues/34330
-                "tests = filter(e->!in(e,[\"backtrace\",\"exceptions\",\"client\",\"stacktraces\"]),testnames)"))
+                "tests = filter(e->!in(e,[\"backtrace\",\"exceptions\",\"client\",
+                                          \"stacktraces\",\"stress\",\"precompile\"]),
+                                testnames)"))
              ;; When HOME is not set, julia calls uv_os_homedir, which in
              ;; turns call getpwuid_r. Add the HOME env variable to the
              ;; external julia call to fix this
@@ -307,11 +309,23 @@ 
              ;; https://github.com/JuliaLang/julia/issues/32377
              (substitute* "stdlib/REPL/test/replcompletions.jl"
                (("@test count") "@test_broken count"))
-             #t)))
+             #t))
+         (add-after 'install 'make-wrapper
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (program "julia"))
+               (with-directory-excursion bin
+                 (wrap-program program
+                   `("JULIA_LOAD_PATH" ":" prefix
+                     ("" "$JULIA_LOAD_PATH")))
+                 (wrap-program program
+                   `("JULIA_DEPOT_PATH" ":" prefix
+                     ("" "$JULIA_DEPOT_PATH"))))
+               #t))))
        #:make-flags
        (list
         (string-append "prefix=" (assoc-ref %outputs "out"))
-        (string-append "PREFIX=" (assoc-ref %outputs "out"))
 
         ;; Passing the MARCH flag is necessary to build binary substitutes for
         ;; the supported architectures.
@@ -435,7 +449,10 @@ 
     (native-search-paths
      (list (search-path-specification
             (variable "JULIA_LOAD_PATH")
-            (files (list "share/julia/packages/")))))
+            (files (list "share/julia/packages/")))
+           (search-path-specification
+            (variable "JULIA_DEPOT_PATH")
+            (files (list "share/julia/")))))
     ;; Julia is not officially released for ARM and MIPS.
     ;; See https://github.com/JuliaLang/julia/issues/10639
     (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))