Initial commit

This commit is contained in:
Noah 2020-06-05 01:00:54 -07:00
commit 5faa55ef85
4 changed files with 87 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
ssh/*

13
Makefile Normal file
View File

@ -0,0 +1,13 @@
SHELL := /bin/bash
.PHONY: clean
clean:
sudo rm -rf ./dist
sudo docker system prune -a
.PHONY: mingw
mingw:
mkdir -p ./dist/mingw
echo pwd is $(shell pwd)
sudo docker build -t doodle_mingw -f ./MinGW.dockerfile .
sudo docker run --rm --mount type=bind,src=$(shell pwd)/dist/mingw,dst=/mnt/export doodle_mingw

64
MinGW.dockerfile Normal file
View File

@ -0,0 +1,64 @@
FROM fedora:latest
MAINTAINER Noah Petherbridge <root@kirsle.net>
ENV GOPATH /go
ENV PATH /bin:/sbin:/usr/bin:/usr/sbin:/go/bin
# Update all software and get dependencies.
RUN dnf -y update
RUN dnf -y install git zip golang SDL2-devel SDL2_ttf-devel \
SDL2_mixer-devel make
# 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
# Enter Doodle's directory.
WORKDIR /go/src/git.kirsle.net/apps/doodle
# 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/
# RUN make doodads
# RUN make dist
# MinGW setup for Windows executable cross-compile.
RUN dnf -y install mingw64-gcc
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/golang/pkg/windows_amd64 && \
chown -R builder:users /usr/lib/golang/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/"]

9
README.md Normal file
View File

@ -0,0 +1,9 @@
# Dockerfiles for Project: Doodle
To ensure consistent builds of Project: Doodle, these Dockerfiles will
set up a clean Linux environment and run all the steps to gather assets from
all the git repos and build and release the app in a consistent way.
```
make mingw
```