diff mbox series

[bug#38546,1/3] gnu: julia: Set to JULIA_LOAD_PATH and JULIA_DEPOT_PATH variables.

Message ID 87tv69vbt6.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 | 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/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job

Commit Message

Nicolò Balzarotti Oct. 10, 2019, 3:49 p.m. UTC
gnu/packages/julia.scm | 146 +++++++++++++++++++++--------------------
 1 file changed, 75 insertions(+), 71 deletions(-)

Comments

Ludovic Courtès Dec. 15, 2019, 9:43 p.m. UTC | #1
Nicolò Balzarotti <anothersms@gmail.com> skribis:

>  gnu/packages/julia.scm | 146 +++++++++++++++++++++--------------------
>  1 file changed, 75 insertions(+), 71 deletions(-)

Please make sure to add a commit log listing all the entities changed.

Apparently there was some reindentation that makes this patch looks big
and makes the actual changes harder to spot.  Could you resubmit it
without the reindentation?

>      (native-search-paths
>       (list (search-path-specification
>              (variable "JULIA_LOAD_PATH")
> -            (files (list "share/julia/packages/")))))
> +            (files (list "share/julia/packages/"
> +                         "share/julia/stdlib/v1.1/")))

Why is this extra entry needed?  Doesn’t Julia find its own standard
library by default, even if JULIA_LOAD_PATH is unset?

> +           (search-path-specification
> +            (variable "JULIA_DEPOT_PATH")
> +            (files (list "share/julia/")))))

What’s JULIA_DEPOT_PATH supposed to point to again?  ‘share/julia’ seems
to be very much a catch-all thing.  :-)

