forked from kanaka/mal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build Io interpreter and packages from source in latest Ubuntu. The interpreter looks for packages under `eerie` in the current directory, so create the symlink in the Makefile that is "building" each step. Now the Regex package no longer prints a message when loaded, so no need for the special treatment in `run`.
- Loading branch information
Showing
3 changed files
with
44 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM ubuntu:xenial | ||
FROM ubuntu:24.04 AS base | ||
MAINTAINER Joel Martin <[email protected]> | ||
|
||
########################################################## | ||
|
@@ -9,25 +9,49 @@ MAINTAINER Joel Martin <[email protected]> | |
RUN apt-get -y update | ||
|
||
# Required for running tests | ||
RUN apt-get -y install make python | ||
RUN apt-get -y install make python3 | ||
RUN ln -fs /usr/bin/python3 /usr/local/bin/python | ||
|
||
# Some typical implementation and test requirements | ||
RUN apt-get -y install curl libreadline-dev libedit-dev | ||
|
||
RUN apt-get -y install libpcre3-dev | ||
|
||
RUN mkdir -p /mal | ||
WORKDIR /mal | ||
|
||
########################################################## | ||
# Compile the io interpreter | ||
########################################################## | ||
|
||
FROM base AS builder | ||
|
||
RUN apt-get -y install git cmake gcc | ||
|
||
RUN cd /tmp \ | ||
&& git clone --recursive -q --depth=1 https://github.com/IoLanguage/io.git \ | ||
&& cd /tmp/io \ | ||
&& mkdir build && cd build \ | ||
&& cmake -DCMAKE_BUILD_TYPE=release .. && make && make install | ||
|
||
# Force eerie (Io package manager) to install itself and the packages in /opt/.eerie | ||
ENV HOME=/opt | ||
|
||
RUN cd /tmp/io/eerie \ | ||
&& mkdir -p /opt \ | ||
&& . ./install_unix.sh --notouch \ | ||
&& eerie install https://github.com/IoLanguage/Range.git \ | ||
&& eerie install https://github.com/IoLanguage/ReadLine.git \ | ||
&& eerie install https://github.com/IoLanguage/Regex.git | ||
|
||
########################################################## | ||
# Specific implementation requirements | ||
########################################################## | ||
|
||
# Zip | ||
RUN apt-get -y install unzip | ||
FROM base AS io | ||
|
||
RUN cd /tmp && curl -O -J -L http://iobin.suspended-chord.info/linux/iobin-linux-x64-deb-current.zip \ | ||
&& unzip iobin-linux-x64-deb-current.zip IoLanguage-2013.11.04-Linux-x64.deb \ | ||
&& dpkg -i IoLanguage-2013.11.04-Linux-x64.deb \ | ||
&& ldconfig \ | ||
&& rm -f iobin-linux-x64-deb-current.zip IoLanguage-2013.11.04-Linux-x64.deb | ||
COPY --from=builder /usr/local/lib/ /usr/lib/ | ||
COPY --from=builder /usr/local/bin/ /usr/bin/ | ||
COPY --from=builder /opt/.eerie/ /opt/.eerie/ | ||
|
||
ENV HOME /mal | ||
ENV HOME=/mal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
all: | ||
@true | ||
STEPS = step0_repl.io step1_read_print.io step2_eval.io step3_env.io step4_if_fn_do.io step5_tco.io \ | ||
step6_file.io step7_quote.io step8_macros.io step9_try.io stepA_mal.io | ||
|
||
all: eerie | ||
|
||
eerie: | ||
ln -s /opt/.eerie eerie | ||
|
||
$(STEPS): eerie | ||
|
||
clean: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
#!/bin/bash | ||
|
||
# Io prints the line "Registering Regex: Regex" when loading the Regex module | ||
# for the first time, and there's no way to suppress it. To avoid polluting | ||
# the Mal script output, we swallow the first 25 bytes. | ||
io $(dirname $0)/${STEP:-stepA_mal}.io "$@" | (read -N 25 -t 10 ; cat) | ||
io $(dirname $0)/${STEP:-stepA_mal}.io "$@" |