add piston nix pkg for julia

This commit is contained in:
Dan Vargas 2022-02-11 09:57:53 -07:00
parent 93fa1a9755
commit 25ae43df69
12 changed files with 30 additions and 70 deletions

View File

@ -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

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Add Julia binary to path
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "julia",
"version": "1.5.4",
"aliases": ["jl"]
}

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Run without startup or history file
julia --startup-file=no --history-file=no "$@"

View File

@ -1 +0,0 @@
println("OK")

View File

@ -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

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Add Julia binary to path
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "julia",
"version": "1.6.1",
"aliases": ["jl"]
}

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Run without startup or history file
julia --startup-file=no --history-file=no "$@"

View File

@ -1 +0,0 @@
println("OK")

View File

@ -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;
}

29
runtimes/julia.nix Normal file
View File

@ -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";
})
];
}