Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM buildpack-deps:buster AS isolate
FROM buildpack-deps:trixie AS isolate
RUN apt-get update && \
apt-get install -y --no-install-recommends git libcap-dev && \
rm -rf /var/lib/apt/lists/* && \
Expand All @@ -8,18 +8,18 @@ RUN apt-get update && \
make -j$(nproc) install && \
rm -rf /tmp/*

FROM node:15.10.0-buster-slim
FROM node:26.11.1-trixie-slim

ENV DEBIAN_FRONTEND=noninteractive

RUN dpkg-reconfigure -p critical dash
RUN apt-get update && \
apt-get install -y libxml2 gnupg tar coreutils util-linux libc6-dev \
binutils build-essential locales libpcre3-dev libevent-dev libgmp3-dev \
libncurses6 libncurses5 libedit-dev libseccomp-dev rename procps python3 \
libreadline-dev libblas-dev liblapack-dev libpcre3-dev libarpack2-dev \
libfftw3-dev libglpk-dev libqhull-dev libqrupdate-dev libsuitesparse-dev \
libsundials-dev libpcre2-dev libcap-dev && \
binutils build-essential locales libpcre2-dev libevent-dev libgmp-dev \
libncurses6 libedit-dev libseccomp-dev rename procps python3 \
libreadline-dev libblas-dev liblapack-dev libarpack2-dev libfftw3-dev \
libglpk-dev libqhull-dev libqrupdate-dev libsuitesparse-dev \
libsundials-dev libcap-dev && \
rm -rf /var/lib/apt/lists/*
RUN useradd -M piston
COPY --from=isolate /usr/local/bin/isolate /usr/local/bin
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ services:
repo: # Local testing of packages
build: repo
container_name: piston_repo
command: ['--no-build'] # Don't build anything
command: [] # Don't build anything
volumes:
- .:/piston
26 changes: 26 additions & 0 deletions packages/gcc/16.2.0/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/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-16.2.0/gcc-16.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

29 changes: 29 additions & 0 deletions packages/gcc/16.2.0/compile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/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
5 changes: 5 additions & 0 deletions packages/gcc/16.2.0/environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/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
22 changes: 22 additions & 0 deletions packages/gcc/16.2.0/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"language": "gcc",
"version": "16.2.0",
"provides": [
{
"language": "c",
"aliases": ["gcc"]
},
{
"language": "c++",
"aliases": ["cpp", "g++"]
},
{
"language": "d",
"aliases": ["gdc"]
},
{
"language": "fortran",
"aliases": ["fortran", "f90"]
}
]
}
6 changes: 6 additions & 0 deletions packages/gcc/16.2.0/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# Put instructions to run the runtime

shift # Discard main filename
./a.out "$@"
6 changes: 6 additions & 0 deletions packages/gcc/16.2.0/test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <stdio.h>

int main(void) {
printf("OK");
return 0;
}
6 changes: 6 additions & 0 deletions packages/gcc/16.2.0/test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <iostream>

int main(void) {
printf("OK");
return 0;
}
5 changes: 5 additions & 0 deletions packages/gcc/16.2.0/test.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import std.stdio;

void main() {
writeln("OK");
}
3 changes: 3 additions & 0 deletions packages/gcc/16.2.0/test.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
program test
print "(a)", 'OK'
end program test
1 change: 0 additions & 1 deletion packages/go/1.16.2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
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

5 changes: 5 additions & 0 deletions packages/go/1.27.2/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

curl -LO https://go.dev/dl/go1.27.2.linux-amd64.tar.gz
tar -xzf go1.27.2.linux-amd64.tar.gz
rm go1.27.2.linux-amd64.tar.gz
2 changes: 2 additions & 0 deletions packages/go/1.27.2/environment
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export PATH=$PWD/go/bin:$PATH
export GOPATH=$PWD/gopath
5 changes: 5 additions & 0 deletions packages/go/1.27.2/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"language": "go",
"version": "1.27.2",
"aliases": ["go", "golang"]
}
7 changes: 7 additions & 0 deletions packages/go/1.27.2/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

mv $1 $1.go
#filename=$1.go
filename=*.go
shift
GOCACHE=$PWD go run $filename "$@"
7 changes: 7 additions & 0 deletions packages/go/1.27.2/test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "fmt"

func main() {
fmt.Println("OK")
}
21 changes: 21 additions & 0 deletions packages/python/3.15.0/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

PREFIX=$(realpath $(dirname $0))

mkdir -p build

cd build

curl "https://www.python.org/ftp/python/3.15.0/Python-3.15.0.tgz" -o python.tar.gz
tar xzf python.tar.gz --strip-components=1
rm python.tar.gz

./configure --prefix "$PREFIX" --with-ensurepip=install
make -j$(nproc)
make install -j$(nproc)

cd ..

rm -rf build

bin/pip3 install numpy scipy pandas pycryptodome whoosh bcrypt passlib sympy xxhash base58 cryptography PyNaCl
1 change: 1 addition & 0 deletions packages/python/3.15.0/environment
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export PATH=$PWD/bin:$PATH
5 changes: 5 additions & 0 deletions packages/python/3.15.0/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"language": "python",
"version": "3.15.0",
"aliases": ["py", "py3", "python3", "python3.12"]
}
3 changes: 3 additions & 0 deletions packages/python/3.15.0/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

python3.15 "$@"
7 changes: 7 additions & 0 deletions packages/python/3.15.0/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
working = True

match working:
case True:
print("OK")
case False:
print()
19 changes: 9 additions & 10 deletions repo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
FROM debian:buster-slim
FROM debian:trixie-slim
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y unzip autoconf build-essential libssl-dev \
pkg-config zlib1g-dev libargon2-dev libsodium-dev libcurl4-openssl-dev \
sqlite3 libsqlite3-dev libonig-dev libxml2 libxml2-dev bc curl git \
linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq zlib1g-dev \
cmake cmake-doc extra-cmake-modules build-essential gcc binutils bash coreutils \
util-linux pciutils usbutils coreutils binutils findutils grep libncurses5-dev \
libncursesw5-dev python3-pip libgmp-dev libmpfr-dev python2 libffi-dev gfortran\
libreadline-dev libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libfftw3-dev \
libglpk-dev libqhull-dev libqrupdate-dev libsuitesparse-dev libsundials-dev \
libbz2-dev liblzma-dev libpcre2-dev gperf bison flex g++ gawk zip && \
linux-headers-amd64 perl xz-utils python3 python3-pip gnupg jq \
cmake cmake-doc extra-cmake-modules gcc binutils bash coreutils \
util-linux pciutils usbutils findutils grep libncurses-dev \
libgmp-dev libmpfr-dev libffi-dev gfortran libreadline-dev libblas-dev \
liblapack-dev libpcre2-dev libarpack2-dev libfftw3-dev \
libglpk-dev libqhull-dev libqrupdate-dev libsuitesparse-dev \
libsundials-dev libbz2-dev liblzma-dev gperf bison flex g++ gawk zip && \
ln -sf /bin/bash /bin/sh && \
rm -rf /var/lib/apt/lists/* && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2
rm -rf /var/lib/apt/lists/*

ADD entrypoint.sh mkindex.sh serve.py /

Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
# nativeBuildInputs is usually what you want -- tools you need to run
nativeBuildInputs = with pkgs; [ nodejs-15_x jq mkdocs ];
nativeBuildInputs = with pkgs; [ nodejs-slim_26 jq mkdocs ];
}