2023-07-09 06:08:43 +03:00
|
|
|
# This file is a part of the UMSKT Project
|
|
|
|
#
|
2024-01-05 02:32:18 +02:00
|
|
|
# Copyleft (C) 2019-2024 UMSKT Contributors (et.al.)
|
2023-07-09 06:08:43 +03:00
|
|
|
#
|
|
|
|
# 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 <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
# @FileCreated by Neo on 06/19/2023
|
|
|
|
# @Maintainer Neo
|
|
|
|
|
|
|
|
# Stage 1: Install Prerequisites
|
2024-02-22 03:37:02 +02:00
|
|
|
FROM ubuntu:latest as prerequisites
|
2023-07-09 06:08:43 +03:00
|
|
|
|
|
|
|
# Stage 1: Install build dependencies
|
2024-02-22 03:37:02 +02:00
|
|
|
RUN apt-get update && apt-get -y install \
|
|
|
|
build-essential \
|
|
|
|
cmake \
|
|
|
|
wget \
|
|
|
|
7zip \
|
|
|
|
git \
|
|
|
|
flex \
|
|
|
|
libfl-dev \
|
|
|
|
nasm \
|
|
|
|
libslang2-dev \
|
|
|
|
pkg-config \
|
|
|
|
libslang2-modules \
|
|
|
|
gcc-multilib \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2023-07-09 06:08:43 +03:00
|
|
|
|
2024-02-22 03:37:02 +02:00
|
|
|
FROM prerequisites as djgpp
|
2024-02-17 18:07:37 +02:00
|
|
|
SHELL ["/bin/bash", "-c"]
|
2023-07-09 06:08:43 +03:00
|
|
|
|
2024-02-17 18:07:37 +02:00
|
|
|
WORKDIR /
|
2023-07-09 06:08:43 +03:00
|
|
|
|
2024-02-22 03:37:02 +02:00
|
|
|
ENV CC=/djgpp/bin/i586-pc-msdosdjgpp-gcc CXX=/djgpp/bin/i586-pc-msdosdjgpp-g++ CMAKE_FIND_ROOT_PATH=/djgpp
|
2023-07-09 06:08:43 +03:00
|
|
|
|
2024-02-22 03:37:02 +02:00
|
|
|
# Stage 2: setup djgpp
|
2024-02-17 18:07:37 +02:00
|
|
|
RUN wget https://github.com/andrewwutw/build-djgpp/releases/download/v3.4/djgpp-linux64-gcc1220.tar.bz2 \
|
|
|
|
&& tar xjf djgpp-linux64-gcc1220.tar.bz2 \
|
2024-02-22 03:37:02 +02:00
|
|
|
&& rm -rf djgpp-linux64-gcc1220.tar.bz2
|
2023-07-09 06:08:43 +03:00
|
|
|
|
2024-02-17 18:07:37 +02:00
|
|
|
# Stage 3: compile UMSKT
|
2024-02-22 03:37:02 +02:00
|
|
|
FROM djgpp as build
|
2024-02-17 18:07:37 +02:00
|
|
|
SHELL ["/bin/bash", "-c"]
|
2023-07-09 06:08:43 +03:00
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
COPY . /src
|
|
|
|
|
|
|
|
# Build UMSKT from the local directory
|
|
|
|
RUN mkdir /src/build \
|
|
|
|
&& source /djgpp/setenv \
|
2024-02-22 03:37:02 +02:00
|
|
|
&& cmake -DUMSKT_DJGPP_COMPILE=On -DCMAKE_BUILD_TYPE=Release -DCPM_SOURCE_CACHE=`pwd`/.cpm-cache -B build \
|
|
|
|
&& cmake --build build -j 10 --verbose
|
2023-07-09 06:08:43 +03:00
|
|
|
|
|
|
|
CMD ["bash"]
|
|
|
|
|
|
|
|
# Stage 6: Output
|
|
|
|
FROM scratch as output
|
|
|
|
|
2024-02-22 03:37:02 +02:00
|
|
|
COPY --from=build /src/build/umskt.exe /
|
2023-07-09 06:08:43 +03:00
|
|
|
|
|
|
|
# invoke via
|
2024-02-17 18:07:37 +02:00
|
|
|
# docker build -f Dockerfile.djgpp -o type=tar,dest=build-djgpp/umskt-dos.tar .
|