2021-12-01 16:22:44 +00:00
|
|
|
{ autoPatchelfHook, fetchurl, lib, stdenv }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "julia-bin";
|
2023-01-12 00:20:26 +00:00
|
|
|
version = "1.8.5";
|
2021-12-01 16:22:44 +00:00
|
|
|
|
|
|
|
src = {
|
|
|
|
x86_64-linux = fetchurl {
|
|
|
|
url = "https://julialang-s3.julialang.org/bin/linux/x64/${lib.versions.majorMinor version}/julia-${version}-linux-x86_64.tar.gz";
|
2023-01-12 00:20:26 +00:00
|
|
|
sha256 = "sha256-5xokgW6P6dX0gHZky7tCc49aqf4FOX01yB1MXWSbnQU=";
|
2021-12-01 16:22:44 +00:00
|
|
|
};
|
2022-09-18 13:17:31 +00:00
|
|
|
aarch64-linux = fetchurl {
|
|
|
|
url = "https://julialang-s3.julialang.org/bin/linux/aarch64/${lib.versions.majorMinor version}/julia-${version}-linux-aarch64.tar.gz";
|
2023-01-12 00:20:26 +00:00
|
|
|
sha256 = "sha256-ofY3tExx6pvJbXw+80dyTAVKHlInuYCt6/wzWZ5RU6Q=";
|
2022-09-18 13:17:31 +00:00
|
|
|
};
|
2021-12-01 16:22:44 +00:00
|
|
|
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Julia fails to pick up our Certification Authority root certificates, but
|
|
|
|
# it provides its own so we can simply disable the test. Patching in the
|
|
|
|
# dynamic path to ours require us to rebuild the Julia system image.
|
|
|
|
substituteInPlace share/julia/stdlib/v${lib.versions.majorMinor version}/NetworkOptions/test/runtests.jl \
|
|
|
|
--replace '@test ca_roots_path() != bundled_ca_roots()' \
|
|
|
|
'@test_skip ca_roots_path() != bundled_ca_roots()'
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
cp -r . $out
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Breaks backtraces, etc.
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
preInstallCheck = ''
|
2022-09-03 22:09:14 +00:00
|
|
|
export JULIA_TEST_USE_MULTIPLE_WORKERS=true
|
2021-12-01 16:22:44 +00:00
|
|
|
# Some tests require read/write access to $HOME.
|
|
|
|
export HOME="$TMPDIR"
|
|
|
|
'';
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
# Command lifted from `test/Makefile`.
|
|
|
|
$out/bin/julia \
|
|
|
|
--check-bounds=yes \
|
|
|
|
--startup-file=no \
|
|
|
|
--depwarn=error \
|
|
|
|
$out/share/julia/test/runtests.jl
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2021-12-02 01:08:09 +00:00
|
|
|
description = "High-level, high-performance, dynamic language for technical computing";
|
2021-12-01 16:22:44 +00:00
|
|
|
homepage = "https://julialang.org";
|
|
|
|
# Bundled and linked with various GPL code, although Julia itself is MIT.
|
|
|
|
license = lib.licenses.gpl2Plus;
|
2022-09-19 03:58:07 +00:00
|
|
|
maintainers = with lib.maintainers; [ ninjin raskin nickcao ];
|
2022-09-18 13:17:31 +00:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2022-01-07 17:15:51 +00:00
|
|
|
mainProgram = "julia";
|
2021-12-01 16:22:44 +00:00
|
|
|
};
|
|
|
|
}
|