Dockerfile fixes. Pass the arguments in linux interpreter scripts.

This commit is contained in:
retropikzel 2025-09-05 10:01:26 +03:00
parent 4e818b2739
commit b6bd1451aa
3 changed files with 28 additions and 32 deletions

View File

@ -9,16 +9,16 @@ RUN apt-get update && apt-get install -y \
pandoc \
chicken-bin \
libc-dev
RUN mkdir -p /opt/compile-r7rs
RUN mkdir -p /opt/compile-r7rs/bin
RUN mkdir -p /opt/compile-r7rs/lib
RUN chicken-install r7rs
WORKDIR /builddir
COPY Makefile .
COPY compile-r7rs.scm .
COPY libs/ libs/
WORKDIR /build
RUN git clone https://github.com/ashinn/chibi-scheme.git --depth=1
RUN cd chibi-scheme && make -j 32 && make -j 32 install
ENV SCHEME=chicken
RUN snow-chibi --impls=${SCHEME} --always-yes install "(foreign c)"
RUN snow-chibi --impls=${SCHEME} --always-yes install "(srfi 170)"
COPY Makefile .
COPY compile-r7rs.scm .
COPY libs libs
RUN make PREFIX=/opt/compile-r7rs build-chicken-static && make PREFIX=/opt/compile-r7rs install
FROM debian:trixie-slim

View File

@ -9,18 +9,11 @@ endif
all: build
container:
docker build -f Dockerfile.test --tag=compile-r7rs
build: deps
build:
echo "#!/bin/sh" > compile-r7rs
echo "chibi-scheme -A ${PREFIX}/lib/compile-r7rs ${PREFIX}/lib/compile-r7rs/main.scm \"\$$@\"" >> compile-r7rs
build-chicken-static: deps
csc -R r7rs -X r7rs -I snow/foreign/c -static -c -J -unit foreign.c -o foreign.c.o deps/foreign-c/foreign/c.sld
ar rcs foreign.c.a foreign.c.o
csc -R r7rs -X r7rs -static -c -J -unit srfi-170 -o srfi-170.o deps/foreign-c-srfi-170/srfi/170.sld
ar rcs srfi-170.a srfi-170.o
build-chicken-static:
csc -R r7rs -X r7rs -static -c -J -unit libs.util -o libs.util.o libs/util.sld
ar rcs libs.util.a libs.util.o
csc -R r7rs -X r7rs -static -c -J -unit libs.library-util -o libs.library-util.o libs/library-util.sld
@ -42,8 +35,7 @@ deps:
git clone https://git.sr.ht/~retropikzel/foreign-c-srfi-170 deps/foreign-c-srfi-170 --depth=1
install:
cd deps/foreign-c && make all install
cd deps/foreign-c-srfi-170 && make all install
mkdir -p ${PREFIX}/bin
mkdir -p ${PREFIX}/lib/compile-r7rs
cp -r libs ${PREFIX}/lib/compile-r7rs/
cp compile-r7rs.scm ${PREFIX}/lib/compile-r7rs/main.scm

View File

@ -196,8 +196,7 @@
prepend-directories
append-directories
library-files
r6rs?))
(string #\newline)))
r6rs?))))
(define scheme-library-command
(lambda (library-file)
@ -264,18 +263,23 @@
(display scheme-command)
(newline)
(with-output-to-file
(if (string=? compilation-target "windows")
(string-append output-file ".bat")
output-file)
(lambda ()
(cond ((string=? compilation-target "unix")
(display "#!/bin/sh")
(newline))
((string=? compilation-target "windows")
(display "@echo off")
(newline)
(display "start")))
(display scheme-command)))
(if (string=? compilation-target "windows")
(string-append output-file ".bat")
output-file)
(lambda ()
(cond ((string=? compilation-target "unix")
(display "#!/bin/sh")
(newline))
((string=? compilation-target "windows")
(display "@echo off")
(newline)
(display "start")))
(display scheme-command)
(cond ((string=? compilation-target "unix")
(display " \"")
(display "$@")
(display "\"")))
(newline)))
(cond ((string=? compilation-target "unix")
(c-system (string->c-utf8 (string-append "chmod +x " output-file))))))