|
| 1 | +FROM archlinux:latest |
| 2 | + |
| 3 | +# Based on https://github.com/haffmans/docker-mingw-qt5/blob/master/Dockerfile |
| 4 | + |
| 5 | +# Update base system |
| 6 | +#RUN pacman -Sy --noconfirm --noprogressbar archlinux-keyring \ |
| 7 | +# && pacman-key --populate \ |
| 8 | +RUN pacman -Syu --noconfirm --noprogressbar pacman \ |
| 9 | + && pacman-db-upgrade \ |
| 10 | + && pacman -Su --noconfirm --noprogressbar ca-certificates \ |
| 11 | + && trust extract-compat \ |
| 12 | + && pacman -Su --noconfirm --noprogressbar git pyalpm base-devel libffi \ |
| 13 | + && pacman -Syyu --noconfirm --noprogressbar \ |
| 14 | + && (echo -e "y\ny\n" | pacman -Scc) |
| 15 | + |
| 16 | +# Install pikaur |
| 17 | +RUN useradd --create-home --comment "Arch Build User" build && \ |
| 18 | + groupadd sudo && \ |
| 19 | + echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers; \ |
| 20 | + echo 'Defaults:nobody !requiretty' >> /etc/sudoers; \ |
| 21 | + gpasswd -a build sudo |
| 22 | + |
| 23 | +RUN chown -R build /home/build |
| 24 | + |
| 25 | +USER build |
| 26 | +# Overrides from arch-base |
| 27 | +ENV HOME /home/build |
| 28 | + |
| 29 | +WORKDIR /home/build/ |
| 30 | +RUN git clone https://aur.archlinux.org/pikaur.git |
| 31 | + |
| 32 | +WORKDIR /home/build/pikaur |
| 33 | +RUN makepkg -sr --noconfirm |
| 34 | + |
| 35 | +USER root |
| 36 | +RUN pacman -U pikaur-*.zst --noconfirm && pacman -Scc --noconfirm && rm -r /home/build/* |
| 37 | + |
| 38 | +# Add some useful packages to the base system |
| 39 | +RUN pacman -S --noconfirm --noprogressbar \ |
| 40 | + make \ |
| 41 | + git \ |
| 42 | + sudo \ |
| 43 | + wget \ |
| 44 | + awk \ |
| 45 | + sudo \ |
| 46 | + fakeroot \ |
| 47 | + file \ |
| 48 | + patch \ |
| 49 | + ninja \ |
| 50 | + ccache \ |
| 51 | + unzip \ |
| 52 | + && (echo -e "y\ny\n" | pacman -Scc) |
| 53 | + |
| 54 | +# Add ownstuff repo |
| 55 | +# See https://wiki.archlinux.org/index.php/unofficial_user_repositories#ownstuff and https://martchus.no-ip.biz/repoindex/#packages |
| 56 | +RUN echo "[ownstuff]" >> /etc/pacman.conf \ |
| 57 | + && echo "SigLevel = Optional TrustAll" >> /etc/pacman.conf \ |
| 58 | + && echo "Server = https://ftp.f3l.de/~martchus/\$repo/os/\$arch" >> /etc/pacman.conf \ |
| 59 | + && echo "Server = https://martchus.no-ip.biz/repo/arch/\$repo/os/\$arch" >> /etc/pacman.conf \ |
| 60 | + && pacman -Sy |
| 61 | + |
| 62 | +USER build |
| 63 | +# Install MingW packages |
| 64 | +RUN pikaur -S --noconfirm --noprogressbar \ |
| 65 | + mingw-w64-binutils \ |
| 66 | + mingw-w64-bzip2 \ |
| 67 | + mingw-w64-boost \ |
| 68 | + mingw-w64-cmake \ |
| 69 | + mingw-w64-crt \ |
| 70 | + mingw-w64-curl \ |
| 71 | + mingw-w64-flac \ |
| 72 | + mingw-w64-fontconfig \ |
| 73 | + mingw-w64-freetype2 \ |
| 74 | + mingw-w64-gcc \ |
| 75 | + mingw-w64-gnutls \ |
| 76 | + mingw-w64-headers \ |
| 77 | + mingw-w64-libiconv \ |
| 78 | + mingw-w64-libogg \ |
| 79 | + mingw-w64-libpng \ |
| 80 | + mingw-w64-libvorbis \ |
| 81 | + mingw-w64-nettle \ |
| 82 | + mingw-w64-openal \ |
| 83 | + mingw-w64-openssl \ |
| 84 | + mingw-w64-pkg-config \ |
| 85 | + mingw-w64-sdl2 \ |
| 86 | + mingw-w64-speexdsp \ |
| 87 | + mingw-w64-tools \ |
| 88 | + mingw-w64-winpthreads \ |
| 89 | + mingw-w64-xz \ |
| 90 | + mingw-w64-zlib \ |
| 91 | + mingw-w64-zstd \ |
| 92 | + pkgconf \ |
| 93 | + && (echo -e "y\ny\n" | sudo pacman -Scc) |
| 94 | + |
| 95 | +WORKDIR /home/build/ |
| 96 | +COPY mingw-w64-libzip mingw-w64-libzip |
| 97 | +USER root |
| 98 | +# GMP and Nettle seem to have their mingw libraries misnamed. pkg-config |
| 99 | +# points to .a, not .dll.a files; additionally cmake removes any such |
| 100 | +# extensions, so symlink the files to their expected places |
| 101 | +RUN ln -s /usr/i686-w64-mingw32/lib/libp11-kit.dll.a /usr/i686-w64-mingw32/lib/libp11-kit.a \ |
| 102 | + && ln -s /usr/i686-w64-mingw32/lib/libgmp.dll.a /usr/i686-w64-mingw32/lib/libgmp.a |
| 103 | +RUN chown -R build /home/build |
| 104 | +USER build |
| 105 | +WORKDIR /home/build/mingw-w64-libzip |
| 106 | +RUN makepkg -sr --noconfirm |
| 107 | +USER root |
| 108 | +RUN pacman -U mingw-w64-libzip-*.zst --noconfirm && pacman -Scc --noconfirm && rm -r /home/build/* |
| 109 | + |
| 110 | +RUN wget https://github.com/nlohmann/json/releases/download/v3.11.3/include.zip -O /usr/i686-w64-mingw32/json.zip && unzip /usr/i686-w64-mingw32/json.zip -d /usr/i686-w64-mingw32/ && unzip /usr/i686-w64-mingw32/json.zip -d /usr/x86_64-w64-mingw32/ |
| 111 | + |
| 112 | +# Bash is required for OpenRCT2 CI |
| 113 | +SHELL ["/bin/bash", "-c"] |
0 commit comments