Reduce duplicated code and build SDL_ttf

This commit is contained in:
Cameron Gutman
2020-02-11 21:01:38 -08:00
parent 0ccf234904
commit 8664097039
8 changed files with 38 additions and 21 deletions

View File

@@ -26,15 +26,26 @@ else
exit 1
fi
# Remove the existing SDL2 library (but not SDL_ttf)
find /usr/include/SDL2 -type f -not -name 'SDL_ttf.h' -delete
rm -fv /usr/lib/*-linux-*/libSDL2-*
rm -fv /usr/lib/*-linux-*/libSDL2.*
rm -fv /usr/lib/*-linux-*/pkgconfig/sdl2.pc
# Build and install our SDL2 build
# Since we'll be linking statically, we need to use Libs.private instead of Libs, but
# there's no way to tell QMake to use the Libs.private section, so we have to replace
# Libs with Libs.private ourselves prior to installation.
cd /opt/SDL2
./configure --enable-static --disable-shared --enable-video-kmsdrm
make -j$(nproc)
sed -i '/^Libs:/d' sdl2.pc
sed -i 's/Libs.private:/Libs:/g' sdl2.pc
cat sdl2.pc
make install
# Build and install SDL_ttf
# For similar reasons to SDL2 above, we have to patch the pkgconfig file in order to
# link with a static library.
cd /opt/SDL_ttf
./configure --enable-static --disable-shared
make -j$(nproc)
sed -i 's/-lSDL2_ttf/-lSDL2_ttf -lfreetype/g' SDL2_ttf.pc
cat SDL2_ttf.pc
make install
cd /opt/FFmpeg