Merge pull request #117881 from ninjin/juliaclean

julia: cleanup/reorganisation

authored by Michael Raskin and committed by GitHub ae96c292 a946e4c5

+39 -260
+3 -7
pkgs/development/compilers/julia/1.0.nix
··· 88 ; 89 90 patches = [ 91 - # Julia recompiles a precompiled file if the mtime stored *in* the 92 - # .ji file differs from the mtime of the .ji file. This 93 - # doesn't work in Nix because Nix changes the mtime of files in 94 - # the Nix store to 1. So patch Julia to accept mtimes of 1. 95 - ./allow_nix_mtime.patch 96 - ./diagonal-test.patch 97 - ./use-system-utf8proc-julia-1.0.patch 98 ]; 99 100 postPatch = '' ··· 183 sed -e '/[$](DESTDIR)[$](docdir)/d' -i Makefile 184 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} 185 ''; 186 187 postInstall = '' 188 # Symlink shared libraries from LD_LIBRARY_PATH into lib/julia,
··· 88 ; 89 90 patches = [ 91 + ./patches/1.0/use-system-utf8proc-julia-1.0.patch 92 ]; 93 94 postPatch = '' ··· 177 sed -e '/[$](DESTDIR)[$](docdir)/d' -i Makefile 178 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} 179 ''; 180 + 181 + enableParallelBuilding = true; 182 183 postInstall = '' 184 # Symlink shared libraries from LD_LIBRARY_PATH into lib/julia,
-161
pkgs/development/compilers/julia/1.3.nix
··· 1 - { lib, stdenv, fetchurl, fetchzip, fetchFromGitHub 2 - # build tools 3 - , gfortran, m4, makeWrapper, patchelf, perl, which, python2 4 - , cmake 5 - # libjulia dependencies 6 - , libunwind, readline, utf8proc, zlib 7 - # standard library dependencies 8 - , curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2 9 - # linear algebra 10 - , blas, lapack, arpack 11 - # Darwin frameworks 12 - , CoreServices, ApplicationServices 13 - }: 14 - 15 - assert (!blas.isILP64) && (!lapack.isILP64); 16 - 17 - with lib; 18 - 19 - let 20 - majorVersion = "1"; 21 - minorVersion = "3"; 22 - maintenanceVersion = "1"; 23 - src_sha256 = "0q9a7yc3b235psrwl5ghyxgwly25lf8n818l8h6bkf2ymdbsv5p6"; 24 - version = "${majorVersion}.${minorVersion}.${maintenanceVersion}"; 25 - in 26 - 27 - stdenv.mkDerivation rec { 28 - pname = "julia"; 29 - inherit version; 30 - 31 - src = fetchzip { 32 - url = "https://github.com/JuliaLang/julia/releases/download/v${majorVersion}.${minorVersion}.${maintenanceVersion}/julia-${majorVersion}.${minorVersion}.${maintenanceVersion}-full.tar.gz"; 33 - sha256 = src_sha256; 34 - }; 35 - 36 - prePatch = '' 37 - export PATH=$PATH:${cmake}/bin 38 - ''; 39 - 40 - patches = [ 41 - ./use-system-utf8proc-julia-1.3.patch 42 - 43 - # Julia recompiles a precompiled file if the mtime stored *in* the 44 - # .ji file differs from the mtime of the .ji file. This 45 - # doesn't work in Nix because Nix changes the mtime of files in 46 - # the Nix store to 1. So patch Julia to accept mtimes of 1. 47 - ./allow_nix_mtime.patch 48 - ]; 49 - 50 - postPatch = '' 51 - patchShebangs . contrib 52 - for i in backtrace cmdlineargs; do 53 - mv test/$i.jl{,.off} 54 - touch test/$i.jl 55 - done 56 - rm stdlib/Sockets/test/runtests.jl && touch stdlib/Sockets/test/runtests.jl 57 - rm stdlib/Distributed/test/runtests.jl && touch stdlib/Distributed/test/runtests.jl 58 - sed -e 's/Invalid Content-Type:/invalid Content-Type:/g' -i ./stdlib/LibGit2/test/libgit2.jl 59 - sed -e 's/Failed to resolve /failed to resolve /g' -i ./stdlib/LibGit2/test/libgit2.jl 60 - ''; 61 - 62 - buildInputs = [ 63 - arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr 64 - pcre2.dev blas lapack openlibm openspecfun readline utf8proc 65 - zlib 66 - ] 67 - ++ lib.optionals stdenv.isDarwin [CoreServices ApplicationServices] 68 - ; 69 - 70 - nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ]; 71 - 72 - makeFlags = 73 - let 74 - arch = head (splitString "-" stdenv.system); 75 - march = { 76 - x86_64 = stdenv.hostPlatform.gcc.arch or "x86-64"; 77 - i686 = "pentium4"; 78 - aarch64 = "armv8-a"; 79 - }.${arch} 80 - or (throw "unsupported architecture: ${arch}"); 81 - # Julia requires Pentium 4 (SSE2) or better 82 - cpuTarget = { x86_64 = "x86-64"; i686 = "pentium4"; aarch64 = "generic"; }.${arch} 83 - or (throw "unsupported architecture: ${arch}"); 84 - in [ 85 - "ARCH=${arch}" 86 - "MARCH=${march}" 87 - "JULIA_CPU_TARGET=${cpuTarget}" 88 - "PREFIX=$(out)" 89 - "prefix=$(out)" 90 - "SHELL=${stdenv.shell}" 91 - 92 - (lib.optionalString (!stdenv.isDarwin) "USE_SYSTEM_BLAS=1") 93 - "USE_BLAS64=${if blas.isILP64 then "1" else "0"}" 94 - 95 - "USE_SYSTEM_LAPACK=1" 96 - 97 - "USE_SYSTEM_ARPACK=1" 98 - "USE_SYSTEM_FFTW=1" 99 - "USE_SYSTEM_GMP=1" 100 - "USE_SYSTEM_LIBGIT2=1" 101 - "USE_SYSTEM_LIBUNWIND=1" 102 - 103 - "USE_SYSTEM_MPFR=1" 104 - "USE_SYSTEM_OPENLIBM=1" 105 - "USE_SYSTEM_OPENSPECFUN=1" 106 - "USE_SYSTEM_PATCHELF=1" 107 - "USE_SYSTEM_PCRE=1" 108 - "PCRE_CONFIG=${pcre2.dev}/bin/pcre2-config" 109 - "PCRE_INCL_PATH=${pcre2.dev}/include/pcre2.h" 110 - "USE_SYSTEM_READLINE=1" 111 - "USE_SYSTEM_UTF8PROC=1" 112 - "USE_SYSTEM_ZLIB=1" 113 - 114 - "USE_BINARYBUILDER=0" 115 - ]; 116 - 117 - LD_LIBRARY_PATH = makeLibraryPath [ 118 - arpack fftw fftwSinglePrec gmp libgit2 mpfr blas openlibm 119 - openspecfun pcre2 lapack 120 - ]; 121 - 122 - # Other versions of Julia pass the tests, but we are not sure why these fail. 123 - doCheck = false; 124 - checkTarget = "testall"; 125 - # Julia's tests require read/write access to $HOME 126 - preCheck = '' 127 - export HOME="$NIX_BUILD_TOP" 128 - ''; 129 - 130 - preBuild = '' 131 - sed -e '/^install:/s@[^ ]*/doc/[^ ]*@@' -i Makefile 132 - sed -e '/[$](DESTDIR)[$](docdir)/d' -i Makefile 133 - export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} 134 - ''; 135 - 136 - postInstall = '' 137 - # Symlink shared libraries from LD_LIBRARY_PATH into lib/julia, 138 - # as using a wrapper with LD_LIBRARY_PATH causes segmentation 139 - # faults when program returns an error: 140 - # $ julia -e 'throw(Error())' 141 - find $(echo $LD_LIBRARY_PATH | sed 's|:| |g') -maxdepth 1 -name '*.${if stdenv.isDarwin then "dylib" else "so"}*' | while read lib; do 142 - if [[ ! -e $out/lib/julia/$(basename $lib) ]]; then 143 - ln -sv $lib $out/lib/julia/$(basename $lib) 144 - fi 145 - done 146 - ''; 147 - 148 - passthru = { 149 - inherit majorVersion minorVersion maintenanceVersion; 150 - site = "share/julia/site/v${majorVersion}.${minorVersion}"; 151 - }; 152 - 153 - meta = { 154 - description = "High-level performance-oriented dynamical language for technical computing"; 155 - homepage = "https://julialang.org/"; 156 - license = lib.licenses.mit; 157 - maintainers = with lib.maintainers; [ raskin rob garrison ]; 158 - platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]; 159 - broken = stdenv.isi686; 160 - }; 161 - }
···
+3 -7
pkgs/development/compilers/julia/1.5.nix
··· 33 }; 34 35 patches = [ 36 - ./use-system-utf8proc-julia-1.3.patch 37 - 38 - # Julia recompiles a precompiled file if the mtime stored *in* the 39 - # .ji file differs from the mtime of the .ji file. This 40 - # doesn't work in Nix because Nix changes the mtime of files in 41 - # the Nix store to 1. So patch Julia to accept mtimes of 1. 42 - ./allow_nix_mtime.patch 43 ]; 44 45 postPatch = '' ··· 128 sed -e '/[$](DESTDIR)[$](docdir)/d' -i Makefile 129 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} 130 ''; 131 132 postInstall = '' 133 # Symlink shared libraries from LD_LIBRARY_PATH into lib/julia,
··· 33 }; 34 35 patches = [ 36 + ./patches/1.5/use-system-utf8proc-julia-1.3.patch 37 ]; 38 39 postPatch = '' ··· 122 sed -e '/[$](DESTDIR)[$](docdir)/d' -i Makefile 123 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} 124 ''; 125 + 126 + enableParallelBuilding = true; 127 128 postInstall = '' 129 # Symlink shared libraries from LD_LIBRARY_PATH into lib/julia,
+24
pkgs/development/compilers/julia/README.md
···
··· 1 + Julia 2 + ===== 3 + 4 + [Julia][julia], as a full-fledged programming language with an extensive 5 + standard library that covers numerical computing, can be somewhat challenging to 6 + package. This file aims to provide pointers which could not easily be included 7 + as comments in the expressions themselves. 8 + 9 + [julia]: https://julialang.org 10 + 11 + For Nixpkgs, the manual is as always your primary reference, and for the Julia 12 + side of things you probably want to familiarise yourself with the [README 13 + ][readme], [build instructions][build], and [release process][release_process]. 14 + Remember that these can change between Julia releases, especially if the LTS and 15 + release branches have deviated greatly. A lot of the build process is 16 + underdocumented and thus there is no substitute for digging into the code that 17 + controls the build process. You are very likely to need to use the test suite to 18 + locate and address issues and in the end passing it, while only disabling a 19 + minimal set of broken or incompatible tests you think you have a good reason to 20 + disable, is your best bet at arriving at a solid derivation. 21 + 22 + [readme]: https://github.com/JuliaLang/julia/blob/master/README.md 23 + [build]: https://github.com/JuliaLang/julia/blob/master/doc/build/build.md 24 + [release_process]: https://julialang.org/blog/2019/08/release-process
-25
pkgs/development/compilers/julia/allow_nix_mtime.patch
··· 1 - From f79775378a9eeec5b99f18cc95735b12d172aba3 Mon Sep 17 00:00:00 2001 2 - From: Tom McLaughlin <pyro777@gmail.com> 3 - Date: Wed, 12 Dec 2018 13:01:32 -0800 4 - Subject: [PATCH] Patch to make work better with nix 5 - 6 - --- 7 - base/loading.jl | 2 +- 8 - 1 file changed, 1 insertion(+), 1 deletion(-) 9 - 10 - diff --git a/base/loading.jl b/base/loading.jl 11 - index 51201b98b6..b40c0690f6 100644 12 - --- a/base/loading.jl 13 - +++ b/base/loading.jl 14 - @@ -1384,7 +1384,7 @@ function stale_cachefile(modpath::String, cachefile::String) 15 - # Issue #13606: compensate for Docker images rounding mtimes 16 - # Issue #20837: compensate for GlusterFS truncating mtimes to microseconds 17 - ftime = mtime(f) 18 - - if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6) 19 - + if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6) && ftime != 1.0 20 - @debug "Rejecting stale cache file $cachefile (mtime $ftime_req) because file $f (mtime $ftime) has changed" 21 - return true 22 - end 23 - -- 24 - 2.17.1 25 -
···
-27
pkgs/development/compilers/julia/diagonal-test.patch
··· 1 - From 9eb180c523b877a53b9e1cf53a4d5e6dad3d7bfe Mon Sep 17 00:00:00 2001 2 - From: Lars Jellema <lars.jellema@gmail.com> 3 - Date: Sat, 19 Sep 2020 13:52:20 +0200 4 - Subject: [PATCH] Use approximate comparisons for diagonal tests 5 - 6 - --- 7 - stdlib/LinearAlgebra/test/diagonal.jl | 4 ++-- 8 - 1 file changed, 2 insertions(+), 2 deletions(-) 9 - 10 - diff --git a/stdlib/LinearAlgebra/test/diagonal.jl b/stdlib/LinearAlgebra/test/diagonal.jl 11 - index e420d5bc6d..7f1b5d0aec 100644 12 - --- a/stdlib/LinearAlgebra/test/diagonal.jl 13 - +++ b/stdlib/LinearAlgebra/test/diagonal.jl 14 - @@ -450,8 +450,8 @@ end 15 - M = randn(T, 5, 5) 16 - MM = [randn(T, 2, 2) for _ in 1:2, _ in 1:2] 17 - for transform in (identity, adjoint, transpose, Adjoint, Transpose) 18 - - @test lmul!(transform(D), copy(M)) == *(transform(Matrix(D)), M) 19 - - @test rmul!(copy(M), transform(D)) == *(M, transform(Matrix(D))) 20 - + @test lmul!(transform(D), copy(M)) ≈ *(transform(Matrix(D)), M) 21 - + @test rmul!(copy(M), transform(D)) ≈ *(M, transform(Matrix(D))) 22 - @test lmul!(transform(DD), copy(MM)) == *(transform(fullDD), MM) 23 - @test rmul!(copy(MM), transform(DD)) == *(MM, transform(fullDD)) 24 - end 25 - -- 26 - 2.28.0 27 -
···
-22
pkgs/development/compilers/julia/update-1.5.py
··· 1 - #!/usr/bin/env nix-shell 2 - #!nix-shell -i python3 -p python3 python3Packages.requests 3 - 4 - import os 5 - import re 6 - import requests 7 - import subprocess 8 - 9 - latest = requests.get("https://api.github.com/repos/JuliaLang/julia/releases/latest").json()["tag_name"] 10 - assert latest[0] == "v" 11 - major, minor, patch = latest[1:].split(".") 12 - assert major == "1" 13 - # When a new minor version comes out we'll have to refactor/copy this update script. 14 - assert minor == "5" 15 - 16 - sha256 = subprocess.check_output(["nix-prefetch-url", "--unpack", f"https://github.com/JuliaLang/julia/releases/download/v{major}.{minor}.{patch}/julia-{major}.{minor}.{patch}-full.tar.gz"], text=True).strip() 17 - 18 - nix_path = os.path.join(os.path.dirname(__file__), "1.5.nix") 19 - nix0 = open(nix_path, "r").read() 20 - nix1 = re.sub("maintenanceVersion = \".*\";", f"maintenanceVersion = \"{patch}\";", nix0) 21 - nix2 = re.sub("src_sha256 = \".*\";", f"src_sha256 = \"{sha256}\";", nix1) 22 - open(nix_path, "w").write(nix2)
···
pkgs/development/compilers/julia/use-system-utf8proc-julia-1.0.patch pkgs/development/compilers/julia/patches/1.0/use-system-utf8proc-julia-1.0.patch
pkgs/development/compilers/julia/use-system-utf8proc-julia-1.3.patch pkgs/development/compilers/julia/patches/1.5/use-system-utf8proc-julia-1.3.patch
+4 -2
pkgs/top-level/aliases.nix
··· 337 kodiPlain = kodi; 338 kodiPlainWayland = kodi-wayland; 339 jellyfin_10_5 = throw "Jellyfin 10.5 is no longer supported and contains a security vulnerability. Please upgrade to a newer version."; # added 2021-04-26 340 - julia_07 = throw "julia_07 is deprecated in favor of julia_10 LTS"; # added 2020-09-15 341 - julia_11 = throw "julia_11 is deprecated in favor of latest Julia version"; # added 2020-09-15 342 kdeconnect = plasma5Packages.kdeconnect-kde; # added 2020-10-28 343 kdiff3-qt5 = kdiff3; # added 2017-02-18 344 keepass-keefox = keepass-keepassrpc; # backwards compatibility alias, added 2018-02
··· 337 kodiPlain = kodi; 338 kodiPlainWayland = kodi-wayland; 339 jellyfin_10_5 = throw "Jellyfin 10.5 is no longer supported and contains a security vulnerability. Please upgrade to a newer version."; # added 2021-04-26 340 + julia_07 = throw "julia_07 has been deprecated in favor of the latest LTS version"; # added 2020-09-15 341 + julia_1 = throw "julia_1 has been deprecated in favor of julia_10 as it was ambiguous"; # added 2021-03-13 342 + julia_11 = throw "julia_11 has been deprecated in favor of the latest stable version"; # added 2020-09-15 343 + julia_13 = throw "julia_13 has been deprecated in favor of the latest stable version"; # added 2021-03-13 344 kdeconnect = plasma5Packages.kdeconnect-kde; # added 2020-10-28 345 kdiff3-qt5 = kdiff3; # added 2017-02-18 346 keepass-keefox = keepass-keepassrpc; # backwards compatibility alias, added 2018-02
+5 -9
pkgs/top-level/all-packages.nix
··· 10986 10987 julia_10 = callPackage ../development/compilers/julia/1.0.nix { 10988 gmp = gmp6; 10989 - inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; 10990 libgit2 = libgit2_0_27; 10991 - }; 10992 - 10993 - julia_13 = callPackage ../development/compilers/julia/1.3.nix { 10994 - gmp = gmp6; 10995 - inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; 10996 }; 10997 10998 julia_15 = callPackage ../development/compilers/julia/1.5.nix { 10999 - inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; 11000 }; 11001 11002 - julia_1 = julia_10; 11003 - julia = julia_15; 11004 11005 jwasm = callPackage ../development/compilers/jwasm { }; 11006
··· 10986 10987 julia_10 = callPackage ../development/compilers/julia/1.0.nix { 10988 gmp = gmp6; 10989 + inherit (darwin.apple_sdk.frameworks) ApplicationServices CoreServices; 10990 libgit2 = libgit2_0_27; 10991 }; 10992 10993 julia_15 = callPackage ../development/compilers/julia/1.5.nix { 10994 + inherit (darwin.apple_sdk.frameworks) ApplicationServices CoreServices; 10995 }; 10996 10997 + julia-lts = julia_10; 10998 + julia-stable = julia_15; 10999 + julia = julia-lts; 11000 11001 jwasm = callPackage ../development/compilers/jwasm { }; 11002