# If you change the OS version here, make sure to bump up and rebuild runtime-gcc-libs.
# If the musl version changes drastically, it may also be a good idea to review runtime-musl.
FROM docker.io/i386/alpine:3.23
# Install packages:
# - compiler/make/etc. [build-base]
# - tools for building/installing packages [fakeroot git pacman pacman-makepkg curl xz zstd sudo cmake patchelf pkgconf coreutils autoconf automake gettext gettext-dev libtool]
# - ffmpeg build dependencies [nasm]
# - binutils build dependencies [texinfo]
# - binutils-ia16 build dependencies [bison, flex]
# - pacman build dependencies [meson]
# - llvm build dependencies [lld ninja]
# - grit build dependencies [freeimage-dev]
# - SoX build dependencies [autoconf-archive]
# - Lua build tools [luarocks5.4]
# - Pillow, used by some scripts [python3 py3-pillow]
RUN apk add --no-cache build-base fakeroot git pacman pacman-makepkg curl xz zstd sudo cmake patchelf pkgconf coreutils autoconf automake gettext gettext-dev libtool nasm texinfo bison flex meson linux-headers lld ninja freeimage-dev autoconf-archive luarocks5.4 python3 py3-pillow
# Configure pacman/makepkg
RUN mkdir -p /opt/wonderful/pacman/cache
RUN mkdir -p /opt/wonderful/pacman/config
RUN mkdir -p /opt/wonderful/pacman/db
RUN mkdir -p /opt/wonderful/pacman/gnupg
RUN mkdir -p /opt/wonderful/pacman/hooks
COPY containers/linux/i686/makepkg.conf containers/linux/i686/pacman.conf /etc
# wf-pacman/gpgme workaround: if no pkgconfig directory exists in any of the library
# search paths, the check for gpg-error will fail
RUN mkdir -p /usr/lib/pkgconfig
# Add build user
RUN adduser -D wfbuilder
RUN sh -c 'echo "wfbuilder ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/wfbuilder && chmod 0440 /etc/sudoers.d/wfbuilder'
