# This file is a part of the UMSKT Project # # Copyleft (C) 2019-2023 UMSKT Contributors (et.al.) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # # @FileCreated by Neo on 06/19/2023 # @Maintainer Neo # Stage 1: Install Prerequisites FROM alpine:latest as prerequisites # Stage 1: Install build dependencies RUN apk add --no-cache \ autoconf \ automake \ bash \ bison \ build-base \ clang \ cmake \ coreutils \ curl \ elfutils-dev \ findutils \ git \ gawk \ flex \ libelf \ libslirp-dev \ linux-headers \ nasm \ sed \ slang-dev \ texinfo \ unzip \ zlib-dev FROM prerequisites as djgpp WORKDIR /tmp # Stage 2: compile djgpp for muslc ENV DJGPP_PREFIX=/djgpp BUILD_VER=12.2.0-i386 RUN git clone https://github.com/andrewwutw/build-djgpp.git djgpp \ && cd djgpp \ && cd script \ && wget https://gist.github.com/Neo-Desktop/4cfd708f61f5847a7bf457d38db3b59f/raw/25d24cf509b0fc486d5d18ecb6656f120c3d0e51/12.2.0-i386 -O 12.2.0-i386 \ && chmod +x 12.2.0-i386 \ && cd ../patch \ && wget https://gist.github.com/Neo-Desktop/4cfd708f61f5847a7bf457d38db3b59f/raw/25d24cf509b0fc486d5d18ecb6656f120c3d0e51/patch-alpine-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch -O patch-alpine-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch \ && cd .. \ && sed -i 's/i586/i386/g' setenv/setenv \ && sed -i 's/i586/i386/g' setenv/setenv.bat \ && ./build-djgpp.sh $BUILD_VER \ && rm -rf /tmp/djgpp # Stage 3: compile UMSKT FROM djgpp as build WORKDIR /src COPY . /src ENV CC=/djgpp/bin/i386-pc-msdosdjgpp-gcc CXX=/djgpp/bin/i386-pc-msdosdjgpp-g++ VERBOSE=1 SHELL ["/bin/bash", "-c"] RUN mkdir /src/build \ && cd /src/build \ && source /djgpp/setenv \ && cmake -DDJGPP=ON .. \ && make CMD ["bash"] # Stage 4: Output FROM scratch as output COPY --from=build /src/build/umskt.exe /umskt.exe # invoke via # docker build -f Dockerfile.djgpp -o type=tar,dest=umskt-dos.tar .