17 # Test flaky on ofborg
19 # Test flaky because of our RPATH patching
20 # https://github.com/NixOS/nixpkgs/pull/230965#issuecomment-1545336489
25 ++ lib.optionals (lib.versionAtLeast version "1.10") [
27 # https://github.com/JuliaLang/julia/issues/52739
32 ++ lib.optionals (lib.versionAtLeast version "1.11") [
34 # https://github.com/JuliaLang/julia/issues/54280
38 ++ lib.optionals stdenv.hostPlatform.isDarwin [
39 # Test flaky on ofborg
41 # Test requires pbcopy
43 # Test requires network access
46 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
47 # Test Failed at $out/share/julia/stdlib/v1.8/LinearAlgebra/test/blas.jl:702
49 # Test Failed at $out/share/julia/test/misc.jl:724
56 inherit version patches;
60 x86_64-linux = fetchurl {
61 url = "https://julialang-s3.julialang.org/bin/linux/x64/${lib.versions.majorMinor version}/julia-${version}-linux-x86_64.tar.gz";
62 sha256 = sha256.x86_64-linux;
64 aarch64-linux = fetchurl {
65 url = "https://julialang-s3.julialang.org/bin/linux/aarch64/${lib.versions.majorMinor version}/julia-${version}-linux-aarch64.tar.gz";
66 sha256 = sha256.aarch64-linux;
68 x86_64-darwin = fetchurl {
69 url = "https://julialang-s3.julialang.org/bin/mac/x64/${lib.versions.majorMinor version}/julia-${version}-mac64.tar.gz";
70 sha256 = sha256.x86_64-darwin;
72 aarch64-darwin = fetchurl {
73 url = "https://julialang-s3.julialang.org/bin/mac/aarch64/${lib.versions.majorMinor version}/julia-${version}-macaarch64.tar.gz";
74 sha256 = sha256.aarch64-darwin;
77 .${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
80 # Julia fails to pick up our Certification Authority root certificates, but
81 # it provides its own so we can simply disable the test. Patching in the
82 # dynamic path to ours require us to rebuild the Julia system image.
83 substituteInPlace share/julia/stdlib/v${lib.versions.majorMinor version}/NetworkOptions/test/runtests.jl \
84 --replace '@test ca_roots_path() != bundled_ca_roots()' \
85 '@test_skip ca_roots_path() != bundled_ca_roots()'
88 nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [
90 # https://github.com/JuliaLang/julia/blob/v1.9.0/NEWS.md#external-dependencies
99 + lib.optionalString stdenv.hostPlatform.isLinux ''
100 # "$out/share" is intentionally omitted since it contains
101 # julia package images and patchelf would break them
102 autoPatchelf "$out/bin" "$out/lib" "$out/libexec"
108 # Breaks backtraces, etc.
110 dontAutoPatchelf = true;
112 doInstallCheck = true;
115 export JULIA_TEST_USE_MULTIPLE_WORKERS=true
116 # Some tests require read/write access to $HOME.
117 # And $HOME cannot be equal to $TMPDIR as it causes test failures
118 export HOME=$(mktemp -d)
121 installCheckPhase = ''
122 runHook preInstallCheck
123 # Command lifted from `test/Makefile`.
128 $out/share/julia/test/runtests.jl \
129 --skip internet_required ${toString skip_tests}
130 runHook postInstallCheck
134 description = "High-level, high-performance, dynamic language for technical computing";
135 homepage = "https://julialang.org";
136 # Bundled and linked with various GPL code, although Julia itself is MIT.
137 license = lib.licenses.gpl2Plus;
138 maintainers = with lib.maintainers; [
150 mainProgram = "julia";