Skip to content

Instantly share code, notes, and snippets.

@WillSams
Last active January 8, 2023 14:25
Show Gist options
  • Select an option

  • Save WillSams/e2bb2874ace22b90f90f to your computer and use it in GitHub Desktop.

Select an option

Save WillSams/e2bb2874ace22b90f90f to your computer and use it in GitHub Desktop.
Script to get SDL2 up & running on your system
#SCRIPTVERSION="2014.06.16-Debian"
SCRIPTVERSION="2022.12.13-Debian"
SCRIPTNAME="sdl2-pkgs-install.sh"
SCRIPTFULLNAME="$0"
BUILDDIR=/tmp/sdlbuild
sudo bash -c "apt update"
sudo bash -c "apt install libxext-dev build-essential automake autoconf libtool -y"
sudo bash -c "apt install mesa-common-dev libasound2-dev libpulse-dev -y"
sudo bash -c "apt install libpng-dev libjpeg-dev libwebp-dev libtiff-dev -y"
sudo bash -c "apt install libmodplug-dev mercurial libtinyxml-dev libtinyxml2-dev tiled valgrind -y"
sudo bash -c "apt autoremove"
mkdir -p $BUILDDIR && cd $_
git clone https://github.com/libsdl-org/SDL -b SDL2
cd SDL
mkdir build && cd $_
../configure
make && sudo bash -c "make install"
cd $BUILDDIR
git clone https://github.com/libsdl-org/SDL_image
cd SDL_image
mkdir build && cd $_
../configure
make && sudo bash -c "make install"
cd $BUILDDIR
git clone https://github.com/libsdl-org/SDL_mixer
cd SDL_mixer
mkdir build && cd $_
../configure
make && sudo bash -c "make install"
cd $BUILDDIR
git clone https://gitlab.freedesktop.org/freetype/freetype.git
cd freetype && ./autogen.sh
make && sudo bash -c "make install"
cd $BUILDDIR
git clone https://github.com/libsdl-org/SDL_ttf
cd SDL_ttf
mkdir build && cd $_
../configure
make && sudo bash -c "make install"
cd $BUILDDIR
git clone https://github.com/libsdl-org/SDL_net
cd SDL_net
mkdir build && cd $_
../configure
make && sudo bash -c "make install"
git clone https://github.com/google/googletest cd $BUILDDIR/googletest
cd googletest && cmake .
make && sudo bash -c "make install"
# 'Ye sanity check
git clone https://github.com/WillSams/Alien-Attack-Linux $BUILDDIR/sanity_check
cd $_ && make all run
# Remove the temp build directory
sudo bash -c "rm -rf $BUILDDIR"
#*****************************************************************************
echo "$SCRIPTFULLNAME ($SCRIPTVERSION) complete."
@WillSams
Copy link
Copy Markdown
Author

SDL2_ttf is fucking up. I'll figure out what's going on with it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment