Skip to content

Commit

Permalink
support apple silicon macs
Browse files Browse the repository at this point in the history
  • Loading branch information
mracsys committed Nov 10, 2024
1 parent 1865ed2 commit eb68ecb
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
44 changes: 41 additions & 3 deletions ASM/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,58 @@ ARG USER_GID=$USER_UID

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash

# Install build tools
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes curl gnupg ca-certificates \
&& curl https://practicerom.com/public/packages/debian/pgp.pub | apt-key add - \
&& echo deb http://practicerom.com/public/packages/debian staging main >/etc/apt/sources.list.d/practicerom.list \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes \
build-essential \
n64-ultra \
nodejs \
npm \
git \
cmake
cmake \
gdb-multiarch

# Install toolchain. Compile from source if not on Intel/AMD.
RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes n64-ultra; \
else \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes \
wget \
tar \
make \
diffutils \
texinfo \
gcc \
g++ \
lua5.3 \
libjansson4 \
libusb-1.0-0 \
libgmp10 \
liblua5.3-dev \
libjansson-dev \
libusb-1.0-0-dev \
libgmp-dev \
libmpfr-dev \
zlib1g-dev; \
fi
RUN if [ "$(dpkg --print-architecture)" != "amd64" ]; then \
mkdir -p build \
&& cd build \
&& git clone --recursive https://github.com/glankk/n64.git \
&& cd n64 \
&& ./configure --enable-vc --prefix=/opt/n64 \
&& make install-toolchain \
&& make && make install \
&& make install-sys \
&& echo 'export PATH="/opt/n64/bin:$PATH"' >> /etc/profile; \
fi

# Build armips
WORKDIR /build
RUN git clone --recursive https://github.com/Kingcom/armips.git
WORKDIR /build/armips
Expand All @@ -31,4 +68,5 @@ RUN cmake -DCMAKE_BUILD_TYPE=Release .. \
&& mv ./armips /usr/local/bin/ \
&& chmod a+rx /usr/local/bin/armips

# Run as non-root user
USER $USERNAME
3 changes: 3 additions & 0 deletions ASM/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ services:
- ../Output:/app/OoT-Randomizer/Output:consistent
- ../data/generated:/app/OoT-Randomizer/data/generated:consistent
- ../Logs:/app/OoT-Randomizer/Logs:consistent
network_mode: host
extra_hosts:
- host.docker.internal:host-gateway

# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
cap_add:
Expand Down

0 comments on commit eb68ecb

Please sign in to comment.