From 8d45fadf16e57831fbb1b844f8a90f5481d9797f Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Fri, 29 Nov 2024 05:42:02 -0700 Subject: [PATCH] julia: bump julia-modules again --- .../kernels/julia/julia-modules/default.nix | 30 +++++++++---------- modules/kernels/julia/julia-modules/depot.nix | 16 +++++----- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/modules/kernels/julia/julia-modules/default.nix b/modules/kernels/julia/julia-modules/default.nix index b9f926a..e772537 100644 --- a/modules/kernels/julia/julia-modules/default.nix +++ b/modules/kernels/julia/julia-modules/default.nix @@ -51,21 +51,21 @@ let # Start by wrapping Julia so it has access to Python and any other extra libs. # Also, prevent various packages (CondaPkg.jl, PythonCall.jl) from trying to do network calls. - juliaWrapped = runCommand "julia-${julia.version}-wrapped" { buildInputs = [makeWrapper]; inherit makeWrapperArgs; } '' - mkdir -p $out/bin - makeWrapper ${julia}/bin/julia $out/bin/julia \ - --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath extraLibs}" \ - --set FONTCONFIG_FILE ${fontconfig.out}/etc/fonts/fonts.conf \ - --set PYTHONHOME "${pythonToUse}" \ - --prefix PYTHONPATH : "${pythonToUse}/${pythonToUse.sitePackages}" \ - --set PYTHON ${pythonToUse}/bin/python $makeWrapperArgs \ - --set JULIA_CONDAPKG_OFFLINE yes \ - --set JULIA_CONDAPKG_BACKEND Null \ - '' ++ lib.optionalString (juliaCpuTarget != null) '' - --set JULIA_CPU_TARGET ${juliaCpuTarget} \ - '' ++ '' - --set JULIA_PYTHONCALL_EXE "@PyCall" - ''; + juliaWrapped = let + cpuTargetFlag = lib.optionalString (juliaCpuTarget != null) "--set JULIA_CPU_TARGET ${juliaCpuTarget}"; + in + runCommand "julia-${julia.version}-wrapped" { buildInputs = [makeWrapper]; inherit makeWrapperArgs; } '' + mkdir -p $out/bin + makeWrapper ${julia}/bin/julia $out/bin/julia ${cpuTargetFlag} \ + --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath extraLibs}" \ + --set FONTCONFIG_FILE ${fontconfig.out}/etc/fonts/fonts.conf \ + --set PYTHONHOME "${pythonToUse}" \ + --prefix PYTHONPATH : "${pythonToUse}/${pythonToUse.sitePackages}" \ + --set PYTHON ${pythonToUse}/bin/python $makeWrapperArgs \ + --set JULIA_CONDAPKG_OFFLINE yes \ + --set JULIA_CONDAPKG_BACKEND Null \ + --set JULIA_PYTHONCALL_EXE "@PyCall" + ''; # If our closure ends up with certain packages, add others. packageImplications = { diff --git a/modules/kernels/julia/julia-modules/depot.nix b/modules/kernels/julia/julia-modules/depot.nix index 26eae62..7381c73 100644 --- a/modules/kernels/julia/julia-modules/depot.nix +++ b/modules/kernels/julia/julia-modules/depot.nix @@ -33,9 +33,9 @@ let in runCommand "julia-depot" { - nativeBuildInputs = [curl git julia (python3.withPackages (ps: with ps; [pyyaml]))] ++ extraLibs; - inherit precompile registry; - } '' + nativeBuildInputs = [curl git julia (python3.withPackages (ps: with ps; [pyyaml]))] ++ extraLibs; + inherit precompile registry; +} ('' export HOME=$(pwd) echo "Building Julia depot and project with the following inputs" @@ -58,11 +58,9 @@ runCommand "julia-depot" { # Only precompile if configured to below export JULIA_PKG_PRECOMPILE_AUTO=0 - - '' ++ lib.optionalString (juliaCpuTarget != null) '' - export JULIA_CPU_TARGET="${juliaCpuTarget}" - - '' ++ '' +'' + lib.optionalString (juliaCpuTarget != null) '' + export JULIA_CPU_TARGET="${juliaCpuTarget}" +'' + '' # Prevent a warning where Julia tries to download package server info export JULIA_PKG_SERVER="" @@ -111,4 +109,4 @@ runCommand "julia-depot" { # Remove the registry to save space Pkg.Registry.rm("General") ' -'' +'')