projects/guix·blob javascript-team · refs

562 lines · 26.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <[email protected]>
3;;; Copyright © 2016, 2020-2022 Efraim Flashner <[email protected]>
4;;; Copyright © 2020, 2021 Nicolò Balzarotti <[email protected]>
5;;; Copyright © 2020 Tim Howes <[email protected]>
6;;; Copyright © 2020 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2021, 2022 Jean-Baptiste Volatier <[email protected]>
8;;; Copyright © 2021 Simon Tournier <[email protected]>
9;;; Copyright © 2021 Maxim Cournoyer <[email protected]>
10;;; Copyright © 2022 Akira Kyle <[email protected]>
11;;;
12;;; This file is part of GNU Guix.
13;;;
14;;; GNU Guix is free software; you can redistribute it and/or modify it
15;;; under the terms of the GNU General Public License as published by
16;;; the Free Software Foundation; either version 3 of the License, or (at
17;;; your option) any later version.
18;;;
19;;; GNU Guix is distributed in the hope that it will be useful, but
20;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22;;; GNU General Public License for more details.
23;;;
24;;; You should have received a copy of the GNU General Public License
25;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27(define-module (gnu packages julia)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix utils)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system gnu)
34 #:use-module ((guix search-paths) #:select ($SSL_CERT_FILE))
35 #:use-module (gnu packages)
36 #:use-module (gnu packages algebra)
37 #:use-module (gnu packages base)
38 #:use-module (gnu packages bash)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages curl)
41 #:use-module (gnu packages elf)
42 #:use-module (gnu packages gcc)
43 #:use-module (gnu packages llvm)
44 #:use-module (gnu packages libevent)
45 #:use-module (gnu packages libunwind)
46 #:use-module (gnu packages maths)
47 #:use-module (gnu packages multiprecision) ; mpfr
48 #:use-module (gnu packages pcre)
49 #:use-module (gnu packages perl)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages python-xyz)
53 #:use-module (gnu packages textutils)
54 #:use-module (gnu packages ssh)
55 #:use-module (gnu packages tls)
56 #:use-module (gnu packages version-control)
57 #:use-module (gnu packages web)
58 #:use-module (gnu packages wget)
59 #:use-module (ice-9 match))
60
61(define libunwind-julia
62 ;; The Julia projects requires their patched version.
63 ;; Get from https://github.com/JuliaLang/julia/tree/master/deps/patches
64 (package
65 (inherit libunwind)
66 (name "libunwind-julia")
67 (version "1.5.0")
68 (source
69 (origin
70 (method url-fetch)
71 (uri (string-append "mirror://savannah/libunwind/libunwind-"
72 version ".tar.gz"))
73 (sha256
74 (base32
75 "05qhzcg1xag3l5m3c805np6k342gc0f3g087b7g16jidv59pccwh"))
76 (patches
77 (list
78 (julia-patch "libunwind-prefer-extbl"
79 "0pf3lsq6zxlmqn86lk4fcj1xwdan9gbxyabrwgxcb59p8jjwsl8r")
80 (julia-patch "libunwind-static-arm"
81 "1jk3bmiw61ypcchqkk1fyg5wh8wpggk574wxyfyaic870zh3lhgq")
82 (julia-patch "libunwind-cfa-rsp"
83 "0qs5b1h5lsr5qakkv6sddgy5ghlxpjrn2jiqcvg7bkczy24klr6j")))))
84 (arguments
85 (substitute-keyword-arguments arguments
86 ;; Skip tests on this older and patched version of libunwind.
87 ((#:tests? _ #t) #f)))
88 (home-page "https://github.com/JuliaLang/julia/tree/master/deps/")))
89
90(define (julia-patch-url version name)
91 (string-append "https://raw.githubusercontent.com/JuliaLang/julia/v" version
92 "/deps/patches/" name ".patch"))
93
94(define-public (julia-patch name sha)
95 (let ((version "1.8.2"))
96 (origin (method url-fetch)
97 (uri (julia-patch-url version name))
98 (sha256 (base32 sha))
99 (file-name name))))
100
101(define-public libwhich
102 (package
103 (name "libwhich")
104 (version "1.1.0")
105 (source
106 (origin
107 (method git-fetch)
108 (uri (git-reference
109 (url "https://github.com/vtjnash/libwhich")
110 ;; fixes linux-vdso.so related tests
111 (commit "87cffe10080c98e7b5786c5166e420bf1ada1d41")))
112 (file-name (string-append name "-" version "-checkout"))
113 (sha256
114 (base32
115 "1bpa0fcqpa3ai3hm8mz0p13bf76fsq53wsfcx5qw302zh22108xr"))))
116 (arguments
117 `(#:make-flags
118 (list (string-append "CC=" ,(cc-for-target)))
119 #:phases
120 (modify-phases %standard-phases
121 (delete 'configure)
122 (add-before 'check 'set-ld-library-path
123 (lambda* (#:key native-inputs inputs #:allow-other-keys)
124 (setenv "LD_LIBRARY_PATH"
125 (string-append (assoc-ref (or native-inputs inputs) "zlib")
126 "/lib"))))
127 (replace 'install
128 (lambda* (#:key outputs #:allow-other-keys)
129 (let ((out (assoc-ref outputs "out")))
130 (install-file "libwhich" (string-append out "/bin")))
131 #t)))))
132 (native-inputs
133 ;; used for tests
134 (list zlib))
135 (build-system gnu-build-system)
136 (home-page "https://github.com/vtjnash/libwhich")
137 (synopsis "Like @code{which}, for dynamic libraries")
138 (description "@code{libwhich} is like @code{which}, but for dynamic
139libraries. It is also a bit like @code{ldd} and @code{otool -L}.")
140 (license license:expat)))
141
142(define-public julia
143 (package
144 (name "julia")
145 (version "1.8.5")
146 (source (origin
147 (method url-fetch)
148 (uri (string-append
149 "https://github.com/JuliaLang/julia/releases/download/v"
150 version "/julia-" version ".tar.gz"))
151 (sha256
152 (base32
153 "0c9hfksqlillwj8l5plbrv9cjajmnkarzz96rsmi8p97dg62c46k"))
154 (patches (search-patches "julia-SOURCE_DATE_EPOCH-mtime.patch"
155 "julia-Use-MPFR-4.2.patch"))))
156 (build-system gnu-build-system)
157 (arguments
158 `(#:test-target "test"
159 #:modules ((ice-9 match)
160 (guix build gnu-build-system)
161 (guix build utils))
162
163 ;; The test suite takes many times longer than building and
164 ;; can easily fail on smaller machines when they run out of memory.
165 #:tests? ,(not (or (%current-target-system)
166 (target-aarch64?)))
167
168 ;; Do not strip binaries to keep support for full backtraces.
169 ;; See https://github.com/JuliaLang/julia/issues/17831
170 #:strip-binaries? #f
171
172 ;; The DSOs use $ORIGIN to refer to each other, but (guix build
173 ;; gremlin) doesn't support it yet, so skip this phase.
174 #:validate-runpath? #f
175
176 #:phases
177 (modify-phases %standard-phases
178 (delete 'configure)
179 (add-after 'unpack 'prepare-deps
180 (lambda* (#:key inputs #:allow-other-keys)
181 ;; needed by libwhich
182 (setenv "LD_LIBRARY_PATH"
183 (string-join (map (lambda (pkg)
184 (string-append (assoc-ref inputs pkg)
185 "/lib"))
186 '("curl" "dsfmt"
187 "gmp" "lapack"
188 "libssh2" "libnghttp2" "libgit2"
189 "libblastrampoline"
190 "mbedtls" "mpfr"
191 "openblas" "openlibm" "pcre2"
192 "suitesparse" "gfortran:lib"))
193 ":"))))
194 ;; FIXME: Building the documentation requires Julia packages that
195 ;; would be downloaded from the Internet. We should build them in a
196 ;; separate build phase.
197 (add-after 'unpack 'disable-documentation
198 (lambda _
199 (substitute* "Makefile"
200 (("(install: .*) \\$\\(BUILDROOT\\)/doc/_build/html/en/index.html" _ line)
201 (string-append line "\n"))
202 (("src ui doc deps")
203 "src ui deps"))))
204 (add-after 'unpack 'activate-gnu-source-for-loader
205 (lambda _
206 (substitute* "cli/Makefile"
207 (("LOADER_CFLAGS =") "LOADER_CFLAGS = -D_GNU_SOURCE"))))
208 ;; libquadmath is not available on all architectures.
209 ;; https://github.com/JuliaLang/julia/issues/41613
210 (add-after 'unpack 'make-libquadmath-optional
211 (lambda _
212 (substitute* "base/Makefile"
213 (("libquadmath,0") "libquadmath,0,ALLOW_FAILURE"))))
214 (add-before 'check 'set-home
215 ;; Some tests require a home directory to be set.
216 (lambda _ (setenv "HOME" "/tmp")))
217 (add-before 'build 'fix-include-and-link-paths
218 (lambda* (#:key inputs #:allow-other-keys)
219 ;; The REPL must be linked with libuv.
220 (substitute* "cli/Makefile"
221 (("JLDFLAGS \\+= ")
222 (string-append "JLDFLAGS += "
223 (assoc-ref inputs "libuv")
224 "/lib/libuv.so ")))))
225 (add-before 'build 'replace-default-shell
226 (lambda* (#:key inputs #:allow-other-keys)
227 (substitute* "base/client.jl"
228 (("/bin/sh") (search-input-file inputs "/bin/sh")))))
229 (add-before 'build 'shared-objects-paths
230 (lambda* (#:key inputs #:allow-other-keys)
231 (let ((jlpath
232 (lambda (pkgname)
233 (string-append
234 "stdlib/" pkgname "_jll/src/" pkgname "_jll.jl")))
235 (from
236 (lambda (libname)
237 (string-append "const " libname " = .*\\.so")))
238 (to
239 (lambda* (pkg libname #:optional libname_jl)
240 (string-append
241 "const " (or libname_jl libname) " = \""
242 (assoc-ref inputs pkg) "/lib/" libname ".so"))))
243 (substitute* (jlpath "CompilerSupportLibraries")
244 (((from "libgfortran"))
245 (string-append "const libgfortran = string(\""
246 (search-input-file inputs "/lib/libgfortran.so"))))
247 (substitute* (jlpath "dSFMT")
248 (((from "libdSFMT")) (to "dsfmt" "libdSFMT")))
249 (substitute* (jlpath "GMP")
250 (((from "libgmp")) (to "gmp" "libgmp"))
251 (((from "libgmpxx")) (to "gmp" "libgmpxx")))
252 (substitute* (jlpath "libLLVM")
253 (((from "libLLVM")) (to "llvm" "libLLVM")))
254 (substitute* (jlpath "LibCURL")
255 (((from "libcurl")) (to "curl" "libcurl")))
256 (substitute* (jlpath "LibGit2")
257 (((from "libgit2")) (to "libgit2" "libgit2")))
258 (substitute* (jlpath "LibSSH2")
259 (((from "libssh2")) (to "libssh2" "libssh2")))
260 (substitute* (jlpath "LibUV")
261 (((from "libuv")) (to "libuv" "libuv")))
262 (substitute* (jlpath "LibUnwind")
263 (((from "libunwind")) (to "libunwind" "libunwind")))
264 (substitute* (jlpath "MPFR")
265 (((from "libmpfr")) (to "mpfr" "libmpfr")))
266 (substitute* (jlpath "MbedTLS")
267 (((from "libmbedcrypto")) (to "mbedtls" "libmbedcrypto"))
268 (((from "libmbedtls")) (to "mbedtls" "libmbedtls"))
269 (((from "libmbedx509")) (to "mbedtls" "libmbedx509")))
270 (substitute* (jlpath "nghttp2")
271 (((from "libnghttp2")) (to "libnghttp2" "libnghttp2")))
272 (substitute* (jlpath "OpenBLAS")
273 (((from "libopenblas"))
274 ,@(if (target-x86-64?)
275 `((to "openblas" "libopenblas64_" "libopenblas"))
276 `((to "openblas" "libopenblas")))))
277 (substitute* (jlpath "OpenLibm")
278 (((from "libopenlibm")) (to "openlibm" "libopenlibm")))
279 (substitute* (jlpath "PCRE2")
280 (((from "libpcre2_8")) (to "pcre2" "libpcre2-8" "libpcre2_8")))
281 (substitute* (jlpath "SuiteSparse")
282 (((from "libamd")) (to "suitesparse" "libamd"))
283 (((from "libbtf")) (to "suitesparse" "libbtf"))
284 (((from "libcamd")) (to "suitesparse" "libcamd"))
285 (((from "libccolamd")) (to "suitesparse" "libccolamd"))
286 (((from "libcholmod")) (to "suitesparse" "libcholmod"))
287 (((from "libcolamd")) (to "suitesparse" "libcolamd"))
288 (((from "libklu")) (to "suitesparse" "libklu"))
289 (((from "libldl")) (to "suitesparse" "libldl"))
290 (((from "librbio")) (to "suitesparse" "librbio"))
291 (((from "libspqr")) (to "suitesparse" "libspqr"))
292 (((from "libsuitesparse")) (to "suitesparse" "libsuitesparse"))
293 (((from "libsuitesparseconfig"))
294 (to "suitesparse" "libsuitesparseconfig"))
295 (((from "libumfpack")) (to "suitesparse" "libumfpack")))
296 (substitute* (jlpath "Zlib")
297 (((from "libz")) (to "zlib" "libz")))
298 (substitute* (jlpath "libblastrampoline")
299 (("libblastrampoline\\.so")
300 (search-input-file inputs "/lib/libblastrampoline.so"))))))
301 (add-before 'build 'use-ssl-cert-file
302 (lambda _
303 ;; We must adapt MozillaCACerts to use SSL_CERT_FILE.
304 (substitute* "stdlib/MozillaCACerts_jll/src/MozillaCACerts_jll.jl"
305 (("global cacert = .*")
306 (string-append
307 "global cacert = get(ENV, \"SSL_CERT_FILE\","
308 ;; our fallback location.
309 "\"/etc/ssl/certs/ca-certificates.crt\")\n")))))
310 (add-after 'unpack 'enable-parallel-tests
311 (lambda* (#:key parallel-tests? #:allow-other-keys)
312 (when parallel-tests?
313 (setenv "JULIA_TEST_USE_MULTIPLE_WORKERS" "true"))))
314 (add-after 'unpack 'adjust-test-suite
315 (lambda* (#:key inputs #:allow-other-keys)
316 (substitute* "test/spawn.jl"
317 (("shcmd = `sh`") (string-append "shcmd = `" (which "sh") "`")))
318 ;; Some tests only check to see if the input is the correct version.
319 (substitute* "stdlib/PCRE2_jll/test/runtests.jl"
320 (("10.40.0") ,(package-version (this-package-input "pcre2"))))
321 (substitute* "stdlib/MbedTLS_jll/test/runtests.jl"
322 (("2.28.0") ,(package-version (this-package-input "mbedtls"))))
323 (substitute* "stdlib/MPFR_jll/test/runtests.jl"
324 (("4.1.0") ,(package-version (this-package-input "mpfr"))))
325 (substitute* "stdlib/GMP_jll/test/runtests.jl"
326 (("6.2.1") ,(package-version (this-package-input "gmp"))))
327 (substitute* "stdlib/LibGit2_jll/test/runtests.jl"
328 (("1.3.0") ,(package-version (this-package-input "libgit2"))))
329 (substitute* "stdlib/nghttp2_jll/test/runtests.jl"
330 (("1.48.0") ,(package-version (this-package-input "libnghttp2"))))
331 (substitute* "stdlib/Zlib_jll/test/runtests.jl"
332 (("1.2.12") ,(package-version (this-package-input "zlib"))))
333 (substitute* "stdlib/SuiteSparse_jll/test/runtests.jl"
334 (("5010") ,(string-replace-substring
335 (version-major+minor
336 (package-version
337 (this-package-input "suitesparse"))) "." "0")))))
338 (add-before 'check 'disable-broken-tests
339 (lambda _
340 ;; disabling REPL tests because they require a stdin
341 ;; There are some read-only precompile issues in the 1.6 series.
342 ;; https://github.com/JuliaLang/julia/pull/41614
343 ;; https://github.com/JuliaLang/julia/issues/41156
344 (substitute* "test/choosetests.jl"
345 (("\"cmdlineargs\",") "")
346 (("\"precompile\",") ""))
347 ;; Dates/io tests fail on master when networking is unavailable
348 ;; https://github.com/JuliaLang/julia/issues/34655
349 (substitute* "stdlib/Dates/test/io.jl"
350 (("using Dates") "import Dates
351using Dates: @dateformat_str, Date, DateTime, DateFormat, Time"))
352 ;; julia embeds a certificate, we are not doing that
353 (substitute* "stdlib/MozillaCACerts_jll/test/runtests.jl"
354 (("@test isfile\\(MozillaCACerts_jll.cacert\\)")
355 "@test_broken isfile(MozillaCACerts_jll.cacert)"))
356 ;; since certificate is not present some tests are failing in network option
357 (substitute* "usr/share/julia/stdlib/v1.8/NetworkOptions/test/runtests.jl"
358 (("@test isfile\\(bundled_ca_roots\\(\\)\\)")
359 "@test_broken isfile(bundled_ca_roots())")
360 (("@test ispath\\(ca_roots_path\\(\\)\\)")
361 "@test_broken ispath(ca_roots_path())")
362 (("@test ca_roots_path\\(\\) \\!= bundled_ca_roots\\(\\)")
363 "@test_broken ca_roots_path() != bundled_ca_roots()"))
364 ;; WARNING: failed to select UTF-8 encoding, using ASCII
365 ;; Using 'setlocale' doesn't affect the test failures.
366 ;(setlocale LC_ALL "en_US.utf8")
367 ;(setenv "LC_ALL" "en_US.utf8")
368 (substitute* "test/cmdlineargs.jl"
369 (("test v\\[3") "test_broken v[3")
370 (("test isempty\\(v\\[3") "test_broken isempty(v[3"))
371 ;; These test(s) randomly fails because they depend on CPU.
372 (substitute* "test/math.jl"
373 ;; @test_broken cannot be used because if the test randomly
374 ;; passes, then it also raises an error.
375 (("@test isinf\\(log1p\\(-one\\(T\\)\\)\\)")
376 " "))
377
378 ;; These are new test failures for 1.8:
379 ;; This test passes on some architectures and fails on others.
380 (substitute* "stdlib/LinearAlgebra/test/lu.jl"
381 (("@test String") "@test_skip String"))
382
383 (substitute* "stdlib/InteractiveUtils/test/runtests.jl"
384 (("@test !occursin\\(\"Environment")
385 "@test_broken !occursin(\"Environment")
386 (("@test occursin\\(\"Environment")
387 "@test_broken occursin(\"Environment"))
388 (substitute* "usr/share/julia/stdlib/v1.8/Statistics/test/runtests.jl"
389 (("@test cov\\(A") "@test_skip cov(A")
390 (("@test isfinite") "@test_skip isfinite"))
391 ;; LoadError: SuiteSparse threads test failed with nthreads == 4
392 (substitute* "usr/share/julia/stdlib/v1.8/SuiteSparse/test/runtests.jl"
393 (("Base\\.USE_GPL_LIBS") "false"))
394 ;; Got exception outside of a @test
395 ;; LinearAlgebra.LAPACKException(16)
396 ;; eliminate all the test bits.
397 (substitute* "stdlib/LinearAlgebra/test/schur.jl"
398 (("f = schur\\(A, B\\)") "f = schur(A, A)")
399 (("@test f\\.Q\\*f\\.S\\*f\\.Z'.*") "\n")
400 (("@test f\\.Q\\*f\\.T\\*f\\.Z'.*") "\n"))
401 (substitute* "test/threads.jl"
402 (("@test success") "@test_broken success"))))
403 ;; Doesn't this just mean they weren't linked correctly?
404 (add-after 'install 'symlink-missing-libraries
405 (lambda* (#:key inputs outputs #:allow-other-keys)
406 (let* ((out (assoc-ref outputs "out"))
407 (link
408 (lambda (pkgname pred)
409 (map (lambda (file)
410 (unless (file-exists?
411 (string-append out "/lib/julia/"
412 (basename file)))
413 (symlink file (string-append out "/lib/julia/"
414 (basename file)))))
415 (find-files (string-append (assoc-ref inputs pkgname)
416 "/lib") pred)))))
417 (link "libunwind" "libunwind\\.so")
418 (link "llvm" "libLLVM-13jl\\.so")
419 (link "utf8proc" "libutf8proc\\.so")
420 (link "zlib" "libz\\.so"))))
421 (add-after 'install 'make-wrapper
422 (lambda* (#:key inputs outputs #:allow-other-keys)
423 (let* ((out (assoc-ref outputs "out"))
424 (bin (string-append out "/bin"))
425 (program "julia"))
426 (with-directory-excursion bin
427 (wrap-program program
428 `("JULIA_LOAD_PATH" ":" prefix
429 ("" "$JULIA_LOAD_PATH"))
430 `("JULIA_DEPOT_PATH" ":" prefix
431 ("" "$JULIA_DEPOT_PATH"))))))))
432 #:make-flags
433 (list
434 "VERBOSE=1" ;; more helpful logging of what make is doing
435 (string-append "prefix=" (assoc-ref %outputs "out"))
436
437 ;; Passing the MARCH or JULIA_CPU_TARGET flag is necessary to build
438 ;; binary substitutes for the supported architectures. See also
439 ;; https://docs.julialang.org/en/v1/devdocs/sysimg/#Specifying-multiple-system-image-targets
440 ,(match (or (%current-target-system)
441 (%current-system))
442 ("x86_64-linux"
443 ;; These are the flags that upstream uses for their binaries.
444 "JULIA_CPU_TARGET=generic;generic,-cx16,clone_all;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)")
445 ("i686-linux" "MARCH=pentium4")
446 ("armhf-linux" "JULIA_CPU_TARGET=armv7-a,neon")
447 ("powerpc64le-linux" "JULIA_CPU_TARGET=pwr8")
448 ;; Prevent errors when querying this package on unsupported
449 ;; platforms, e.g. when running "guix package --search="
450 ;; and also of targeting the builder's architecture.
451 (_ "JULIA_CPU_TARGET=generic"))
452
453 "CONFIG_SHELL=bash -x" ; needed to build bundled libraries
454 "USE_BINARYBUILDER=0"
455 ;; list (and order!) of "USE_SYSTEM_*" is here:
456 ;; https://github.com/JuliaLang/julia/blob/v1.8.2/Make.inc
457 "USE_SYSTEM_CSL=1"
458 "USE_SYSTEM_LLVM=1"
459 "USE_SYSTEM_LIBUNWIND=1"
460 "USE_SYSTEM_PCRE=1"
461 "USE_SYSTEM_OPENLIBM=1"
462 "USE_SYSTEM_DSFMT=1"
463 "USE_SYSTEM_LIBBLASTRAMPOLINE=1"
464 "USE_SYSTEM_BLAS=1"
465 "USE_SYSTEM_LAPACK=1"
466 "USE_SYSTEM_GMP=1"
467 "USE_SYSTEM_MPFR=1"
468 "USE_SYSTEM_LIBSUITESPARSE=1"
469 "USE_SYSTEM_LIBUV=1"
470 "USE_SYSTEM_UTF8PROC=1"
471 "USE_SYSTEM_MBEDTLS=1"
472 "USE_SYSTEM_LIBSSH2=1"
473 "USE_SYSTEM_NGHTTP2=1"
474 "USE_SYSTEM_CURL=1"
475 "USE_SYSTEM_LIBGIT2=1"
476 "USE_SYSTEM_PATCHELF=1"
477 "USE_SYSTEM_LIBWHICH=1"
478 "USE_SYSTEM_ZLIB=1"
479 "USE_SYSTEM_P7ZIP=1"
480
481 "USE_LLVM_SHLIB=1"
482
483 "NO_GIT=1" ; build from release tarball.
484 "USE_GPL_LIBS=1" ; proudly
485
486 ,@(if (target-x86-64?)
487 `("USE_BLAS64=1"
488 "LIBBLAS=-lopenblas64_"
489 "LIBBLASNAME=libopenblas64_")
490 `("USE_BLAS64=0"
491 "LIBBLAS=-lopenblas"
492 "LIBBLASNAME=libopenblas"))
493
494 (string-append "UTF8PROC_INC="
495 (assoc-ref %build-inputs "utf8proc")
496 "/include")
497 ;; Make.inc expects a static library for libuv.
498 (string-append "LIBUV="
499 (assoc-ref %build-inputs "libuv")
500 "/lib/libuv.a")
501 (string-append "LIBUV_INC="
502 (assoc-ref %build-inputs "libuv")
503 "/include"))))
504 (inputs
505 `(("bash-minimal" ,bash-minimal)
506 ("coreutils" ,coreutils) ; for bindings to "mkdir" and the like
507 ("curl" ,curl-ssh)
508 ("gfortran" ,gfortran)
509 ;; required for libgcc_s.so
510 ("gfortran:lib" ,gfortran "lib")
511 ("gmp" ,gmp)
512 ("lapack" ,lapack)
513 ("libblastrampoline" ,libblastrampoline)
514 ("libgit2" ,libgit2-1.3)
515 ("libnghttp2" ,nghttp2 "lib")
516 ("libssh2" ,libssh2)
517 ("libunwind" ,libunwind-julia)
518 ("libuv" ,libuv-julia)
519 ("llvm" ,llvm-julia)
520 ("mbedtls" ,mbedtls-lts)
521 ("mpfr" ,mpfr)
522 ,@(if (target-x86-64?)
523 `(("openblas" ,openblas-ilp64))
524 `(("openblas" ,openblas)))
525 ("openlibm" ,openlibm)
526 ("p7zip" ,p7zip)
527 ("pcre2" ,pcre2)
528 ("suitesparse" ,suitesparse)
529 ("utf8proc" ,utf8proc)
530 ("wget" ,wget)
531 ("which" ,which)
532 ("zlib" ,zlib)
533 ;; Find dependencies versions here:
534 ;; https://raw.githubusercontent.com/JuliaLang/julia/v1.6.0/deps/Versions.make
535 ("dsfmt" ,dsfmt)
536 ("libwhich" ,libwhich)))
537 (native-inputs
538 `(("openssl" ,openssl)
539 ("perl" ,perl)
540 ("patchelf" ,patchelf)
541 ("pkg-config" ,pkg-config)
542 ("python" ,python)))
543 (native-search-paths
544 (list (search-path-specification
545 (variable "JULIA_LOAD_PATH")
546 (files (list "share/julia/loadpath/")))
547 (search-path-specification
548 (variable "JULIA_DEPOT_PATH")
549 (files (list "share/julia/")))
550 $SSL_CERT_FILE))
551 ;; Julia only officially supports some of our platforms:
552 ;; https://julialang.org/downloads/#supported_platforms
553 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux"))
554 (home-page "https://julialang.org/")
555 (synopsis "High-performance dynamic language for technical computing")
556 (description
557 "Julia is a high-level, high-performance dynamic programming language for
558technical computing, with syntax that is familiar to users of other technical
559computing environments. It provides a sophisticated compiler, distributed
560parallel execution, numerical accuracy, and an extensive mathematical function
561library.")
562 (license license:expat)))