Compare commits

...

3 Commits

Author SHA1 Message Date
retropikzel e124bc16c0 Add docker utilities 2026-02-07 14:06:01 +02:00
retropikzel 2c3fbcab55 Updated readme 2026-02-07 11:00:24 +02:00
retropikzel d4e05b61cc Add supported implementations list into readme 2026-02-07 10:44:36 +02:00
2 changed files with 117 additions and 21 deletions

View File

@ -10,6 +10,10 @@ Tool to create Scheme virtual environments
scheme-venv chibi r7rs venv scheme-venv chibi r7rs venv
Note that scheme-venv does not install snow-chibi, akku or any Scheme
implementations. You have to install them yourself into your system.
### bin/activate
First argument is Scheme, second is RnRS and third is path to directory. The First argument is Scheme, second is RnRS and third is path to directory. The
directory must not exist. directory must not exist.
@ -20,33 +24,78 @@ After the virtual environment is created you can activate is with:
After activation you can install packages with either snow-chibi or akku and After activation you can install packages with either snow-chibi or akku and
they will be installed inside the virtual environment. To run your Scheme code they will be installed inside the virtual environment.
use either scheme-script or scheme-compile, executables.
### bin/snow-chibi
R6RS: Install R7RS package from [snow-fort.org](https://snow-fort.org).
akku install chez-srfi ### bin/akku
scheme-script main.sps
scheme-compile main.sps
./main
R7RS: Install R6RS package from [akkuscm.org](https://akkuscm.org).
snow-chibi install srfi.64 ### bin/scheme-script
scheme-script main.scm
scheme-compile main.scm
./main
Run Scheme script.
## Implementation specific notes ### bin/scheme-compile
### Chicken Compile Scheme code to executable.
- Before compilation the directory is changed to be venv/lib so libraries will be found ### bin/docker-build
- venv/include
Build docker venvs docker image. Run this before docker-run or docker-repl.
### bin/docker-run
Run command inside venv inside docker.
### bin/docker-repl
Run scheme repl inside venv inside docker.
## Supported impelmentations and notes
### R6RS
- Capyscheme
- Chezscheme
- Guile
- Ikarus
- Ironscheme
- Larceny
- Loko
- Mosh
- Racket
- Sagittarius
- Ypsilon
### R7RS
- Capyscheme
- Chibi
- Chicken
- Before compilation the directory is changed to be venv/lib so libraries will be found
- venv/include
- added into include paths - added into include paths
- venv/lib - venv/lib
- added into library paths - added into library paths
- venv/scheme-compile - venv/scheme-compile
- Environment variable VENV\_CSC\_ARGS is added to csc arguments - Environment variable VENV\_CSC\_ARGS is added to csc arguments
- Cyclone
- Foment
- Gambit
- Gauche
- Guile
- Kawa
- Larceny
- Loko
- Meevax
- MIT-Scheme
- Mosh
- Racket
- Sagittarius
- Skint
- STklos
- tr7
- Ypsilon

View File

@ -380,4 +380,51 @@ EOF
} > "${venvpath}/bin/scheme-venv-info" } > "${venvpath}/bin/scheme-venv-info"
chmod +x "${venvpath}/bin/scheme-venv-info" chmod +x "${venvpath}/bin/scheme-venv-info"
## /bin/Dockerfile
{
cat << EOF
FROM docker.io/schemers/${implementation}:head
RUN apt-get update && apt-get install -y git make ca-certificates wget xz-utils gcc
WORKDIR /build
RUN git clone https://codeberg.org/retropikzel/scheme-venv.git --depth=1
RUN git clone https://github.com/ashinn/chibi-scheme.git --depth=1
RUN wget https://gitlab.com/-/project/6808260/uploads/094ce726ce3c6cf8c14560f1e31aaea0/akku-1.1.0.amd64-linux.tar.xz && tar -xf akku-1.1.0.amd64-linux.tar.xz && mv akku-1.1.0.amd64-linux akku
WORKDIR /build/chibi-scheme
RUN make
RUN make install
WORKDIR /build/akku
RUN bash install.sh
ENV PATH=/root/.local/bin:\${PATH}
ENV PATH=${venvpath}/bin:\${PATH}
WORKDIR ${venvpath}
EOF
} > "${venvpath}/etc/Dockerfile"
## /bin/docker-build
{
cat << EOF
#!/bin/sh
docker build -f ${venvpath}/etc/Dockerfile --tag ${venvname}-${implementation}-${rnrs}-docker-img ${venvpath}
EOF
} > "${venvpath}/bin/docker-build"
chmod +x "${venvpath}/bin/docker-build"
## /bin/docker-run
{
cat << EOF
#!/bin/sh
docker run -v "${venvpath}:${venvpath}" -w "${venvpath}" ${venvname}-${implementation}-${rnrs}-docker-img "\$@"
EOF
} > "${venvpath}/bin/docker-run"
chmod +x "${venvpath}/bin/docker-run"
## /bin/docker-repl
{
cat << EOF
#!/bin/sh
docker run -it -v "${venvpath}:${venvpath}" -w "${venvpath}" ${venvname}-${implementation}-${rnrs}-docker-img scheme-repl
EOF
} > "${venvpath}/bin/docker-repl"
chmod +x "${venvpath}/bin/docker-repl"
echo "Initialized scheme-venv ${venvpath}, with ${implementation} and ${rnrs}" echo "Initialized scheme-venv ${venvpath}, with ${implementation} and ${rnrs}"