Skip to content

Instantly share code, notes, and snippets.

@rene-d
Last active June 4, 2022 23:33
Show Gist options
  • Save rene-d/25d2528eeb091432f95bdb8205bea1b0 to your computer and use it in GitHub Desktop.
Save rene-d/25d2528eeb091432f95bdb8205bea1b0 to your computer and use it in GitHub Desktop.
FROM alpine:edge AS toilet-builder
RUN apk update && apk add gcc musl-dev make curl unzip findutils fdupes
WORKDIR /build
# figlet
RUN curl -skL -o figlet-master.zip https://github.com/cmatsuoka/figlet/archive/refs/heads/master.zip && \
unzip -q -o figlet-master.zip && \
cd figlet-master && \
make LDFLGAGS=-static -j install
# toilet
RUN apk add pkgconfig g++ zlib-dev zlib-static
RUN curl -skL https://github.com/cacalabs/libcaca/releases/download/v0.99.beta20/libcaca-0.99.beta20.tar.gz | tar -xz && \
cd libcaca-0.99.beta20 && \
./configure --prefix=/usr/local --enable-static --disable-shared && \
make -j && \
make install && \
# fix zlib imports when statically linking
sed -i 's/^\(Libs:.*\)/\1 -lz/;s/^\(Libs.private:\).*$/\1/' /usr/local/lib/pkgconfig/caca.pc
RUN curl -skl http://caca.zoy.org/raw-attachment/wiki/toilet/toilet-0.3.tar.gz | tar -xz && \
cd toilet-0.3 && \
./configure --prefix=/usr/local && \
make LDFLAGS=-static -j install
# fonts
RUN curl -skL -o figlet-fonts-master.zip https://github.com/xero/figlet-fonts/archive/refs/heads/master.zip && \
unzip -q -o -d /usr/local/share/figlet/ -j figlet-fonts-master.zip && \
chmod 644 /usr/local/share/figlet/* && \
fdupes -i -N -q -d /usr/local/share/figlet
# find /usr/local/share/figlet/ -name '*.?lf' -printf '%P\n' | while read a; do a=$(basename "$a" .flf); a=$(basename "$a" .tlf); echo; echo "$a :"; figlet -w120 -f "$a" "$a"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment