docker/MacOS.dockerfile

83 lines
2.8 KiB
Plaintext
Raw Normal View History

2020-11-27 21:45:21 +00:00
##
2021-11-06 03:03:40 +00:00
# Fully build and distribute MacOS releases cross-compiled from Linux.
2020-11-27 21:45:21 +00:00
#
2021-11-06 03:03:40 +00:00
# Artifact outputs will be in the dist/mac/ folder.
2020-11-27 21:45:21 +00:00
#
2021-11-06 03:03:40 +00:00
# WORK IN PROGRESS.
2020-11-27 21:45:21 +00:00
##
2021-11-06 03:03:40 +00:00
FROM manjaro:latest
2020-06-05 08:00:54 +00:00
MAINTAINER Noah Petherbridge <root@kirsle.net>
ENV GOPATH /go
2021-04-01 04:22:39 +00:00
ENV GOPROXY direct
2020-06-05 08:00:54 +00:00
ENV PATH /bin:/sbin:/usr/bin:/usr/sbin:/go/bin
2021-11-06 03:03:40 +00:00
# Manjaro: Update all software and get dependencies.
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm go sdl2 sdl2_ttf sdl2_mixer pkg-config
# Get the OS X cross compile toolchain.
RUN git clone https://github.com/tpoechtrager/osxcross /git/osxcross &&
cd /git/osxcross &&
makepkg -si
2020-06-05 08:00:54 +00:00
# Create a user to build the packages.
RUN useradd builder -u 1000 -m -G users && \
mkdir /go /git && chown -R builder:users /go /git
# Docker cache invalidation here.
# ADD . /home/builder
# Git clone all the repos. XXX: passwords exposed here
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-rtp /git/rtp
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-vendor /git/vendor
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle-masters /git/masters
RUN git clone https://doodle:hiRN6wp-XPDBc@git.kirsle.net/apps/doodle /go/src/git.kirsle.net/apps/doodle
2020-11-27 21:45:21 +00:00
# Pre-download my Go render engine libraries
RUN git clone https://git.kirsle.net/go/ui /git/go/ui
RUN git clone https://git.kirsle.net/go/render /git/go/render
RUN git clone https://git.kirsle.net/go/audio /git/go/audio
2021-11-06 03:03:40 +00:00
# Enter Doodle's directory.
2020-06-05 08:00:54 +00:00
WORKDIR /go/src/git.kirsle.net/apps/doodle
2020-11-27 21:45:21 +00:00
RUN echo "replace git.kirsle.net/go/ui => /git/go/ui" >> go.mod && \
2021-04-01 04:22:39 +00:00
echo "replace git.kirsle.net/go/render => /git/go/render" >> go.mod && \
echo "replace git.kirsle.net/go/audio => /git/go/audio" >> go.mod && \
2021-11-06 03:03:40 +00:00
cat go.mod
2020-06-05 08:00:54 +00:00
# Install Go dependencies and such.
RUN go get -u git.kirsle.net/go/bindata/...
RUN make bindata-dev
RUN make setup
# Copy default vendored assets in.
RUN cp -r /git/vendor/fonts ./assets/fonts && \
cp -r /git/masters/levels ./assets/levels && \
mkdir rtp && cp -r /git/rtp/* rtp/
2021-11-06 03:03:40 +00:00
# MinGW setup for Windows executable cross-compile.
WORKDIR /git/vendor/mingw-libs
RUN for i in *.tar.gz; do tar -xzvf $i; done
RUN cp -rv SDL2-2.0.9/x86_64-w64-mingw32 /usr && \
cp -rv SDL2_mixer-2.0.4/x86_64-w64-mingw32 /usr && \
cp -rv SDL2_ttf-2.0.15/x86_64-w64-mingw32 /usr
RUN mkdir -p /usr/lib/go/pkg/windows_amd64 && \
chown -R builder:users /usr/lib/go/pkg/windows_amd64
WORKDIR /go/src/git.kirsle.net/apps/doodle
RUN make mingw
RUN cp /git/vendor/DLL/*.dll bin/
RUN make dist
2020-06-05 08:00:54 +00:00
# Package rpm and deb for Linux.
# TODO: fpm doesn't like to install in Docker right now
2021-11-06 03:03:40 +00:00
# RUN dnf -y install ruby-devel gcc rpm-build libffi-devel
# RUN gem install fpm; exit 0
# WORKDIR /go/src/git.kirsle.net/apps/doodle/dist/doodle-latest
# RUN pwd
# RUN ../../scripts/fpm-bundle.sh
2020-06-05 08:00:54 +00:00
CMD ["sudo", "cp", "-r", "-v", "/go/src/git.kirsle.net/apps/doodle/dist/", "/mnt/export/"]