Thanks,
Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm
index 65a5e42beb..2516e7fa82 100644
--- a/gnu/packages/julia.scm
+++ b/gnu/packages/julia.scm
@@ -158,7 +158,7 @@ 
 (define-public julia
   (package
     (name "julia")
-    (version "1.1.1")
+    (version "1.1.1") ;; Update also JULIA_LOAD_PATH with it
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -229,77 +229,77 @@ 
            ;; Some tests require a home directory to be set.
            (lambda _ (setenv "HOME" "/tmp") #t))
          (add-after 'unpack 'hardcode-soname-map
-          ;; ./src/runtime_ccall.cpp creates a map from library names to paths
-          ;; using the output of "/sbin/ldconfig -p".  Since ldconfig is not
-          ;; used in Guix, we patch runtime_ccall.cpp to contain a static map.
-          (lambda* (#:key inputs #:allow-other-keys)
-            (use-modules (ice-9 match))
-            (substitute* "src/runtime_ccall.cpp"
-              ;; Patch out invocations of '/sbin/ldconfig' to avoid getting
-              ;; error messages about missing '/sbin/ldconfig' on Guix System.
-              (("popen\\(.*ldconfig.*\\);")
-               "NULL;\n")
+           ;; ./src/runtime_ccall.cpp creates a map from library names to paths
+           ;; using the output of "/sbin/ldconfig -p".  Since ldconfig is not
+           ;; used in Guix, we patch runtime_ccall.cpp to contain a static map.
+           (lambda* (#:key inputs #:allow-other-keys)
+             (use-modules (ice-9 match))
+             (substitute* "src/runtime_ccall.cpp"
+               ;; Patch out invocations of '/sbin/ldconfig' to avoid getting
+               ;; error messages about missing '/sbin/ldconfig' on Guix System.
+               (("popen\\(.*ldconfig.*\\);")
+                "NULL;\n")
 
-              ;; Populate 'sonameMap'.
-              (("jl_read_sonames.*;")
-               (string-join
-                (map (match-lambda
-                       ((input libname soname)
-                        (string-append
-                         "sonameMap[\"" libname "\"] = "
-                         "\"" (assoc-ref inputs input) "/lib/" soname "\";")))
-                     '(("libc"        "libc"           "libc.so.6")
-                       ("pcre2"       "libpcre2-8"     "libpcre2-8.so")
-                       ("mpfr"        "libmpfr"        "libmpfr.so")
-                       ("openblas"    "libblas"        "libopenblas.so")
-                       ("arpack-ng"   "libarpack"      "libarpack.so")
-                       ("lapack"      "liblapack"      "liblapack.so")
-                       ("libgit2"     "libgit2"        "libgit2.so")
-                       ("gmp"         "libgmp"         "libgmp.so")
-                       ("openspecfun" "libopenspecfun" "libopenspecfun.so")
-                       ("fftw"        "libfftw3"       "libfftw3_threads.so")
-                       ("fftwf"       "libfftw3f"      "libfftw3f_threads.so"))))))
-            (substitute* "base/math.jl"
-              (("const libm = Base.libm_name")
-               (string-append "const libm = \""
-                              (assoc-ref inputs "openlibm")
-                              "/lib/libopenlibm.so"
-                              "\""))
-              (("const openspecfun = \"libopenspecfun\"")
-               (string-append "const openspecfun = \""
-                              (assoc-ref inputs "openspecfun")
-                              "/lib/libopenspecfun.so"
-                              "\"")))
-            #t))
+               ;; Populate 'sonameMap'.
+               (("jl_read_sonames.*;")
+                (string-join
+                 (map (match-lambda
+                        ((input libname soname)
+                         (string-append
+                          "sonameMap[\"" libname "\"] = "
+                          "\"" (assoc-ref inputs input) "/lib/" soname "\";")))
+                      '(("libc"        "libc"           "libc.so.6")
+                        ("pcre2"       "libpcre2-8"     "libpcre2-8.so")
+                        ("mpfr"        "libmpfr"        "libmpfr.so")
+                        ("openblas"    "libblas"        "libopenblas.so")
+                        ("arpack-ng"   "libarpack"      "libarpack.so")
+                        ("lapack"      "liblapack"      "liblapack.so")
+                        ("libgit2"     "libgit2"        "libgit2.so")
+                        ("gmp"         "libgmp"         "libgmp.so")
+                        ("openspecfun" "libopenspecfun" "libopenspecfun.so")
+                        ("fftw"        "libfftw3"       "libfftw3_threads.so")
+                        ("fftwf"       "libfftw3f"      "libfftw3f_threads.so"))))))
+             (substitute* "base/math.jl"
+               (("const libm = Base.libm_name")
+                (string-append "const libm = \""
+                               (assoc-ref inputs "openlibm")
+                               "/lib/libopenlibm.so"
+                               "\""))
+               (("const openspecfun = \"libopenspecfun\"")
+                (string-append "const openspecfun = \""
+                               (assoc-ref inputs "openspecfun")
+                               "/lib/libopenspecfun.so"
+                               "\"")))
+             #t))
          (add-before 'build 'fix-include-and-link-paths
-          (lambda* (#:key inputs #:allow-other-keys)
-            ;; LIBUTF8PROC is a linker flag, not a build target.  It is
-            ;; included in the LIBFILES_* variable which is used as a
-            ;; collection of build targets and a list of libraries to link
-            ;; against.
-            (substitute* "src/flisp/Makefile"
-              (("\\$\\(BUILDDIR\\)/\\$\\(EXENAME\\): \\$\\(OBJS\\) \\$\\(LIBFILES_release\\)")
-               "$(BUILDDIR)/$(EXENAME): $(OBJS) $(LLT_release)")
-              (("\\$\\(BUILDDIR\\)/\\$\\(EXENAME\\)-debug: \\$\\(DOBJS\\) \\$\\(LIBFILES_debug\\)")
-               "$(BUILDDIR)/$(EXENAME)-debug: $(DOBJS) $(LLT_debug)"))
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; LIBUTF8PROC is a linker flag, not a build target.  It is
+             ;; included in the LIBFILES_* variable which is used as a
+             ;; collection of build targets and a list of libraries to link
+             ;; against.
+             (substitute* "src/flisp/Makefile"
+               (("\\$\\(BUILDDIR\\)/\\$\\(EXENAME\\): \\$\\(OBJS\\) \\$\\(LIBFILES_release\\)")
+                "$(BUILDDIR)/$(EXENAME): $(OBJS) $(LLT_release)")
+               (("\\$\\(BUILDDIR\\)/\\$\\(EXENAME\\)-debug: \\$\\(DOBJS\\) \\$\\(LIBFILES_debug\\)")
+                "$(BUILDDIR)/$(EXENAME)-debug: $(DOBJS) $(LLT_debug)"))
 
-            ;; The REPL must be linked with libuv.
-            (substitute* "ui/Makefile"
-              (("JLDFLAGS \\+= ")
-               (string-append "JLDFLAGS += "
-                              (assoc-ref %build-inputs "libuv")
-                              "/lib/libuv.so ")))
+             ;; The REPL must be linked with libuv.
+             (substitute* "ui/Makefile"
+               (("JLDFLAGS \\+= ")
+                (string-append "JLDFLAGS += "
+                               (assoc-ref %build-inputs "libuv")
+                               "/lib/libuv.so ")))
 
-            (substitute* "base/Makefile"
-              (("\\$\\(build_includedir\\)/uv/errno.h")
-               (string-append (assoc-ref inputs "libuv")
-                              "/include/uv/errno.h")))
-            #t))
+             (substitute* "base/Makefile"
+               (("\\$\\(build_includedir\\)/uv/errno.h")
+                (string-append (assoc-ref inputs "libuv")
+                               "/include/uv/errno.h")))
+             #t))
          (add-before 'build 'replace-default-shell
-          (lambda _
-            (substitute* "base/client.jl"
-              (("/bin/sh") (which "sh")))
-            #t))
+           (lambda _
+             (substitute* "base/client.jl"
+               (("/bin/sh") (which "sh")))
+             #t))
          (add-after 'unpack 'hardcode-paths
            (lambda _
              (substitute* "stdlib/InteractiveUtils/src/InteractiveUtils.jl"
@@ -345,9 +345,9 @@ 
            ;; platforms, e.g. when running "guix package --search="
            (_ "MARCH=UNSUPPORTED"))
 
-        "CONFIG_SHELL=bash"     ;needed to build bundled libraries
-        "USE_SYSTEM_DSFMT=0"    ;not packaged for Guix and upstream has no
-                                ;build system for a shared library.
+        "CONFIG_SHELL=bash"         ;needed to build bundled libraries
+        "USE_SYSTEM_DSFMT=0"        ;not packaged for Guix and upstream has no
+                                        ;build system for a shared library.
         "USE_SYSTEM_LAPACK=1"
         "USE_SYSTEM_BLAS=1"
         "USE_BLAS64=0"          ;needed when USE_SYSTEM_BLAS=1
@@ -485,7 +485,11 @@ 
     (native-search-paths
      (list (search-path-specification
             (variable "JULIA_LOAD_PATH")
-            (files (list "share/julia/packages/")))))
+            (files (list "share/julia/packages/"
+                         "share/julia/stdlib/v1.1/")))
+           (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"))