83 lines
2.8 KiB
Docker
83 lines
2.8 KiB
Docker
##
|
|
# Fully build and distribute MacOS releases cross-compiled from Linux.
|
|
#
|
|
# Artifact outputs will be in the dist/mac/ folder.
|
|
#
|
|
# WORK IN PROGRESS.
|
|
##
|
|
|
|
FROM manjaro:latest
|
|
MAINTAINER Noah Petherbridge <root@kirsle.net>
|
|
ENV GOPATH /go
|
|
ENV GOPROXY direct
|
|
ENV PATH /bin:/sbin:/usr/bin:/usr/sbin:/go/bin
|
|
|
|
# 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
|
|
|
|
# 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
|
|
|
|
# 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
|
|
|
|
# Enter Doodle's directory.
|
|
WORKDIR /go/src/git.kirsle.net/apps/doodle
|
|
RUN echo "replace git.kirsle.net/go/ui => /git/go/ui" >> go.mod && \
|
|
echo "replace git.kirsle.net/go/render => /git/go/render" >> go.mod && \
|
|
echo "replace git.kirsle.net/go/audio => /git/go/audio" >> go.mod && \
|
|
cat go.mod
|
|
|
|
# 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/
|
|
|
|
# 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
|
|
|
|
# Package rpm and deb for Linux.
|
|
# TODO: fpm doesn't like to install in Docker right now
|
|
# 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
|
|
|
|
CMD ["sudo", "cp", "-r", "-v", "/go/src/git.kirsle.net/apps/doodle/dist/", "/mnt/export/"]
|