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-17 18:07:37 +02:00
|
|
|
#FROM ubuntu:latest as prerequisites
|
2023-07-09 06:08:43 +03:00
|
|
|
|
|
|
|
# Stage 1: Install build dependencies
|
2024-02-17 18:07:37 +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-17 18:07:37 +02:00
|
|
|
FROM djgpp-prerequisites:latest as djgpp-watt32
|
|
|
|
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-17 18:07:37 +02:00
|
|
|
ENV CC=/djgpp/bin/i586-pc-msdosdjgpp-gcc CXX=/djgpp/bin/i586-pc-msdosdjgpp-g++ CMAKE_FIND_ROOT_PATH=/djgpp WATT_ROOT=/djgpp/watt32
|
2023-07-09 06:08:43 +03:00
|
|
|
|
2024-02-17 18:07:37 +02:00
|
|
|
# Stage 2: compile WATT32 for D
|
|
|
|
RUN wget https://github.com/andrewwutw/build-djgpp/releases/download/v3.4/djgpp-linux64-gcc1220.tar.bz2 \
|
|
|
|
&& tar xjf djgpp-linux64-gcc1220.tar.bz2 \
|
|
|
|
&& rm -rf djgpp-linux64-gcc1220.tar.bz2 \
|
|
|
|
&& cd djgpp \
|
|
|
|
&& git clone https://github.com/UMSKT/Watt-32.git watt32 \
|
2023-07-09 06:08:43 +03:00
|
|
|
&& cd watt32/util \
|
|
|
|
&& make clean && make linux \
|
|
|
|
&& cd ../src \
|
|
|
|
&& source /djgpp/setenv \
|
|
|
|
&& ./configur.sh djgpp \
|
|
|
|
&& make -f djgpp.mak \
|
2024-02-17 18:07:37 +02:00
|
|
|
&& ln -s ${WATT_ROOT}/lib/libwatt.a ${CMAKE_FIND_ROOT_PATH}/lib
|
2023-07-09 06:08:43 +03:00
|
|
|
|
2024-02-17 18:07:37 +02:00
|
|
|
# Stage 3: compile UMSKT
|
|
|
|
FROM djgpp-watt32 as build
|
|
|
|
SHELL ["/bin/bash", "-c"]
|
2023-07-09 06:08:43 +03:00
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
COPY . /src
|
|
|
|
|
2024-02-17 18:07:37 +02:00
|
|
|
ENV PKG_CONFIG_PATH=/djgpp/lib/pkgconfig VERBOSE=1
|
2023-07-09 06:08:43 +03:00
|
|
|
# Build UMSKT from the local directory
|
|
|
|
RUN mkdir /src/build \
|
|
|
|
&& cd /src/build \
|
|
|
|
&& source /djgpp/setenv \
|
|
|
|
&& cmake -DDJGPP_WATT32=${WATT_ROOT}/lib/libwatt.a .. \
|
|
|
|
&& make
|
|
|
|
|
|
|
|
CMD ["bash"]
|
|
|
|
|
|
|
|
# Stage 6: Output
|
|
|
|
FROM scratch as output
|
|
|
|
|
|
|
|
COPY --from=build /src/build/umskt.exe /umskt.exe
|
|
|
|
|
|
|
|
# invoke via
|
2024-02-17 18:07:37 +02:00
|
|
|
# docker build -f Dockerfile.djgpp -o type=tar,dest=build-djgpp/umskt-dos.tar .
|