Merge pull request #436 from dvargas46/add-nix-packages

Add nix packages
This commit is contained in:
Thomas Hobson 2022-02-19 23:39:26 +13:00 committed by GitHub
commit 981abc2d94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
234 changed files with 1498 additions and 1256 deletions

View File

@ -4,6 +4,7 @@ on:
branches:
- master
- v3
- '!nix-packages'
paths:
- api/**

View File

@ -2,6 +2,8 @@ name: 'Package Pull Requests'
on:
pull_request:
branches:
- '!nix-packages'
types:
- opened
- reopened

View File

@ -5,6 +5,7 @@ on:
branches:
- master
- v3
- '!nix-packages'
paths:
- packages/**

View File

@ -40,6 +40,7 @@ with pkgs; rec {
gnutar
gzip
gnugrep
rename
util-linux
];

View File

@ -1,24 +0,0 @@
#!/bin/bash
export PATH=$PWD/bin:$PATH
PREFIX=$(realpath $(dirname $0))
mkdir -p build
cd build
# Emacs version 27.1 supports Docker builds
# Otherwise, older versions will work too, but you will have to disable `/proc/sys/kernel/randomize_va_space` which is less secure
curl -L "http://ftpmirror.gnu.org/emacs/emacs-27.1.tar.gz" -o emacs.tar.gz
tar xzf emacs.tar.gz --strip-components=1
rm emacs.tar.gz
# Building without all that X11 stuff
./configure --prefix="$PREFIX" --with-x=no --with-x-toolkit=no --with-xpm=no --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no --with-gnutls=no
make -j$(nproc)
make install -j$(nproc)
cd ..
rm -rf build

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "emacs",
"version": "27.1.0",
"aliases": ["emacs", "el", "elisp"]
}

View File

@ -1,4 +0,0 @@
#!/bin/bash
# Put instructions to run the runtime
emacs -Q --script "$@"

View File

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

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
curl -L "https://sourceforge.net/projects/fbc/files/FreeBASIC-1.08.0/Binaries-Linux/FreeBASIC-1.08.0-linux-x86_64.tar.gz/download" -o freebasic.tar.gz
tar xf freebasic.tar.gz --strip-components=1
rm freebasic.tar.gz

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Compile bas files
fbc -lang qb -b "$@" -x out

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Path to fbc compiler
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "freebasic",
"version": "1.8.0",
"aliases": ["bas", "fbc", "basic", "qbasic", "quickbasic"]
}

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
# Run output file from compile with arguments
shift
./out "$@"

View File

@ -1 +0,0 @@
PRINT "OK"

View File

@ -1,26 +0,0 @@
#!/usr/bin/env bash
# Put instructions to build your package in here
[[ -d "bin" ]] && exit 0
PREFIX=$(realpath $(dirname $0))
mkdir -p build obj
cd build
curl "https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.gz" -o gcc.tar.gz
tar xzf gcc.tar.gz --strip-components=1
./contrib/download_prerequisites
cd ../obj
# === autoconf based ===
../build/configure --prefix "$PREFIX" --enable-languages=c,c++,d,fortran --disable-multilib --disable-bootstrap
make -j$(nproc)
make install -j$(nproc)
cd ../
rm -rf build obj

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
# Put instructions to compile source code, remove this file if the language does not require this stage
case "${PISTON_LANGUAGE}" in
c)
rename 's/$/\.c/' "$@" # Add .c extension
gcc -std=c11 *.c -lm
;;
c++)
rename 's/$/\.cpp/' "$@" # Add .cpp extension
g++ -std=c++17 *.cpp
;;
d)
rename 's/.code$/\.d/' "$@" # Add .d extension
gdc *.d
;;
fortran)
rename 's/.code$/\.f90/' "$@" # Add .f90 extension
gfortran *.f90
;;
*)
echo "How did you get here? (${PISTON_LANGUAGE})"
exit 1
;;
esac
chmod +x a.out

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH
export LD_LIBRARY_PATH="$PWD/lib:$PWD/lib64" # Need this to properly link Fortran

View File

@ -1,22 +0,0 @@
{
"language": "gcc",
"version": "10.2.0",
"provides": [
{
"language": "c",
"aliases": ["gcc"]
},
{
"language": "c++",
"aliases": ["cpp", "g++"]
},
{
"language": "d",
"aliases": ["gdc"]
},
{
"language": "fortran",
"aliases": ["fortran", "f90"]
}
]
}

View File

@ -1,6 +0,0 @@
#!/usr/bin/env bash
# Put instructions to run the runtime
shift # Discard main filename
./a.out "$@"

View File

@ -1,6 +0,0 @@
#include <stdio.h>
int main(void) {
printf("OK");
return 0;
}

View File

@ -1,6 +0,0 @@
#include <iostream>
int main(void) {
printf("OK");
return 0;
}

View File

@ -1,5 +0,0 @@
import std.stdio;
void main() {
writeln("OK");
}

View File

@ -1,3 +0,0 @@
program test
print "(a)", 'OK'
end program test

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
curl -LO https://golang.org/dl/go1.16.2.linux-amd64.tar.gz
tar -xzf go1.16.2.linux-amd64.tar.gz
rm go1.16.2.linux-amd64.tar.gz

View File

@ -1,2 +0,0 @@
export PATH=$PWD/go/bin:$PATH
export GOPATH=$PWD/gopath

View File

@ -1,5 +0,0 @@
{
"language": "go",
"version": "1.16.2",
"aliases": ["go", "golang"]
}

View File

@ -1,7 +0,0 @@
#!/usr/bin/env bash
mv $1 $1.go
#filename=$1.go
filename=*.go
shift
GOCACHE=$PWD go run $filename "$@"

View File

@ -1,7 +0,0 @@
package main
import "fmt"
func main() {
fmt.Println("OK")
}

View File

@ -1,14 +0,0 @@
#!/bin/bash
# Groovy depends on JDK8+
mkdir -p java
cd java
curl "https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz" -o java.tar.gz
tar xzf java.tar.gz --strip-components=1
rm java.tar.gz
cd ..
# Download Groovy binaries
curl -L "https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-binary-3.0.7.zip" -o groovy.zip
unzip -q groovy.zip
rm groovy.zip

View File

@ -1,17 +0,0 @@
#!/bin/bash
# Compile groovy scripts into a separate "classes" directory
# NOTE: - Main file MUST be a groovy script
# - not supporting object class entry points as of now
groovyc -d classes "$@"
# Create the Manifest and include groovy jars:
# NOTE: - main class will be the first file ('.' becomes '_' and without the extension)
# - groovy lib jars MUST be in the class path in order to work properly
echo "Main-Class: $(sed 's/\./\_/g'<<<${1%.*})
Class-Path: $(echo $GROOVY_HOME/lib/*.jar | sed 's/\s/\n /g')
" > manifest.txt
# Create the jar from the manifest and classes
jar cfm out.jar manifest.txt -C classes .

View File

@ -1,10 +0,0 @@
#!/bin/bash
# Groovy requires JAVA_HOME to be set
export JAVA_HOME=$PWD/java
# GROOVY_HOME needed to get the groovy libs
export GROOVY_HOME=$PWD/groovy-3.0.7
# Add java and groovy binaries to the path
export PATH=$PWD/java/bin:$PWD/groovy-3.0.7/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "groovy",
"version": "3.0.7",
"aliases": ["groovy", "gvy"]
}

View File

@ -1,5 +0,0 @@
#!/bin/bash
# Run the jar created during compile
shift
java -jar out.jar "$@"

View File

@ -1 +0,0 @@
println 'OK'

View File

@ -1,19 +0,0 @@
#!/bin/bash
PREFIX=$(realpath $(dirname $0))
mkdir -p build
cd build
# Platform specific because a true source compile would require GHC to be installed already on the latest
curl -L "https://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-x86_64-deb10-linux.tar.xz" -o ghc.tar.xz
tar xf ghc.tar.xz --strip-components=1
rm ghc.tar.xz
./configure --prefix="$PREFIX"
make install -j$(nproc)
cd ../
rm -rf build

View File

@ -1,6 +0,0 @@
#!/usr/bin/env bash
# Compile haskell file(s)
rename 's/$/\.hs/' "$@" # Add .hs extension
ghc -dynamic -v0 -o out *.hs
chmod +x out

View File

@ -1 +0,0 @@
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "haskell",
"version": "9.0.1",
"aliases": ["haskell", "hs"]
}

View File

@ -1,4 +0,0 @@
#!/bin/bash
shift # Filename is only used to compile
./out "$@"

View File

@ -1 +0,0 @@
main = putStrLn "OK"

View File

@ -1,17 +0,0 @@
#!/bin/bash
PREFIX=$(realpath $(dirname $0))
mkdir -p build/iverilog
cd build/iverilog
curl -L https://github.com/steveicarus/iverilog/archive/refs/tags/v11_0.tar.gz -o iverilog.tar.gz
tar xzf iverilog.tar.gz --strip-components=1
chmod +x ./autoconf.sh
./autoconf.sh
./configure --prefix="$PREFIX"
make -j$(nproc)
make install -j$(nproc)
cd ../../
rm -rf build

View File

@ -1,4 +0,0 @@
#!/bin/bash
rename 's/$/\.v/' "$@" # Add .v extension
iverilog *.v

View File

@ -1,2 +0,0 @@
#!/bin/bash
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "iverilog",
"version": "11.0.0",
"aliases": ["verilog", "vvp"]
}

View File

@ -1,4 +0,0 @@
#!/bin/bash
shift
vvp a.out "$@"

View File

@ -1,7 +0,0 @@
module hello;
initial
begin
$display("OK");
$finish ;
end
endmodule

View File

@ -1,9 +0,0 @@
#!/usr/bin/env bash
# Put instructions to build your package in here
curl "https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz" -o java.tar.gz
tar xzf java.tar.gz --strip-components=1
rm java.tar.gz

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "java",
"version": "15.0.2",
"aliases": []
}

View File

@ -1,7 +0,0 @@
#!/usr/bin/env bash
# Put instructions to run the runtime
mv $1 $1.java
filename=$1.java
shift
java $filename "$@"

View File

@ -1,5 +0,0 @@
public class HelloWorld {
public static void main(String[] args) {
System.out.println("OK");
}
}

View File

@ -1,12 +0,0 @@
#!/bin/bash
source ../../python/3.9.1/build.sh
mkdir -p build
git clone -q https://github.com/DennisMitchell/jellylanguage.git build/jelly
cd build/jelly
../../bin/python3.9 setup.py install --optimize=1
cd ../../
rm -rf build

View File

@ -1 +0,0 @@
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "jelly",
"version": "0.1.31",
"aliases": []
}

View File

@ -1 +0,0 @@
jelly fu "$@"

View File

@ -1 +0,0 @@
“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.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

@ -1,13 +0,0 @@
#!/usr/bin/env bash
# Download and extract JDK8
curl -L "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.tar.gz" -o jdk.tar.gz
tar xzf jdk.tar.gz --strip-components=1
rm jdk.tar.gz
# Download and extract Kotlin
curl -L "https://github.com/JetBrains/kotlin/releases/download/v1.4.31/kotlin-compiler-1.4.31.zip" -o kotlin.zip
unzip kotlin.zip
rm kotlin.zip
cp -r kotlinc/* .
rm -rf kotlinc

View File

@ -1,6 +0,0 @@
#!/usr/bin/env bash
rename 's/$/\.kt/' "$@" # Add .kt extension
# Compile Kotlin code to a jar file
kotlinc *.kt -include-runtime -d code.jar

View File

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

View File

@ -1,5 +0,0 @@
{
"language": "kotlin",
"version": "1.4.31",
"aliases": ["kt"]
}

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
# Run jar file
shift
java -jar code.jar "$@"

View File

@ -1,3 +0,0 @@
fun main() {
println("OK")
}

View File

@ -1,19 +0,0 @@
#!/usr/bin/env bash
# Put instructions to build your package in here
PREFIX=$(realpath $(dirname $0))
mkdir -p build
cd build
# Prebuilt binary install since source compile requires lisp to be installed already
curl -L "http://prdownloads.sourceforge.net/sbcl/sbcl-2.1.2-x86-64-linux-binary.tar.bz2" -o sbcl.tar.bz2
tar xf sbcl.tar.bz2 --strip-components=1
rm sbcl.tar.bz2
INSTALL_ROOT=$PREFIX sh install.sh
cd ../
rm -rf build

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "lisp",
"version": "2.1.2",
"aliases": ["lisp", "cl", "sbcl", "commonlisp"]
}

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Put instructions to run the runtime
sbcl --script "$@"

View File

@ -1 +0,0 @@
(write-line "OK")

View File

@ -1,18 +0,0 @@
#!/usr/bin/env bash
PREFIX=$(realpath $(dirname $0))
mkdir -p build
cd build
# lolcode release
curl -L "https://github.com/justinmeza/lci/archive/refs/tags/v0.11.2.tar.gz" -o lolcode.tar.gz
tar xzf lolcode.tar.gz --strip-components=1
# Building and installing lolcode
cmake -DCMAKE_INSTALL_PREFIX:STRING="$PREFIX" .
make -j$(nproc)
make install -j$(nproc)
# Cleaning up
cd ../ && rm -rf build

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "lolcode",
"version": "0.11.2",
"aliases": ["lol", "lci"]
}

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Put instructions to run the runtime
lci "$@"

View File

@ -1,4 +0,0 @@
HAI 1.2
CAN HAS STDIO?
VISIBLE "OK"
KTHXBYE

View File

@ -1,14 +0,0 @@
#!/usr/bin/env bash
# Put instructions to build your package in here
curl -R -O -L http://www.lua.org/ftp/lua-5.4.2.tar.gz
tar zxf lua-5.4.2.tar.gz
rm lua-5.4.2.tar.gz
cd lua-5.4.2
# Building Lua
make linux
# To check that Lua has been built correctly
make test
# Installing Lua
make linux install

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH="$PWD/lua-5.4.2/src:$PATH"

View File

@ -1,5 +0,0 @@
{
"language": "lua",
"version": "5.4.2",
"aliases": ["lua"]
}

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Put instructions to run the runtime
lua "$@"

View File

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

View File

@ -1,21 +0,0 @@
#!/usr/bin/env bash
# Put instructions to build your package in here
PREFIX=$(realpath $(dirname $0))
mkdir -p build
cd build
curl -L "https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.gz" -o nasm.tar.gz
tar xzf nasm.tar.gz --strip-components=1
# === autoconf based ===
./configure --prefix "$PREFIX"
make -j$(nproc)
make install -j$(nproc)
cd ../
rm -rf build

View File

@ -1,21 +0,0 @@
#!/usr/bin/env bash
# Put instructions to compile source code, remove this file if the language does not require this stage
case "${PISTON_LANGUAGE}" in
nasm)
nasm -f elf32 -o binary.o "$@"
ld -m elf_i386 binary.o -o binary
;;
nasm64)
nasm -f elf64 -o binary.o "$@"
ld -m elf_x86_64 binary.o -o binary
;;
*)
echo "How did you get here? (${PISTON_LANGUAGE})"
exit 1
;;
esac
chmod +x ./binary

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH

View File

@ -1,14 +0,0 @@
{
"language": "nasm",
"version": "2.15.5",
"provides": [
{
"language": "nasm",
"aliases": ["asm", "nasm32"]
},
{
"language": "nasm64",
"aliases": ["asm64"]
}
]
}

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
# Put instructions to run the runtime
shift
./binary "$@"

View File

@ -1,16 +0,0 @@
SECTION .DATA
good: db 'OK',10
txtlen: equ $-good
SECTION .TEXT
GLOBAL _start
_start:
mov eax,4
mov ebx,1
mov ecx,good
mov edx,txtlen
int 80h
mov eax,1
mov ebx,0
int 80h

View File

@ -1,18 +0,0 @@
SECTION .data
good: db "OK", 0x0
txtlen: equ $ - good
SECTION .text
GLOBAL _start
_start:
;sys_write
mov rax, 1
mov rdi, 1
mov rsi, good
mov rdx, txtlen
syscall
;sys_exit
mov rax, 60
mov rdi, 0
syscall

View File

@ -1,18 +0,0 @@
#!/bin/bash
PREFIX=$(realpath $(dirname $0))
mkdir -p build
cd build
# Prebuilt binary - source *can* be built, but it requires gcc
curl -L "https://nim-lang.org/download/nim-1.4.4-linux_x64.tar.xz" -o nim.tar.xz
tar xf nim.tar.xz --strip-components=1
rm nim.tar.xz
./install.sh "$PREFIX"
cd ../
rm -rf build

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
# Compile nim file(s)
nim --hints:off --out:out --nimcache:./ c "$@"
chmod +x out

View File

@ -1 +0,0 @@
export PATH=$PWD/nim/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "nim",
"version": "1.4.4",
"aliases": ["nim"]
}

View File

@ -1,4 +0,0 @@
#!/bin/bash
shift # Filename is only used to compile
./out "$@"

Some files were not shown because too many files have changed in this diff Show More