Skip to content

Commit

Permalink
Dockerfiles (#278)
Browse files Browse the repository at this point in the history
* add Dockerfiles, Makefile, and .dockerignore

* move makefile to other branch, add new pip lib

* Dockerfile work

* stashing changes, but Windows ANGLE build is almost working

* actually compiles ANGLE

* fix one typo

* more refactoring

* more 'fixes'

* deck chairs on the titanic

* it absolutely must be Visual Studio and not Build Tools because Google

* moar space

* this ACTUALLY builds ANGLE in a container, yay

* stashing makefile changes

* move dockerfile directories, port over changes from fork

* cleanup

* change filename

* pre-emptive PR changes, move to misc/ci/

* use proper build args

* Dockerfile for building Switch tools for GHA

* less deps for switch dockerfile

* windows dockerfile improvement

* clean up Dockerfiles, move Docker-specific Makefile to /misc/ci

* make this actually work

* add gnupg

* bump switch/debian version in dockerfile

* package name change for Switch dockerfile

* update and remove cursed ANGLE build (we have GHA for that now)

* remove last of ANGLE build nightmare

* new Windows build image file
  • Loading branch information
StarWitch authored May 1, 2022
1 parent 74e02a4 commit 83dc767
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/*
28 changes: 28 additions & 0 deletions misc/ci/Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM ubuntu:focal

LABEL maintainer="Alice D. <[email protected]>"

ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && \
apt install -y -qq \
build-essential \
libsdl2-dev \
libogg-dev \
libopusfile-dev \
libpng-dev \
libzip-dev \
libx11-dev \
libwayland-dev \
python3-docutils \
libwebp-dev \
libfreetype6-dev \
python3-pip \
libzstd-dev \
git

RUN pip3 install \
meson==0.56.2 \
ninja \
zstandard
52 changes: 52 additions & 0 deletions misc/ci/Dockerfile.switch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
FROM debian:bullseye-slim

LABEL maintainer="Alice D. <[email protected]>"

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-utils \
sudo \
ca-certificates \
pkg-config \
curl \
wget \
bzip2 \
xz-utils \
make \
git \
libarchive-tools \
doxygen \
gnupg \
build-essential \
python3-docutils \
python3-pip \
gdebi-core \
cmake && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN pip3 install \
meson==0.56.2 \
ninja \
zstandard \
python-gnupg

RUN wget https://github.com/devkitPro/pacman/releases/latest/download/devkitpro-pacman.amd64.deb && \
gdebi -n devkitpro-pacman.amd64.deb && \
rm devkitpro-pacman.amd64.deb && \
dkp-pacman -Scc --noconfirm

ENV DEVKITPRO=/opt/devkitpro
ENV PATH=${DEVKITPRO}/tools/bin:$PATH

RUN ln -s /proc/self/mounts /etc/mtab

RUN dkp-pacman -Syyu --noconfirm \
switch-dev \
switch-portlibs \
dkp-toolchain-vars \
switch-pkg-config && \
dkp-pacman -S --needed --noconfirm `dkp-pacman -Slq dkp-libs | grep '^switch-'` && \
dkp-pacman -Scc --noconfirm
53 changes: 53 additions & 0 deletions misc/ci/Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM ubuntu:20.04

LABEL maintainer="Alice D. <[email protected]>"

ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -qq && \
apt-get upgrade -qqy && \
apt-get install -qqy --no-install-recommends \
git wget bzip2 file unzip libtool pkg-config cmake build-essential \
automake yasm gettext autopoint vim-tiny python3 python3-distutils \
ninja-build ca-certificates curl less zip python3-docutils python3-pip \
nsis gnupg zlibc && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*

RUN pip3 install \
meson==0.56.2 \
ninja \
zstandard \
python-gnupg

WORKDIR /build

ENV TOOLCHAIN_PREFIX=/opt/llvm-mingw

ARG TOOLCHAIN_ARCHS="i686 x86_64"

ARG DEFAULT_CRT=ucrt

# Build everything that uses the llvm monorepo. We need to build the mingw runtime before the compiler-rt/libunwind/libcxxabi/libcxx runtimes.
COPY build-llvm.sh build-lldb-mi.sh strip-llvm.sh install-wrappers.sh build-mingw-w64.sh build-mingw-w64-tools.sh build-compiler-rt.sh build-libcxx.sh build-mingw-w64-libraries.sh build-openmp.sh ./
COPY wrappers/*.sh wrappers/*.c wrappers/*.h ./wrappers/
RUN ./build-llvm.sh $TOOLCHAIN_PREFIX && \
./build-lldb-mi.sh $TOOLCHAIN_PREFIX && \
./strip-llvm.sh $TOOLCHAIN_PREFIX && \
./install-wrappers.sh $TOOLCHAIN_PREFIX && \
./build-mingw-w64.sh $TOOLCHAIN_PREFIX --with-default-msvcrt=$DEFAULT_CRT && \
./build-mingw-w64-tools.sh $TOOLCHAIN_PREFIX && \
./build-compiler-rt.sh $TOOLCHAIN_PREFIX && \
./build-libcxx.sh $TOOLCHAIN_PREFIX && \
./build-mingw-w64-libraries.sh $TOOLCHAIN_PREFIX && \
./build-compiler-rt.sh $TOOLCHAIN_PREFIX --build-sanitizers && \
./build-openmp.sh $TOOLCHAIN_PREFIX && \
rm -rf /build/*

# Build libssp
COPY build-libssp.sh libssp-Makefile ./
RUN ./build-libssp.sh $TOOLCHAIN_PREFIX && \
rm -rf /build/*

ENV PATH=$TOOLCHAIN_PREFIX/bin:$PATH
24 changes: 24 additions & 0 deletions misc/ci/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Taisei Docker Makefile

tag:
ifndef TAG
@echo "tag not defined, please define one"
@echo "i.e: TAG=20210630 make docker/switch"
@exit 1
endif

##########
# docker #
##########

docker/windows: tag
docker build . -m 8GB -t taiseiproject/windows-toolkit:$(TAG) -f "Dockerfile.windows"
docker push taisei/windows-toolkit:$(TAG)

docker/switch: tag
docker build . -m 4GB -t taiseiproject/switch-toolkit:$(TAG) -f "Dockerfile.switch"
docker push taiseiproject/switch-toolkit:$(TAG)

docker/linux: tag
docker build . -m 4GB -t taiseiproject/linux-toolkit:$(TAG) -f "Dockerfile.linux"
docker push taiseiproject/linux-toolkit:$(TAG)

0 comments on commit 83dc767

Please sign in to comment.