From 25ae43df699499a04f3658d8dc8ddc79357043f2 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 11 Feb 2022 09:57:53 -0700 Subject: [PATCH] add piston nix pkg for julia --- packages/julia/1.5.4/build.sh | 21 --------------------- packages/julia/1.5.4/environment | 4 ---- packages/julia/1.5.4/metadata.json | 5 ----- packages/julia/1.5.4/run | 4 ---- packages/julia/1.5.4/test.jl | 1 - packages/julia/1.6.1/build.sh | 21 --------------------- packages/julia/1.6.1/environment | 4 ---- packages/julia/1.6.1/metadata.json | 5 ----- packages/julia/1.6.1/run | 4 ---- packages/julia/1.6.1/test.jl | 1 - runtimes/default.nix | 1 + runtimes/julia.nix | 29 +++++++++++++++++++++++++++++ 12 files changed, 30 insertions(+), 70 deletions(-) delete mode 100755 packages/julia/1.5.4/build.sh delete mode 100644 packages/julia/1.5.4/environment delete mode 100644 packages/julia/1.5.4/metadata.json delete mode 100755 packages/julia/1.5.4/run delete mode 100644 packages/julia/1.5.4/test.jl delete mode 100755 packages/julia/1.6.1/build.sh delete mode 100644 packages/julia/1.6.1/environment delete mode 100644 packages/julia/1.6.1/metadata.json delete mode 100755 packages/julia/1.6.1/run delete mode 100644 packages/julia/1.6.1/test.jl create mode 100644 runtimes/julia.nix diff --git a/packages/julia/1.5.4/build.sh b/packages/julia/1.5.4/build.sh deleted file mode 100755 index 678764c..0000000 --- a/packages/julia/1.5.4/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Install location -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build -cd build - -# Download and extract Julia source -curl -L "https://github.com/JuliaLang/julia/releases/download/v1.5.4/julia-1.5.4.tar.gz" -o julia.tar.gz -tar xzf julia.tar.gz --strip-components=1 - -# Build -echo "JULIA_CPU_TARGET=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1) -prefix=$PREFIX" > Make.user -make -j$(nproc) -make install -j$(nproc) - -# Cleanup -cd .. -rm -rf build diff --git a/packages/julia/1.5.4/environment b/packages/julia/1.5.4/environment deleted file mode 100644 index e7d0c97..0000000 --- a/packages/julia/1.5.4/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Add Julia binary to path -export PATH=$PWD/bin:$PATH diff --git a/packages/julia/1.5.4/metadata.json b/packages/julia/1.5.4/metadata.json deleted file mode 100644 index f177ea8..0000000 --- a/packages/julia/1.5.4/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "julia", - "version": "1.5.4", - "aliases": ["jl"] -} diff --git a/packages/julia/1.5.4/run b/packages/julia/1.5.4/run deleted file mode 100755 index 6badf1c..0000000 --- a/packages/julia/1.5.4/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run without startup or history file -julia --startup-file=no --history-file=no "$@" diff --git a/packages/julia/1.5.4/test.jl b/packages/julia/1.5.4/test.jl deleted file mode 100644 index dc98a27..0000000 --- a/packages/julia/1.5.4/test.jl +++ /dev/null @@ -1 +0,0 @@ -println("OK") diff --git a/packages/julia/1.6.1/build.sh b/packages/julia/1.6.1/build.sh deleted file mode 100755 index b2772ae..0000000 --- a/packages/julia/1.6.1/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Install location -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build -cd build - -# Download and extract Julia source -curl -L "https://github.com/JuliaLang/julia/releases/download/v1.6.1/julia-1.6.1.tar.gz" -o julia.tar.gz -tar xzf julia.tar.gz --strip-components=1 - -# Build -echo "JULIA_CPU_TARGET=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1) -prefix=$PREFIX" > Make.user -make -j$(nproc) -make install -j$(nproc) - -# Cleanup -cd .. -rm -rf build diff --git a/packages/julia/1.6.1/environment b/packages/julia/1.6.1/environment deleted file mode 100644 index e7d0c97..0000000 --- a/packages/julia/1.6.1/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Add Julia binary to path -export PATH=$PWD/bin:$PATH diff --git a/packages/julia/1.6.1/metadata.json b/packages/julia/1.6.1/metadata.json deleted file mode 100644 index be2fdea..0000000 --- a/packages/julia/1.6.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "julia", - "version": "1.6.1", - "aliases": ["jl"] -} diff --git a/packages/julia/1.6.1/run b/packages/julia/1.6.1/run deleted file mode 100755 index 6badf1c..0000000 --- a/packages/julia/1.6.1/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run without startup or history file -julia --startup-file=no --history-file=no "$@" diff --git a/packages/julia/1.6.1/test.jl b/packages/julia/1.6.1/test.jl deleted file mode 100644 index dc98a27..0000000 --- a/packages/julia/1.6.1/test.jl +++ /dev/null @@ -1 +0,0 @@ -println("OK") diff --git a/runtimes/default.nix b/runtimes/default.nix index 4e41dde..993506c 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -38,4 +38,5 @@ args: { "lolcode" = import ./lolcode.nix args; "sbcl-lisp" = import ./sbcl-lisp.nix args; "jvm-kotlin" = import ./jvm-kotlin.nix args; + "julia" = import ./julia.nix args; } diff --git a/runtimes/julia.nix b/runtimes/julia.nix new file mode 100644 index 0000000..fd80ccc --- /dev/null +++ b/runtimes/julia.nix @@ -0,0 +1,29 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.julia-bin; +in piston.mkRuntime { + language = "julia"; + version = pkg.version; + + aliases = [ + "jl" + ]; + + run = '' + ${pkg}/bin/julia --startup-file=no --history-file=no "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.jl" = '' + println("OK") + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.jl"; + }) + ]; +} \ No newline at end of file