SDL (library)

From campisano.org
Jump to navigation Jump to search

SDL

Install

# shared/opt install schema v1.5.1

#### as common user ####
# setup env vars
export SOFTWARE_PATH="/home/shared/opt/software"
export NAME="libsdl"
export VERSION="2.0.14"
export URL="https://libsdl.org/release/SDL2-${VERSION}.tar.gz"
su - -w SOFTWARE_PATH,NAME,VERSION

#### as root ####
# generic dependencies
apt-get -qq -y install wget coreutils findutils
# dependencies
apt-get -qq -y install tar gzip gcc make
# paths
mkdir -m 777 -p "${SOFTWARE_PATH}/tmp_install/" "${SOFTWARE_PATH}/${NAME}_${VERSION}/"
exit

#### as common user ####
umask 0027
cd "${SOFTWARE_PATH}/tmp_install"
wget -c --no-check-certificate "${URL}"
tar -xzf "SDL2-${VERSION}.tar.gz"
cd "SDL2-${VERSION}"
# define compiler flags optimizations
export CFLAGS="-g0 -O2 -mtune=native -pipe"
# configure
./configure --prefix="${SOFTWARE_PATH}/${NAME}_${VERSION}" --enable-sdl2-config
make -s
make install
su - -w SOFTWARE_PATH,NAME,VERSION

#### as root ####
cd "${SOFTWARE_PATH}"
chown -R root:users "${NAME}_${VERSION}"
find "${NAME}_${VERSION}" -type d -exec chmod a-s,u+rwx,g+rx,g-w,o-rwx {} \;
find "${NAME}_${VERSION}" -type f -exec chmod a-s,u+rw,g+r,g-w,o-rwx {} \;
rm -rf tmp_install
ln -s -f -T "${NAME}_${VERSION}" "${NAME}"
exit

libSDL_mixer

Install

* from sources (https://www.libsdl.org/projects/SDL_mixer/release/):
# shared/opt install schema v1.5.1

#### as common user ####
# setup env vars
export SOFTWARE_PATH="/home/shared/opt/software"
export NAME="libsdl"
export VERSION="2.0.1"
export URL="https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-${VERSION}.tar.gz"
su - -w SOFTWARE_PATH,NAME,VERSION

#### as root ####
# generic dependencies
apt-get -qq -y install wget coreutils findutils
# dependencies
apt-get -qq -y install tar gzip gcc make
# paths
mkdir -m 777 -p "${SOFTWARE_PATH}/tmp_install/"
chmod -R a+w "${SOFTWARE_PATH}/${NAME}"
exit

#### as common user ####
umask 0027
cd "${SOFTWARE_PATH}/tmp_install"
wget -c --no-check-certificate "${URL}"
tar -xzf "SDL2_mixer-${VERSION}.tar.gz"
cd "SDL2_mixer-${VERSION}"
# define compiler flags optimizations
export CFLAGS="-g0 -O2 -mtune=native -pipe"
# configure
./configure --prefix="${SOFTWARE_PATH}/${NAME}" --with-sdl-prefix="${SOFTWARE_PATH}/${NAME}"
make -s
make install
su - -w SOFTWARE_PATH,NAME,VERSION

#### as root ####
cd "${SOFTWARE_PATH}"
chown -R root:users -H "${NAME}"
find "${NAME}" -follow -type d -exec chmod a-s,u+rwx,g+rx,g-w,o-rwx {} \;
find "${NAME}" -follow -type f -exec chmod a-s,u+rw,g+r,g-w,o-rwx {} \;
rm -rf tmp_install
exit

References

* libSDL: Installing SDL * SDL_mixer 2.0