summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorSamuel Ainsworth <skainsworth@gmail.com>2021-03-25 03:32:14 -0700
committerGitHub <noreply@github.com>2021-03-25 11:32:14 +0100
commita4456496ee829c6bd7ff774afb7fbd9d1ea10206 (patch)
tree919c8bbe8fb13263e26c439d29c4d5c58ead2462 /pkgs/development/compilers
parenta65965b9e3ca868be1c4e99a463604313008841c (diff)
downloadnixpkgs-a4456496ee829c6bd7ff774afb7fbd9d1ea10206.tar
nixpkgs-a4456496ee829c6bd7ff774afb7fbd9d1ea10206.tar.gz
nixpkgs-a4456496ee829c6bd7ff774afb7fbd9d1ea10206.tar.bz2
nixpkgs-a4456496ee829c6bd7ff774afb7fbd9d1ea10206.tar.lz
nixpkgs-a4456496ee829c6bd7ff774afb7fbd9d1ea10206.tar.xz
nixpkgs-a4456496ee829c6bd7ff774afb7fbd9d1ea10206.tar.zst
nixpkgs-a4456496ee829c6bd7ff774afb7fbd9d1ea10206.zip
julia: add update script, and 1.5.3 -> 1.5.4 (#116466)
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/julia/1.5.nix17
-rwxr-xr-xpkgs/development/compilers/julia/update-1.5.py22
2 files changed, 30 insertions, 9 deletions
diff --git a/pkgs/development/compilers/julia/1.5.nix b/pkgs/development/compilers/julia/1.5.nix
index a523336b7b9..2a68090a04b 100644
--- a/pkgs/development/compilers/julia/1.5.nix
+++ b/pkgs/development/compilers/julia/1.5.nix
@@ -1,7 +1,6 @@
-{ lib, stdenv, fetchurl, fetchzip, fetchFromGitHub
+{ lib, stdenv, fetchzip
 # build tools
-, gfortran, m4, makeWrapper, patchelf, perl, which, python2
-, cmake
+, gfortran, m4, makeWrapper, patchelf, perl, which, python2, cmake
 # libjulia dependencies
 , libunwind, readline, utf8proc, zlib
 # standard library dependencies
@@ -19,8 +18,8 @@ with lib;
 let
   majorVersion = "1";
   minorVersion = "5";
-  maintenanceVersion = "3";
-  src_sha256 = "sha256:0jds8lrhk4hfdv7dg5p2ibzin9ivga7wrx7zwcmz6dqp3x792n1i";
+  maintenanceVersion = "4";
+  src_sha256 = "1ba1v7hakgj95xvhyff0zcp0574qv6vailjl48wl1f8w5k54lsw2";
   version = "${majorVersion}.${minorVersion}.${maintenanceVersion}";
 in
 
@@ -28,10 +27,10 @@ stdenv.mkDerivation rec {
   pname = "julia";
   inherit version;
 
-   src = fetchzip {
-     url = "https://github.com/JuliaLang/julia/releases/download/v${version}/julia-${version}-full.tar.gz";
-     sha256 = src_sha256;
-   };
+  src = fetchzip {
+    url = "https://github.com/JuliaLang/julia/releases/download/v${version}/julia-${version}-full.tar.gz";
+    sha256 = src_sha256;
+  };
 
   patches = [
     ./use-system-utf8proc-julia-1.3.patch
diff --git a/pkgs/development/compilers/julia/update-1.5.py b/pkgs/development/compilers/julia/update-1.5.py
new file mode 100755
index 00000000000..e37f37d456b
--- /dev/null
+++ b/pkgs/development/compilers/julia/update-1.5.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i python3 -p python3 python3Packages.requests
+
+import os
+import re
+import requests
+import subprocess
+
+latest = requests.get("https://api.github.com/repos/JuliaLang/julia/releases/latest").json()["tag_name"]
+assert latest[0] == "v"
+major, minor, patch = latest[1:].split(".")
+assert major == "1"
+# When a new minor version comes out we'll have to refactor/copy this update script.
+assert minor == "5"
+
+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()
+
+nix_path = os.path.join(os.path.dirname(__file__), "1.5.nix")
+nix0 = open(nix_path, "r").read()
+nix1 = re.sub("maintenanceVersion = \".*\";", f"maintenanceVersion = \"{patch}\";", nix0)
+nix2 = re.sub("src_sha256 = \".*\";", f"src_sha256 = \"{sha256}\";", nix1)
+open(nix_path, "w").write(nix2)