Add Docker-based build for building SDL on Linux

Example usage, to build i386 libs:

  docker build -t sdl2-i386 -f Dockerfile.i386 .
  mkdir i386
  docker run -v `pwd`/compile:/entry -v `pwd`/i386:/io sdl2-i386

s/i386/amd64 to build for amd64.
This commit is contained in:
Tudor Brindus 2020-04-29 21:15:54 -04:00
parent 0729f73aa1
commit 32c23f3e35
4 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,19 @@
FROM debian:jessie
# We build on Jessie, but libwayland-dev and wayland-protocols are only in
# Stretch and later.
COPY stretch-package-pins /etc/apt/preferences.d/stretch
# Packages are from https://hg.libsdl.org/SDL/file/default/docs/README-linux.md
RUN echo deb http://deb.debian.org/debian/ stretch main > /etc/apt/sources.list.d/stretch.list && \
echo deb http://security.debian.org/debian-security stretch/updates main >> /etc/apt/sources.list.d/stretch.list && \
apt-get update && \
apt-get install -y build-essential mercurial make cmake autoconf automake \
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
fcitx-libs-dev libsamplerate0-dev libsndio-dev libwayland-dev \
libxkbcommon-dev wayland-protocols
ENTRYPOINT ["/entry"]

View File

@ -0,0 +1,19 @@
FROM i386/debian:jessie
# We build on Jessie, but libwayland-dev and wayland-protocols are only in
# Stretch and later.
COPY stretch-package-pins /etc/apt/preferences.d/stretch
# Packages are from https://hg.libsdl.org/SDL/file/default/docs/README-linux.md
RUN echo deb http://deb.debian.org/debian/ stretch main > /etc/apt/sources.list.d/stretch.list && \
echo deb http://security.debian.org/debian-security stretch/updates main >> /etc/apt/sources.list.d/stretch.list && \
apt-get update && \
apt-get install -y build-essential mercurial make cmake autoconf automake \
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
fcitx-libs-dev libsamplerate0-dev libsndio-dev libwayland-dev \
libxkbcommon-dev wayland-protocols
ENTRYPOINT ["/entry"]

11
linux-build/compile Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -euf -o pipefail
hg clone https://hg.libsdl.org/SDL SDL
cd SDL
mkdir build
cd build
../configure --prefix=/io
make -j$(nproc)
make install

View File

@ -0,0 +1,27 @@
Package: *
Pin: release n=stretch
Pin-Priority: 50
Package: libwayland-dev
Pin: release n=stretch
Pin-Priority: 800
Package: libwayland-bin
Pin: release n=stretch
Pin-Priority: 800
Package: libwayland-client0
Pin: release n=stretch
Pin-Priority: 800
Package: libwayland-cursor0
Pin: release n=stretch
Pin-Priority: 800
Package: libwayland-server0
Pin: release n=stretch
Pin-Priority: 800
Package: wayland-protocols
Pin: release n=stretch
Pin-Priority: 800