-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
94 lines (77 loc) · 2.81 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# We require a 64-bit distro to use ps2toolchain. However, wine refuses to support both 64-bit and 32-bit applications when used under Alpine.
# Our best bet is Debian, as it seems to be much faster than Ubuntu.
FROM --platform=linux/amd64 debian:bookworm-slim AS base
ENV DEBIAN_FRONTEND=noninteractive
ENV PS2DEV /usr/local/ps2dev
ENV PS2SDK $PS2DEV/ps2sdk
ENV PRODG /usr/local/prodg
ENV VIRTUAL_ENV /opt/venv
ENV PATH $PATH:${PS2DEV}/bin:${PS2DEV}/ee/bin:${PS2DEV}/iop/bin:${PS2DEV}/dvp/bin:${PS2SDK}/bin:${VIRTUAL_ENV}/bin
# Install base requirements
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
git \
gnupg \
gpg-agent \
sudo \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install wine (not currently required - wibo is sufficient)
# ARG WINE_BRANCH="stable"
# RUN wget -nv -O- https://dl.winehq.org/wine-builds/winehq.key | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - \
# && echo "deb https://dl.winehq.org/wine-builds/debian/ $(grep VERSION_CODENAME= /etc/os-release | cut -d= -f2) main" >> /etc/apt/sources.list \
# && dpkg --add-architecture i386 \
# && apt-get update \
# && apt-get install -y --install-recommends winehq-${WINE_BRANCH} \
# && rm -rf /var/lib/apt/lists/* \
# && wineboot --init
# Install build requirements
# - musl is required by ps2toolchain
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3 \
python3-venv \
make \
musl \
&& rm -rf /var/lib/apt/lists/*
# Install the ProDG compiler
RUN wget -O /tmp/prodg.zip https://archive.org/download/SNSystemsProDGPs2/ProDGPs2usrLocalSceFiles.zip \
&& unzip /tmp/prodg.zip "usr/local/sce/ee/*" -d "/tmp/prodg" \
&& mv /tmp/prodg/usr/local/sce/ ${PRODG} \
&& rm -rf /tmp/prodg && rm /tmp/prodg.zip
# Install wibo and ps2sdk
COPY --from=ghcr.io/decompals/wibo:latest /usr/local/sbin/wibo /usr/bin/
COPY --from=ghcr.io/ps2dev/ps2toolchain-ee:latest ${PS2DEV} ${PS2DEV}
# Install pip packages
# Newer versions of rabbitizer and spimdisasm cause broken disassembly
RUN python3 -m venv $VIRTUAL_ENV
RUN python -m pip install pycdlib rabbitizer==1.7.4 spimdisasm==1.14.3
#
# Development stage
#
FROM base AS dev
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
less \
gcc \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies for asm-differ
RUN python -m pip install colorama watchdog levenshtein cxxfilt
#
# Build stage
#
FROM base AS build
# Set the working directory
WORKDIR /dcdecomp
# Copy project files into the container
COPY . .
# Build the project
RUN
# Output the build
CMD make setup \
&& make -j$(nproc) \
&& cp build/SCUS_971.11 /output/SCUS_971.11