iosevka-build/Dockerfile

56 lines
1.7 KiB
Docker

# syntax=docker/dockerfile:labs
FROM public.ecr.aws/lts/ubuntu:latest as preinstall
RUN apt-get update && apt-get install -y curl python3-minimal
FROM preinstall as base
ARG ARCH
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y build-essential curl git
FROM base as builder
ARG ARCH
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get install -y unzip uuid-dev
# otfcc depends on premake5
WORKDIR /tmp
ARG PREMAKE_VERSION=5.0.0-beta2
RUN curl -O -sL https://github.com/premake/premake-core/releases/download/v${PREMAKE_VERSION}/premake-${PREMAKE_VERSION}-src.zip && unzip premake-${PREMAKE_VERSION}-src.zip
RUN cd premake-${PREMAKE_VERSION}-src/build/gmake2.unix && make config=release
RUN mv /tmp/premake-${PREMAKE_VERSION}-src/bin/release/premake5 /usr/local/bin/premake5
# otfcc
WORKDIR /tmp
ARG OTFCC_VERSION=0.10.4
RUN curl -sL https://github.com/caryll/otfcc/archive/v${OTFCC_VERSION}.tar.gz | tar -xzC /tmp
RUN mv otfcc-${OTFCC_VERSION} otfcc
WORKDIR /tmp/otfcc
COPY p0.patch /tmp/otfcc/p0.patch
RUN patch -u premake5.lua p0.patch
ENV ARCH=${ARCH}
RUN premake5 gmake && \
cd build/gmake && \
make config=release_"${ARCH}" all
FROM base
ARG ARCH
ARG DEBIAN_FRONTEND=noninteractive
RUN curl -sL https://deb.nodesource.com/setup_current.x | bash -
RUN apt-get update && apt-get install -y nodejs ttfautohint magic-wormhole zstd --no-install-recommends
RUN npm i -g pnpm
WORKDIR /
ADD ./private-build-plans.toml /
ADD build.sh /
COPY --from=builder /tmp/otfcc/bin/release-${ARCH}/otfccbuild /usr/local/bin/otfccbuild
COPY --from=builder /tmp/otfcc/bin/release-${ARCH}/otfccdump /usr/local/bin/otfccdump
RUN chmod u+x /build.sh
CMD ["/build.sh"]