Skip to content

Commit

Permalink
Update Dockerfile for logo
Browse files Browse the repository at this point in the history
Debian/Ubuntu do not ship a python->python2 link by default.

With the improved logo implementation in another branch, there is no
need anymore to tweat the garbage collector settings.
  • Loading branch information
asarhaddon committed Jan 9, 2022
1 parent 5112c9c commit 2dd7f91
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
37 changes: 15 additions & 22 deletions impls/logo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ MAINTAINER Joel Martin <[email protected]>
RUN apt-get -y update

# Required for running tests
RUN apt-get -y install make python

# Some typical implementation and test requirements
RUN apt-get -y install curl libreadline-dev libedit-dev
RUN apt-get -y install make python2
RUN ln -s /usr/bin/python2 /usr/local/bin/python

RUN mkdir -p /mal
WORKDIR /mal
Expand All @@ -21,29 +19,24 @@ WORKDIR /mal
# Specific implementation requirements
##########################################################

# Install g++ for any C/C++ based implementations
RUN apt-get -y install g++

# Install UCBLogo 6.0:
# * Fix the makefile to build correctly
# * Tweat GC settings to improve performance (it's still very slow)
# Rebuild ucblogo.
# * without X libraries so that the executable starts in text mode.
# * Add the timems function implemented in C
RUN apt-get -y install libx11-dev \
&& cd /tmp \
&& curl -O -J -L http://www.cs.berkeley.edu/~bh/downloads/ucblogo.tar.gz \
&& tar xf ucblogo.tar.gz \
&& cd /tmp/ucblogo-6.0 \
&& rm -rf csls/CVS \
&& ./configure \
&& sed -i -e 's/svnversion/echo 206/' -e 's/^\s*(cd docs/#\0/' makefile \
&& echo "all: everything" >> makefile \
&& sed -i -e 's/^#define *SEG_SIZE *16000 /#define SEG_SIZE 6400000 /' logo.h \
&& sed -i -e 's/^#define GCMAX 16000$/#define GCMAX 16000000/' mem.c \

This comment has been minimized.

Copy link
@dubek

dubek Jan 9, 2022

Collaborator

The fixes for SEG_SIZE and GCMAX are not needed any more?


RUN echo 'deb-src http://deb.debian.org/debian stable main' > /etc/apt/sources.list.d/logo.list

This comment has been minimized.

Copy link
@dubek

dubek Jan 9, 2022

Collaborator

If we need to modify things in the code (for example, add ltimems()) -- isn't it easier to download the source from https://github.com/jrincayc/ucblogo-code/releases instead of modify apt sources and so on?

The tar packages come with configure, so we probably don't need to install autoconf/automake .

RUN apt -y update
RUN apt -y install autoconf autoconf-archive automake dpkg-dev g++ libncurses-dev

RUN cd /tmp \
&& apt source ucblogo \
&& cd /tmp/ucblogo-* \
&& autoreconf -f -i \
&& ./configure --disable-docs --disable-x11 \
&& echo "extern NODE *ltimems(NODE *);" >> globals.h \
&& echo "NODE *ltimems(NODE *args) { struct timeval tv; gettimeofday(&tv, NULL); return(make_floatnode(((FLONUM)tv.tv_sec) * 1000.0 + (tv.tv_usec / 1000))); }" >> coms.c \
&& sed -i -e 's/^\(.*lthrow.*\)$/\1 {"timems", 0, 0, 0, PREFIX_PRIORITY, ltimems},/' init.c \
&& make install \
&& cd /tmp \
&& rm -rf /tmp/ucblogo.tar.gz /tmp/ucblogo-6.0
&& rm -rf /tmp/ucblogo*

ENV HOME /mal
2 changes: 1 addition & 1 deletion impls/logo/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
exec logo $(dirname $0)/${STEP:-stepA_mal}.lg - "${@}"
exec ucblogo $(dirname $0)/${STEP:-stepA_mal}.lg - "${@}"

0 comments on commit 2dd7f91

Please sign in to comment.