Update linux build script for new dependencies

This commit is contained in:
Deve 2021-06-12 08:21:02 +02:00
parent 17d26338f8
commit 4767b5d48d

View File

@ -51,9 +51,9 @@ export DIRNAME="$(dirname "$(readlink -f "$0")")"
export STK_VERSION="git`date +%Y%m%d`" export STK_VERSION="git`date +%Y%m%d`"
export THREADS_NUMBER=`nproc` export THREADS_NUMBER=`nproc`
export SCHROOT_32BIT_NAME="chroot-jessie32" export SCHROOT_32BIT_NAME="chroot-stretch32"
export SCHROOT_64BIT_NAME="chroot-jessie64" export SCHROOT_64BIT_NAME="chroot-stretch64"
export SCHROOT_ARMV7_NAME="chroot-jessie-armhf" export SCHROOT_ARMV7_NAME="chroot-stretch-armhf"
export SCHROOT_ARM64_NAME="chroot-stretch-arm64" export SCHROOT_ARM64_NAME="chroot-stretch-arm64"
export STKCODE_DIR="$DIRNAME/.." export STKCODE_DIR="$DIRNAME/.."
@ -137,7 +137,8 @@ build_stk()
cp -a -f "$DEPENDENCIES_DIR/../lib/zlib/"* "$DEPENDENCIES_DIR/zlib" cp -a -f "$DEPENDENCIES_DIR/../lib/zlib/"* "$DEPENDENCIES_DIR/zlib"
cd "$DEPENDENCIES_DIR/zlib" cd "$DEPENDENCIES_DIR/zlib"
cmake . -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \ cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
-DINSTALL_PKGCONFIG_DIR="$PKG_CONFIG_PATH" && -DINSTALL_PKGCONFIG_DIR="$PKG_CONFIG_PATH" &&
make -j$THREADS_NUMBER && make -j$THREADS_NUMBER &&
make install make install
@ -153,8 +154,6 @@ build_stk()
cp -a -f "$DEPENDENCIES_DIR/../lib/libpng/"* "$DEPENDENCIES_DIR/libpng" cp -a -f "$DEPENDENCIES_DIR/../lib/libpng/"* "$DEPENDENCIES_DIR/libpng"
cd "$DEPENDENCIES_DIR/libpng" cd "$DEPENDENCIES_DIR/libpng"
CPPFLAGS="-I$INSTALL_INCLUDE_DIR" \
LDFLAGS="-L$INSTALL_LIB_DIR" \
./configure --prefix="$INSTALL_DIR" && ./configure --prefix="$INSTALL_DIR" &&
make -j$THREADS_NUMBER && make -j$THREADS_NUMBER &&
make install make install
@ -164,18 +163,24 @@ build_stk()
# Freetype bootstrap # Freetype bootstrap
if [ ! -f "$DEPENDENCIES_DIR/freetype_bootstrap.stamp" ]; then if [ ! -f "$DEPENDENCIES_DIR/freetype_bootstrap.stamp" ]; then
echo "Compiling freetype" echo "Compiling freetype bootstrap"
mkdir -p "$DEPENDENCIES_DIR/freetype" mkdir -p "$DEPENDENCIES_DIR/freetype/build"
cp -a -f "$DEPENDENCIES_DIR/../lib/freetype/"* "$DEPENDENCIES_DIR/freetype" cp -a -f "$DEPENDENCIES_DIR/../lib/freetype/"* "$DEPENDENCIES_DIR/freetype"
cd "$DEPENDENCIES_DIR/freetype" cd "$DEPENDENCIES_DIR/freetype/build"
ZLIB_CFLAGS="-I$INSTALL_INCLUDE_DIR" ZLIB_LIBS="-L$INSTALL_LIB_DIR -l:libz.so"\ cmake .. -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
LIBPNG_CFLAGS="-I$INSTALL_INCLUDE_DIR" LIBPNG_LIBS="-L$INSTALL_LIB_DIR -l:libpng.so"\ -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
./configure --prefix="$INSTALL_DIR" --with-bzip2=no --with-harfbuzz=no --with-png=yes --with-zlib=yes && -DBUILD_SHARED_LIBS=1 \
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=1 \
-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=1 \
-DFT_WITH_HARFBUZZ=0 \
-DFT_WITH_BZIP2=0 \
-DFT_WITH_BROTLI=0 \
-DFT_WITH_ZLIB=1 \
-DFT_WITH_PNG=1 &&
make -j$THREADS_NUMBER && make -j$THREADS_NUMBER &&
make install make install
check_error check_error
# We need to rebuild freetype after harfbuzz is compiled
touch "$DEPENDENCIES_DIR/freetype_bootstrap.stamp" touch "$DEPENDENCIES_DIR/freetype_bootstrap.stamp"
fi fi
@ -186,10 +191,14 @@ build_stk()
cp -a -f "$DEPENDENCIES_DIR/../lib/harfbuzz/"* "$DEPENDENCIES_DIR/harfbuzz" cp -a -f "$DEPENDENCIES_DIR/../lib/harfbuzz/"* "$DEPENDENCIES_DIR/harfbuzz"
cd "$DEPENDENCIES_DIR/harfbuzz" cd "$DEPENDENCIES_DIR/harfbuzz"
FREETYPE_CFLAGS="-I$INSTALL_INCLUDE_DIR -I$INSTALL_INCLUDE_DIR/freetype2" \ ./autogen.sh
FREETYPE_LIBS="-L$INSTALL_LIB_DIR -l:libfreetype.so -l:libpng.so -l:libz.so"\ ./configure --prefix="$INSTALL_DIR" \
./configure --prefix="$INSTALL_DIR" --with-glib=no --with-gobject=no --with-cairo=no \ --with-glib=no \
--with-fontconfig=no --with-icu=no --with-graphite2=no && --with-gobject=no \
--with-cairo=no \
--with-fontconfig=no \
--with-icu=no \
--with-graphite2=no &&
make -j$THREADS_NUMBER && make -j$THREADS_NUMBER &&
make install make install
check_error check_error
@ -199,14 +208,21 @@ build_stk()
# Freetype # Freetype
if [ ! -f "$DEPENDENCIES_DIR/freetype.stamp" ]; then if [ ! -f "$DEPENDENCIES_DIR/freetype.stamp" ]; then
echo "Compiling freetype" echo "Compiling freetype"
mkdir -p "$DEPENDENCIES_DIR/freetype" mkdir -p "$DEPENDENCIES_DIR/freetype/build"
cp -a -f "$DEPENDENCIES_DIR/../lib/freetype/"* "$DEPENDENCIES_DIR/freetype" cp -a -f "$DEPENDENCIES_DIR/../lib/freetype/"* "$DEPENDENCIES_DIR/freetype"
cd "$DEPENDENCIES_DIR/freetype" cd "$DEPENDENCIES_DIR/freetype/build"
ZLIB_CFLAGS="-I$INSTALL_INCLUDE_DIR" ZLIB_LIBS="-L$INSTALL_LIB_DIR -l:libz.so" \ rm -rf ./*
LIBPNG_CFLAGS="-I$INSTALL_INCLUDE_DIR" LIBPNG_LIBS="-L$INSTALL_LIB_DIR -l:libpng.so" \ cmake .. -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
HARFBUZZ_CFLAGS="-I$INSTALL_INCLUDE_DIR/harfbuzz" HARFBUZZ_LIBS="-L$INSTALL_LIB_DIR -l:libharfbuzz.so" \ -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
./configure --prefix="$INSTALL_DIR" --with-bzip2=no --with-harfbuzz=yes --with-png=yes --with-zlib=yes && -DBUILD_SHARED_LIBS=1 \
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=1 \
-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=1 \
-DFT_WITH_HARFBUZZ=1 \
-DFT_WITH_BZIP2=0 \
-DFT_WITH_BROTLI=0 \
-DFT_WITH_ZLIB=1 \
-DFT_WITH_PNG=1 &&
make -j$THREADS_NUMBER && make -j$THREADS_NUMBER &&
make install make install
check_error check_error
@ -224,7 +240,8 @@ build_stk()
fi fi
cd "$DEPENDENCIES_DIR/openal" cd "$DEPENDENCIES_DIR/openal"
cmake . -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \ cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
-DALSOFT_UTILS=0 \ -DALSOFT_UTILS=0 \
-DALSOFT_EXAMPLES=0 \ -DALSOFT_EXAMPLES=0 \
-DALSOFT_TESTS=0 \ -DALSOFT_TESTS=0 \
@ -236,18 +253,22 @@ build_stk()
touch "$DEPENDENCIES_DIR/openal.stamp" touch "$DEPENDENCIES_DIR/openal.stamp"
fi fi
# OpenSSL # MbedTLS
if [ ! -f "$DEPENDENCIES_DIR/openssl.stamp" ]; then if [ ! -f "$DEPENDENCIES_DIR/mbedtls.stamp" ]; then
echo "Compiling openssl" echo "Compiling mbedtls"
mkdir -p "$DEPENDENCIES_DIR/openssl" mkdir -p "$DEPENDENCIES_DIR/mbedtls"
cp -a -f "$DEPENDENCIES_DIR/../lib/openssl/"* "$DEPENDENCIES_DIR/openssl" cp -a -f "$DEPENDENCIES_DIR/../lib/mbedtls/"* "$DEPENDENCIES_DIR/mbedtls"
cd "$DEPENDENCIES_DIR/openssl" cd "$DEPENDENCIES_DIR/mbedtls"
./config --prefix="$INSTALL_DIR" && cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
-DUSE_SHARED_MBEDTLS_LIBRARY=1 \
-DENABLE_TESTING=0 \
-DENABLE_PROGRAMS=0 &&
make -j$THREADS_NUMBER && make -j$THREADS_NUMBER &&
make install make install
check_error check_error
touch "$DEPENDENCIES_DIR/openssl.stamp" touch "$DEPENDENCIES_DIR/mbedtls.stamp"
fi fi
# Curl # Curl
@ -257,19 +278,23 @@ build_stk()
cp -a -f "$DEPENDENCIES_DIR/../lib/curl/"* "$DEPENDENCIES_DIR/curl" cp -a -f "$DEPENDENCIES_DIR/../lib/curl/"* "$DEPENDENCIES_DIR/curl"
cd "$DEPENDENCIES_DIR/curl" cd "$DEPENDENCIES_DIR/curl"
CPPFLAGS="-I$INSTALL_INCLUDE_DIR" \ cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
LDFLAGS="-L$INSTALL_LIB_DIR" \ -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
./configure --prefix="$INSTALL_DIR" \ -DBUILD_TESTING=0 \
--with-ssl \ -DBUILD_CURL_EXE=0 \
--enable-shared \ -DCMAKE_USE_MBEDTLS=1 \
--enable-threaded-resolver \ -DUSE_ZLIB=1 \
--disable-ldap \ -DCMAKE_USE_OPENSSL=0 \
--without-libidn \ -DCMAKE_USE_LIBSSH=0 \
--without-libidn2 \ -DCMAKE_USE_LIBSSH2=0 \
--without-libpsl \ -DCMAKE_USE_GSSAPI=0 \
--without-librtmp \ -DUSE_NGHTTP2=0 \
--without-libssh2 && -DUSE_QUICHE=0 \
make -j$THREADS_NUMBER && \ -DHTTP_ONLY=1 \
-DCURL_CA_BUNDLE=none \
-DCURL_CA_PATH=none \
-DENABLE_THREADED_RESOLVER=1 &&
make -j$THREADS_NUMBER &&
make install make install
check_error check_error
touch "$DEPENDENCIES_DIR/curl.stamp" touch "$DEPENDENCIES_DIR/curl.stamp"
@ -283,7 +308,9 @@ build_stk()
cd "$DEPENDENCIES_DIR/libjpeg" cd "$DEPENDENCIES_DIR/libjpeg"
chmod a+x ./configure chmod a+x ./configure
cmake . -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" && ASM_NASM=yasm \
cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" &&
make -j$THREADS_NUMBER && make -j$THREADS_NUMBER &&
make install make install
check_error check_error
@ -297,6 +324,7 @@ build_stk()
cp -a -f "$DEPENDENCIES_DIR/../lib/libogg/"* "$DEPENDENCIES_DIR/libogg" cp -a -f "$DEPENDENCIES_DIR/../lib/libogg/"* "$DEPENDENCIES_DIR/libogg"
cd "$DEPENDENCIES_DIR/libogg" cd "$DEPENDENCIES_DIR/libogg"
./autogen.sh
./configure --prefix="$INSTALL_DIR" && ./configure --prefix="$INSTALL_DIR" &&
make -j$THREADS_NUMBER && make -j$THREADS_NUMBER &&
make install make install
@ -311,8 +339,8 @@ build_stk()
cp -a -f "$DEPENDENCIES_DIR/../lib/libvorbis/"* "$DEPENDENCIES_DIR/libvorbis" cp -a -f "$DEPENDENCIES_DIR/../lib/libvorbis/"* "$DEPENDENCIES_DIR/libvorbis"
cd "$DEPENDENCIES_DIR/libvorbis" cd "$DEPENDENCIES_DIR/libvorbis"
CPPFLAGS="-I$INSTALL_INCLUDE_DIR" \ ./autogen.sh
LDFLAGS="-L$INSTALL_LIB_DIR -lm" \ LDFLAGS="$LDFLAGS -lm" \
./configure --prefix="$INSTALL_DIR" && ./configure --prefix="$INSTALL_DIR" &&
make -j$THREADS_NUMBER && make -j$THREADS_NUMBER &&
make install make install
@ -371,6 +399,7 @@ build_stk()
cp -a -f "$DEPENDENCIES_DIR/../lib/bluez/"* "$DEPENDENCIES_DIR/bluez" cp -a -f "$DEPENDENCIES_DIR/../lib/bluez/"* "$DEPENDENCIES_DIR/bluez"
cd "$DEPENDENCIES_DIR/bluez" cd "$DEPENDENCIES_DIR/bluez"
./bootstrap
./configure --prefix="$INSTALL_DIR" \ ./configure --prefix="$INSTALL_DIR" \
--enable-library \ --enable-library \
--disable-debug \ --disable-debug \
@ -393,10 +422,12 @@ build_stk()
echo "Compiling sqlite" echo "Compiling sqlite"
mkdir -p "$DEPENDENCIES_DIR/sqlite" mkdir -p "$DEPENDENCIES_DIR/sqlite"
cp -a -f "$DEPENDENCIES_DIR/../lib/sqlite/"* "$DEPENDENCIES_DIR/sqlite" cp -a -f "$DEPENDENCIES_DIR/../lib/sqlite/"* "$DEPENDENCIES_DIR/sqlite"
sed -i s/' STATIC '/' SHARED '/g "$DEPENDENCIES_DIR/sqlite/CMakeLists.txt"
cd "$DEPENDENCIES_DIR/sqlite" cd "$DEPENDENCIES_DIR/sqlite"
./configure --prefix="$INSTALL_DIR" \ cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
--disable-tcl && -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
-DINSTALL_PKGCONFIG_DIR="$PKG_CONFIG_PATH" &&
make -j$THREADS_NUMBER && make -j$THREADS_NUMBER &&
make install make install
check_error check_error
@ -426,6 +457,7 @@ build_stk()
-DUSE_SYSTEM_ANGELSCRIPT=0 \ -DUSE_SYSTEM_ANGELSCRIPT=0 \
-DUSE_SYSTEM_ENET=0 \ -DUSE_SYSTEM_ENET=0 \
-DUSE_SYSTEM_WIIUSE=0 \ -DUSE_SYSTEM_WIIUSE=0 \
-DUSE_CRYPTO_OPENSSL=0 \
-DENABLE_WAYLAND_DEVICE=0 \ -DENABLE_WAYLAND_DEVICE=0 \
-DCMAKE_DISABLE_FIND_PACKAGE_Fontconfig=1 \ -DCMAKE_DISABLE_FIND_PACKAGE_Fontconfig=1 \
$STK_CMAKE_FLAGS && $STK_CMAKE_FLAGS &&