2020-05-30 18:03:01 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#
|
|
|
|
# (C) 2020 Dawid Gan, under the Holy Hedgehog License (do whatever you want)
|
|
|
|
#
|
|
|
|
|
|
|
|
# This is a build script that creates STK linux package.
|
|
|
|
#
|
|
|
|
# To run the script you need debootstrap and schroot packages, and working
|
|
|
|
# chroot environment.
|
|
|
|
#
|
|
|
|
# The build environment can be created using debootstrap:
|
|
|
|
#
|
2020-06-26 20:08:32 -04:00
|
|
|
# debootstrap --arch i386 --components=main \
|
|
|
|
# jessie ./chroot-jessie32 http://ftp.debian.org/debian
|
2020-05-30 18:03:01 -04:00
|
|
|
#
|
2020-06-26 20:08:32 -04:00
|
|
|
# debootstrap --arch amd64 --components=main \
|
|
|
|
# jessie ./chroot-jessie64 http://ftp.debian.org/debian
|
2020-05-30 18:03:01 -04:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# Here is example configuration for schroot:
|
2020-06-26 20:08:32 -04:00
|
|
|
# /etc/schroot/chroot.d/chroot-jessie32.conf
|
2020-05-30 18:03:01 -04:00
|
|
|
#
|
2020-06-26 20:08:32 -04:00
|
|
|
# [chroot-jessie32]
|
|
|
|
# description=Debian Jessie
|
2020-05-30 18:03:01 -04:00
|
|
|
# personality=linux32
|
2020-06-26 20:08:32 -04:00
|
|
|
# directory=/path/to/chroot-jessie32
|
2020-05-30 18:03:01 -04:00
|
|
|
# root-users=deve
|
|
|
|
# type=directory
|
|
|
|
# users=deve
|
|
|
|
#
|
|
|
|
#
|
2020-06-26 20:08:32 -04:00
|
|
|
# /etc/schroot/chroot.d/chroot-jessie64.conf
|
2020-05-30 18:03:01 -04:00
|
|
|
#
|
2020-06-26 20:08:32 -04:00
|
|
|
# [chroot-jessie64]
|
|
|
|
# description=Debian Jessie 64-bit
|
2020-05-30 18:03:01 -04:00
|
|
|
# #personality=linux32
|
2020-06-26 20:08:32 -04:00
|
|
|
# directory=/path/to/chroot-jessie64
|
2020-05-30 18:03:01 -04:00
|
|
|
# root-users=deve
|
|
|
|
# type=directory
|
|
|
|
# users=deve
|
|
|
|
#
|
|
|
|
#
|
2020-06-26 20:08:32 -04:00
|
|
|
# Packages that are needed to compile all STK dependencies have to be installed
|
|
|
|
# manually inside both chroot directories.
|
2020-05-30 18:03:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
export DIRNAME="$(dirname "$(readlink -f "$0")")"
|
|
|
|
|
|
|
|
######################## CONFIG ########################
|
|
|
|
|
2021-03-19 19:35:40 -04:00
|
|
|
export STK_VERSION="git`date +%Y%m%d`"
|
2020-05-30 18:03:01 -04:00
|
|
|
export THREADS_NUMBER=`nproc`
|
2024-05-03 18:52:07 -04:00
|
|
|
export SCHROOT_32BIT_NAME="chroot-buster32"
|
|
|
|
export SCHROOT_64BIT_NAME="chroot-buster64"
|
|
|
|
export SCHROOT_ARMV7_NAME="chroot-buster-armhf"
|
|
|
|
export SCHROOT_ARM64_NAME="chroot-buster-arm64"
|
2020-05-30 18:03:01 -04:00
|
|
|
|
|
|
|
export STKCODE_DIR="$DIRNAME/.."
|
|
|
|
export STKASSETS_DIR="$STKCODE_DIR/../supertuxkart-assets"
|
|
|
|
export OPENGLRECORDER_DIR="$STKCODE_DIR/../libopenglrecorder"
|
2020-05-31 18:55:49 -04:00
|
|
|
export STKEDITOR_DIR="$STKCODE_DIR/../supertuxkart-editor"
|
2020-05-30 18:03:01 -04:00
|
|
|
|
|
|
|
export BLACKLIST_LIBS="ld-linux libbsd.so libc.so libdl.so libdrm libexpat \
|
|
|
|
libGL libgl libm.so libmvec.so libpthread libresolv \
|
2021-03-25 18:22:49 -04:00
|
|
|
librt.so libX libxcb libxshm \
|
|
|
|
libEGL libgbm libwayland libffi bcm_host libvc"
|
2020-05-30 18:03:01 -04:00
|
|
|
|
2021-03-19 19:35:40 -04:00
|
|
|
export BUILD_DIR="build-linux"
|
|
|
|
export DEPENDENCIES_DIR="$STKCODE_DIR/dependencies-linux"
|
2020-05-30 18:03:01 -04:00
|
|
|
export STK_INSTALL_DIR="$STKCODE_DIR/build-linux-install"
|
|
|
|
|
2021-06-13 17:53:23 -04:00
|
|
|
export STATIC_GCC=1
|
|
|
|
|
2020-07-11 17:46:32 -04:00
|
|
|
# Use it if you build STK with Debian Jessie
|
|
|
|
export ENABLE_JESSIE_HACKS=1
|
|
|
|
|
2020-05-30 18:03:01 -04:00
|
|
|
########################################################
|
|
|
|
|
|
|
|
|
|
|
|
# A helper function that checks if error ocurred
|
|
|
|
check_error()
|
|
|
|
{
|
|
|
|
if [ $? -gt 0 ]; then
|
|
|
|
echo "Error ocurred."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
write_run_game_sh()
|
|
|
|
{
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
export INSTALL_DIR=$1
|
|
|
|
export FILE="$INSTALL_DIR/run_game.sh"
|
|
|
|
|
|
|
|
echo '#!/bin/sh' > "$FILE"
|
|
|
|
echo '' >> "$FILE"
|
|
|
|
echo 'export DIRNAME="$(dirname "$(readlink -f "$0")")"' >> "$FILE"
|
|
|
|
echo 'export SYSTEM_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"' >> "$FILE"
|
|
|
|
echo '' >> "$FILE"
|
|
|
|
echo 'export SUPERTUXKART_DATADIR="$DIRNAME"' >> "$FILE"
|
|
|
|
echo 'export SUPERTUXKART_ASSETS_DIR="$DIRNAME/data/"' >> "$FILE"
|
|
|
|
echo '' >> "$FILE"
|
|
|
|
echo 'cd "$DIRNAME"' >> "$FILE"
|
|
|
|
echo '' >> "$FILE"
|
2021-03-19 19:35:40 -04:00
|
|
|
echo 'export LD_LIBRARY_PATH="$DIRNAME/lib:$LD_LIBRARY_PATH"' >> "$FILE"
|
|
|
|
echo '"$DIRNAME/bin/supertuxkart" "$@"' >> "$FILE"
|
|
|
|
echo '' >> "$FILE"
|
2020-05-30 18:03:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
build_stk()
|
|
|
|
{
|
|
|
|
if [ -z "$1" ] || [ -z "$2" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2022-08-29 14:12:48 -04:00
|
|
|
export ARCH_OPTION="$1"
|
|
|
|
export STK_CMAKE_FLAGS="$2"
|
|
|
|
export DEPENDENCIES_DIR="$DEPENDENCIES_DIR-$ARCH_OPTION"
|
|
|
|
export BUILD_DIR="$BUILD_DIR-$ARCH_OPTION"
|
2020-05-30 18:03:01 -04:00
|
|
|
export INSTALL_DIR="$DEPENDENCIES_DIR/dependencies"
|
|
|
|
export INSTALL_LIB_DIR="$INSTALL_DIR/lib"
|
|
|
|
export INSTALL_INCLUDE_DIR="$INSTALL_DIR/include"
|
|
|
|
|
|
|
|
export PKG_CONFIG_PATH="$INSTALL_LIB_DIR/pkgconfig"
|
|
|
|
export CFLAGS="-I$INSTALL_INCLUDE_DIR"
|
|
|
|
export CPPFLAGS="-I$INSTALL_INCLUDE_DIR"
|
|
|
|
export LDFLAGS="-Wl,-rpath,$INSTALL_LIB_DIR -L$INSTALL_LIB_DIR"
|
|
|
|
|
2022-08-29 14:12:48 -04:00
|
|
|
export PATH="$INSTALL_DIR/bin:$PATH"
|
|
|
|
|
2021-06-13 17:53:23 -04:00
|
|
|
if [ "$STATIC_GCC" -gt 0 ]; then
|
|
|
|
LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++"
|
|
|
|
fi
|
|
|
|
|
2020-05-30 18:03:01 -04:00
|
|
|
cd "$STKCODE_DIR"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR"
|
|
|
|
|
2022-08-29 14:12:48 -04:00
|
|
|
# CMake
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/cmake.stamp" ]; then
|
|
|
|
echo "Compiling CMake"
|
|
|
|
git clone --depth 1 -b v3.24.1 https://github.com/Kitware/CMake.git "$DEPENDENCIES_DIR/cmake"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/cmake"
|
|
|
|
./bootstrap --prefix="$INSTALL_DIR" \
|
|
|
|
--parallel=$THREADS_NUMBER \
|
|
|
|
-- -DCMAKE_USE_OPENSSL=0 &&
|
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/cmake.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# ISPC
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/ispc.stamp" ]; then
|
|
|
|
if [ "$ARCH_OPTION" = "x86_64" ]; then
|
|
|
|
echo "Downloading ISPC"
|
|
|
|
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/ispc"
|
|
|
|
cd "$DEPENDENCIES_DIR/ispc"
|
|
|
|
ISPC_VERSION="v1.18.0"
|
|
|
|
wget https://github.com/ispc/ispc/releases/download/$ISPC_VERSION/ispc-$ISPC_VERSION-linux.tar.gz -O ispc.tar.gz
|
|
|
|
check_error
|
|
|
|
tar -xzf "ispc.tar.gz"
|
|
|
|
check_error
|
|
|
|
cp "$DEPENDENCIES_DIR/ispc/ispc-$ISPC_VERSION-linux/bin/ispc" "$INSTALL_DIR/bin/"
|
|
|
|
fi
|
|
|
|
|
|
|
|
touch "$DEPENDENCIES_DIR/ispc.stamp"
|
|
|
|
fi
|
|
|
|
|
2020-05-30 18:03:01 -04:00
|
|
|
# Zlib
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/zlib.stamp" ]; then
|
|
|
|
echo "Compiling zlib"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/zlib"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/zlib/"* "$DEPENDENCIES_DIR/zlib"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/zlib"
|
2021-06-12 02:21:02 -04:00
|
|
|
cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
2020-05-30 18:03:01 -04:00
|
|
|
-DINSTALL_PKGCONFIG_DIR="$PKG_CONFIG_PATH" &&
|
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/zlib.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Libpng
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/libpng.stamp" ]; then
|
|
|
|
echo "Compiling libpng"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/libpng"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/libpng/lib"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/libpng/"* "$DEPENDENCIES_DIR/libpng"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/libpng"
|
2020-06-26 20:08:32 -04:00
|
|
|
./configure --prefix="$INSTALL_DIR" &&
|
2020-05-30 18:03:01 -04:00
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/libpng.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Freetype bootstrap
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/freetype_bootstrap.stamp" ]; then
|
2021-06-12 02:21:02 -04:00
|
|
|
echo "Compiling freetype bootstrap"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/freetype/build"
|
2020-05-30 18:03:01 -04:00
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/freetype/"* "$DEPENDENCIES_DIR/freetype"
|
|
|
|
|
2021-06-12 02:21:02 -04:00
|
|
|
cd "$DEPENDENCIES_DIR/freetype/build"
|
|
|
|
cmake .. -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
|
|
|
-DBUILD_SHARED_LIBS=1 \
|
2022-04-24 02:54:02 -04:00
|
|
|
-DFT_DISABLE_HARFBUZZ=1 \
|
|
|
|
-DFT_DISABLE_BZIP2=1 \
|
|
|
|
-DFT_DISABLE_BROTLI=1 \
|
|
|
|
-DFT_REQUIRE_ZLIB=1 \
|
|
|
|
-DFT_REQUIRE_PNG=1 &&
|
2020-05-30 18:03:01 -04:00
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/freetype_bootstrap.stamp"
|
|
|
|
fi
|
2021-06-12 02:21:02 -04:00
|
|
|
|
2020-05-30 18:03:01 -04:00
|
|
|
# Harfbuzz
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/harfbuzz.stamp" ]; then
|
|
|
|
echo "Compiling harfbuzz"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/harfbuzz"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/harfbuzz/"* "$DEPENDENCIES_DIR/harfbuzz"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/harfbuzz"
|
2021-06-12 02:21:02 -04:00
|
|
|
./autogen.sh
|
|
|
|
./configure --prefix="$INSTALL_DIR" \
|
2022-04-24 02:54:02 -04:00
|
|
|
--with-freetype=yes \
|
2021-06-12 02:21:02 -04:00
|
|
|
--with-glib=no \
|
|
|
|
--with-gobject=no \
|
|
|
|
--with-cairo=no \
|
|
|
|
--with-fontconfig=no \
|
|
|
|
--with-icu=no \
|
|
|
|
--with-graphite2=no &&
|
2020-05-30 18:03:01 -04:00
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/harfbuzz.stamp"
|
|
|
|
fi
|
2021-06-12 02:21:02 -04:00
|
|
|
|
2020-05-30 18:03:01 -04:00
|
|
|
# Freetype
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/freetype.stamp" ]; then
|
|
|
|
echo "Compiling freetype"
|
2021-06-12 02:21:02 -04:00
|
|
|
mkdir -p "$DEPENDENCIES_DIR/freetype/build"
|
2020-05-30 18:03:01 -04:00
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/freetype/"* "$DEPENDENCIES_DIR/freetype"
|
2021-06-12 02:21:02 -04:00
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/freetype/build"
|
|
|
|
rm -rf ./*
|
|
|
|
cmake .. -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
|
|
|
-DBUILD_SHARED_LIBS=1 \
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=1 \
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=1 \
|
2022-04-24 02:54:02 -04:00
|
|
|
-DFT_REQUIRE_HARFBUZZ=1 \
|
|
|
|
-DFT_DISABLE_BZIP2=1 \
|
|
|
|
-DFT_DISABLE_BROTLI=1 \
|
|
|
|
-DFT_REQUIRE_ZLIB=1 \
|
|
|
|
-DFT_REQUIRE_PNG=1 &&
|
2020-05-30 18:03:01 -04:00
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/freetype.stamp"
|
|
|
|
fi
|
2021-06-12 02:21:02 -04:00
|
|
|
|
2020-05-30 18:03:01 -04:00
|
|
|
# Openal
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/openal.stamp" ]; then
|
|
|
|
echo "Compiling openal"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/openal"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/openal/"* "$DEPENDENCIES_DIR/openal"
|
2020-07-11 17:46:32 -04:00
|
|
|
|
|
|
|
if [ "$ENABLE_JESSIE_HACKS" -gt 0 ]; then
|
|
|
|
JESSIE_HACK="-DHAVE_LIBATOMIC=0"
|
|
|
|
fi
|
2020-05-30 18:03:01 -04:00
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/openal"
|
2021-06-12 02:21:02 -04:00
|
|
|
cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
2020-07-11 17:46:32 -04:00
|
|
|
-DALSOFT_UTILS=0 \
|
|
|
|
-DALSOFT_EXAMPLES=0 \
|
|
|
|
-DALSOFT_TESTS=0 \
|
|
|
|
-DALSOFT_BACKEND_SNDIO=0 \
|
|
|
|
$JESSIE_HACK &&
|
2020-05-30 18:03:01 -04:00
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/openal.stamp"
|
|
|
|
fi
|
|
|
|
|
2021-06-12 02:21:02 -04:00
|
|
|
# MbedTLS
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/mbedtls.stamp" ]; then
|
|
|
|
echo "Compiling mbedtls"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/mbedtls"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/mbedtls/"* "$DEPENDENCIES_DIR/mbedtls"
|
2020-05-30 18:03:01 -04:00
|
|
|
|
2021-06-12 02:21:02 -04:00
|
|
|
cd "$DEPENDENCIES_DIR/mbedtls"
|
|
|
|
cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
|
|
|
-DUSE_SHARED_MBEDTLS_LIBRARY=1 \
|
|
|
|
-DENABLE_TESTING=0 \
|
|
|
|
-DENABLE_PROGRAMS=0 &&
|
2020-05-30 18:03:01 -04:00
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
2021-06-12 02:21:02 -04:00
|
|
|
touch "$DEPENDENCIES_DIR/mbedtls.stamp"
|
2020-05-30 18:03:01 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Curl
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/curl.stamp" ]; then
|
|
|
|
echo "Compiling curl"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/curl"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/curl/"* "$DEPENDENCIES_DIR/curl"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/curl"
|
2021-06-12 02:21:02 -04:00
|
|
|
cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
|
|
|
-DBUILD_TESTING=0 \
|
|
|
|
-DBUILD_CURL_EXE=0 \
|
2022-04-13 22:29:05 -04:00
|
|
|
-DCURL_USE_MBEDTLS=1 \
|
|
|
|
-DCURL_USE_OPENSSL=0 \
|
|
|
|
-DCURL_USE_LIBSSH=0 \
|
|
|
|
-DCURL_USE_LIBSSH2=0 \
|
|
|
|
-DCURL_USE_GSSAPI=0 \
|
2024-05-03 18:52:07 -04:00
|
|
|
-DCURL_USE_LIBPSL=0 \
|
|
|
|
-DUSE_ZLIB=1 \
|
2021-06-12 02:21:02 -04:00
|
|
|
-DUSE_NGHTTP2=0 \
|
|
|
|
-DUSE_QUICHE=0 \
|
2024-05-03 18:52:07 -04:00
|
|
|
-DUSE_LIBIDN2=0 \
|
2021-06-12 02:21:02 -04:00
|
|
|
-DHTTP_ONLY=1 \
|
|
|
|
-DCURL_CA_BUNDLE=none \
|
|
|
|
-DCURL_CA_PATH=none \
|
|
|
|
-DENABLE_THREADED_RESOLVER=1 &&
|
|
|
|
make -j$THREADS_NUMBER &&
|
2020-05-30 18:03:01 -04:00
|
|
|
make install
|
|
|
|
check_error
|
2022-08-29 14:12:48 -04:00
|
|
|
rm -rf "$INSTALL_DIR/lib/cmake/CURL"
|
2020-05-30 18:03:01 -04:00
|
|
|
touch "$DEPENDENCIES_DIR/curl.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Libjpeg
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/libjpeg.stamp" ]; then
|
|
|
|
echo "Compiling libjpeg"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/libjpeg"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/libjpeg/"* "$DEPENDENCIES_DIR/libjpeg"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/libjpeg"
|
|
|
|
chmod a+x ./configure
|
2021-06-12 02:21:02 -04:00
|
|
|
ASM_NASM=yasm \
|
|
|
|
cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" &&
|
2020-05-30 18:03:01 -04:00
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/libjpeg.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Libogg
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/libogg.stamp" ]; then
|
|
|
|
echo "Compiling libogg"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/libogg"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/libogg/"* "$DEPENDENCIES_DIR/libogg"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/libogg"
|
2021-06-12 02:21:02 -04:00
|
|
|
./autogen.sh
|
2020-05-30 18:03:01 -04:00
|
|
|
./configure --prefix="$INSTALL_DIR" &&
|
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/libogg.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Libvorbis
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/libvorbis.stamp" ]; then
|
|
|
|
echo "Compiling libvorbis"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/libvorbis"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/libvorbis/"* "$DEPENDENCIES_DIR/libvorbis"
|
2021-06-13 17:53:23 -04:00
|
|
|
|
2020-05-30 18:03:01 -04:00
|
|
|
cd "$DEPENDENCIES_DIR/libvorbis"
|
2021-06-13 17:53:23 -04:00
|
|
|
cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
|
|
|
-DBUILD_SHARED_LIBS=1 &&
|
2020-05-30 18:03:01 -04:00
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/libvorbis.stamp"
|
|
|
|
fi
|
2022-08-29 14:12:48 -04:00
|
|
|
|
2023-02-03 16:20:57 -05:00
|
|
|
# Shaderc
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/shaderc.stamp" ]; then
|
|
|
|
echo "Compiling shaderc"
|
|
|
|
|
|
|
|
"$DEPENDENCIES_DIR/../lib/shaderc/utils/git-sync-deps"
|
|
|
|
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/shaderc"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/shaderc/"* "$DEPENDENCIES_DIR/shaderc"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/shaderc"
|
|
|
|
cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_C_FLAGS="-fpic -O3" \
|
|
|
|
-DCMAKE_CXX_FLAGS="-fpic -O3" \
|
|
|
|
-DSHADERC_SKIP_INSTALL=1 \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DSHADERC_SKIP_TESTS=1 \
|
|
|
|
-DSHADERC_SKIP_EXAMPLES=1 \
|
|
|
|
-DSPIRV_HEADERS_SKIP_INSTALL=1 \
|
|
|
|
-DSPIRV_HEADERS_SKIP_EXAMPLES=1 \
|
|
|
|
-DSKIP_SPIRV_TOOLS_INSTALL=1 \
|
|
|
|
-DSPIRV_SKIP_TESTS=1 \
|
|
|
|
-DSPIRV_SKIP_EXECUTABLES=1 \
|
|
|
|
-DENABLE_GLSLANG_BINARIES=0 \
|
|
|
|
-DENABLE_CTEST=0 &&
|
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
cp "$DEPENDENCIES_DIR/shaderc/libshaderc/libshaderc"* "$INSTALL_DIR/lib/" &&
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/shaderc/libshaderc/include/"* "$INSTALL_DIR/include/"
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/shaderc.stamp"
|
|
|
|
fi
|
|
|
|
|
2022-08-29 14:12:48 -04:00
|
|
|
# ASTC-encoder
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/astc-encoder.stamp" ]; then
|
|
|
|
echo "Compiling astc-encoder"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/astc-encoder"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/astc-encoder/"* "$DEPENDENCIES_DIR/astc-encoder"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/astc-encoder"
|
|
|
|
sed -i '/-Werror/d' Source/cmake_core.cmake
|
|
|
|
sed -i 's|${ASTC_TARGET}-static|astcenc|g' Source/cmake_core.cmake
|
|
|
|
if [ "$ARCH_OPTION" = "armv7" ]; then
|
|
|
|
ASTC_CMAKE_FLAGS=""
|
|
|
|
ASTC_CFLAGS="-mfpu=neon"
|
|
|
|
elif [ "$ARCH_OPTION" = "arm64" ]; then
|
|
|
|
ASTC_CMAKE_FLAGS="-DISA_NEON=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
|
|
|
|
elif [ "$ARCH_OPTION" = "x86" ]; then
|
|
|
|
#ASTC_CMAKE_FLAGS="-DISA_SSE2=ON"
|
|
|
|
ASTC_CMAKE_FLAGS=""
|
|
|
|
elif [ "$ARCH_OPTION" = "x86_64" ]; then
|
|
|
|
ASTC_CMAKE_FLAGS="-DISA_SSE41=ON"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
|
|
|
$ASTC_CMAKE_FLAGS \
|
|
|
|
-DCMAKE_C_FLAGS="-fpic -O3 -g $ASTC_CFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS="-fpic -O3 -g $ASTC_CFLAGS" \
|
|
|
|
-DNO_INVARIANCE=ON -DCLI=OFF &&
|
|
|
|
make -j$THREADS_NUMBER &&
|
2024-05-03 18:52:07 -04:00
|
|
|
cp "$DEPENDENCIES_DIR/astc-encoder/Source/libastcenc-native-static.a" "$INSTALL_DIR/lib/" &&
|
2022-08-29 14:12:48 -04:00
|
|
|
cp "$DEPENDENCIES_DIR/astc-encoder/Source/astcenc.h" "$INSTALL_DIR/include/"
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/astc-encoder.stamp"
|
|
|
|
fi
|
2020-05-30 18:03:01 -04:00
|
|
|
|
|
|
|
# Wayland
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/wayland.stamp" ]; then
|
|
|
|
echo "Compiling wayland"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/wayland"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/wayland/"* "$DEPENDENCIES_DIR/wayland"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/wayland"
|
|
|
|
./autogen.sh
|
2020-06-26 20:08:32 -04:00
|
|
|
./configure --prefix="$INSTALL_DIR" --disable-documentation &&
|
2020-05-30 18:03:01 -04:00
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/wayland.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# SDL2
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/sdl2.stamp" ]; then
|
|
|
|
echo "Compiling SDL2"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/sdl2"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/sdl2/"* "$DEPENDENCIES_DIR/sdl2"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/sdl2"
|
|
|
|
./configure --prefix="$INSTALL_DIR" &&
|
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/sdl2.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Libvpx
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/libvpx.stamp" ]; then
|
|
|
|
echo "Compiling libvpx"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/libvpx"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/libvpx/"* "$DEPENDENCIES_DIR/libvpx"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/libvpx"
|
|
|
|
./configure --prefix="$INSTALL_DIR" \
|
|
|
|
--enable-shared &&
|
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/libvpx.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Libbluetooth
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/bluez.stamp" ]; then
|
|
|
|
echo "Compiling libbluetooth"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/bluez"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/bluez/"* "$DEPENDENCIES_DIR/bluez"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/bluez"
|
2021-06-12 02:21:02 -04:00
|
|
|
./bootstrap
|
2020-05-30 18:03:01 -04:00
|
|
|
./configure --prefix="$INSTALL_DIR" \
|
|
|
|
--enable-library \
|
|
|
|
--disable-debug \
|
|
|
|
--disable-systemd \
|
|
|
|
--disable-tools \
|
|
|
|
--disable-obex \
|
|
|
|
--disable-cups \
|
|
|
|
--disable-client \
|
|
|
|
--disable-datafiles \
|
|
|
|
--disable-monitor \
|
|
|
|
--disable-udev &&
|
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/bluez.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Sqlite
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/sqlite.stamp" ]; then
|
|
|
|
echo "Compiling sqlite"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/sqlite"
|
|
|
|
cp -a -f "$DEPENDENCIES_DIR/../lib/sqlite/"* "$DEPENDENCIES_DIR/sqlite"
|
2021-06-12 02:21:02 -04:00
|
|
|
sed -i s/' STATIC '/' SHARED '/g "$DEPENDENCIES_DIR/sqlite/CMakeLists.txt"
|
2020-05-30 18:03:01 -04:00
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/sqlite"
|
2021-06-12 02:21:02 -04:00
|
|
|
cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
2024-05-03 18:52:07 -04:00
|
|
|
-DINSTALL_PKGCONFIG_DIR="$PKG_CONFIG_PATH" \
|
|
|
|
-DENABLE_READLINE=0 &&
|
2020-05-30 18:03:01 -04:00
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/sqlite.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Openglrecorder
|
|
|
|
if [ ! -f "$DEPENDENCIES_DIR/openglrecorder.stamp" ]; then
|
|
|
|
echo "Compiling openglrecorder"
|
|
|
|
mkdir -p "$DEPENDENCIES_DIR/openglrecorder"
|
|
|
|
cp -a -f "$OPENGLRECORDER_DIR/"* "$DEPENDENCIES_DIR/openglrecorder"
|
|
|
|
|
|
|
|
cd "$DEPENDENCIES_DIR/openglrecorder"
|
|
|
|
cmake . -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
|
|
|
|
-DBUILD_PULSE_WO_DL=0 &&
|
|
|
|
make -j$THREADS_NUMBER &&
|
|
|
|
make install
|
|
|
|
check_error
|
|
|
|
touch "$DEPENDENCIES_DIR/openglrecorder.stamp"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Supertuxkart
|
2020-05-31 18:55:49 -04:00
|
|
|
mkdir -p "$STKCODE_DIR/$BUILD_DIR"
|
|
|
|
cd "$STKCODE_DIR/$BUILD_DIR"
|
2022-08-29 14:12:48 -04:00
|
|
|
|
|
|
|
if [ -f "$INSTALL_DIR/bin/ispc" ]; then
|
|
|
|
HAS_ISPC=1
|
|
|
|
else
|
|
|
|
HAS_ISPC=0
|
|
|
|
fi
|
|
|
|
|
2020-05-30 18:03:01 -04:00
|
|
|
cmake .. -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DUSE_SYSTEM_ANGELSCRIPT=0 \
|
|
|
|
-DUSE_SYSTEM_ENET=0 \
|
|
|
|
-DUSE_SYSTEM_WIIUSE=0 \
|
2021-06-12 02:21:02 -04:00
|
|
|
-DUSE_CRYPTO_OPENSSL=0 \
|
2020-05-30 18:03:01 -04:00
|
|
|
-DENABLE_WAYLAND_DEVICE=0 \
|
2022-08-29 14:12:48 -04:00
|
|
|
-DBC7_ISPC=$HAS_ISPC \
|
2020-05-30 18:03:01 -04:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Fontconfig=1 \
|
|
|
|
$STK_CMAKE_FLAGS &&
|
|
|
|
make -j$THREADS_NUMBER
|
|
|
|
check_error
|
2020-05-31 18:55:49 -04:00
|
|
|
|
|
|
|
# Stk editor
|
|
|
|
mkdir -p "$STKEDITOR_DIR/$BUILD_DIR"
|
|
|
|
cd "$STKEDITOR_DIR/$BUILD_DIR"
|
|
|
|
cmake .. -DCMAKE_FIND_ROOT_PATH="$INSTALL_DIR" \
|
|
|
|
-DSTATIC_ZLIB=1 \
|
|
|
|
-DSTATIC_PHYSFS=1 \
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Fontconfig=1 \
|
|
|
|
$STK_CMAKE_FLAGS &&
|
|
|
|
make -j$THREADS_NUMBER
|
|
|
|
check_error
|
2020-05-30 18:03:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
copy_libraries()
|
|
|
|
{
|
|
|
|
if [ -z "$1" ] || [ -z "$2" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2022-08-29 14:12:48 -04:00
|
|
|
export ARCH_OPTION="$1"
|
|
|
|
export LIB_INSTALL_DIR="$2"
|
|
|
|
export DEPENDENCIES_DIR="$DEPENDENCIES_DIR-$ARCH_OPTION"
|
|
|
|
export BUILD_DIR="$BUILD_DIR-$ARCH_OPTION"
|
2020-05-30 18:03:01 -04:00
|
|
|
|
2020-05-31 18:55:49 -04:00
|
|
|
if [ -z "$DEPENDENCIES_DIR" ] || [ -z "$BUILD_DIR" ] || [ -z "$LIB_INSTALL_DIR" ]; then
|
2020-05-30 18:03:01 -04:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
LIBRARIES_LIST=`LD_LIBRARY_PATH="$DEPENDENCIES_DIR/dependencies/lib" \
|
2020-05-31 18:55:49 -04:00
|
|
|
ldd "$STKCODE_DIR/$BUILD_DIR/bin/supertuxkart" | \
|
|
|
|
cut -d">" -f2 | cut -d"(" -f1 | grep "\.so"`
|
2020-05-30 18:03:01 -04:00
|
|
|
|
|
|
|
for FILE in $LIBRARIES_LIST; do
|
|
|
|
BLACKLISTED=0
|
|
|
|
|
|
|
|
for BLACKLIST_LIB in $BLACKLIST_LIBS; do
|
|
|
|
if [ `echo "$FILE" | grep -c "$BLACKLIST_LIB"` -gt 0 ]; then
|
|
|
|
BLACKLISTED=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ $BLACKLISTED -eq 1 ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "$FILE" ]; then
|
|
|
|
echo " Copying $FILE"
|
|
|
|
cp -L "$FILE" "$LIB_INSTALL_DIR"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
test_package()
|
|
|
|
{
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
PACKAGE_DIR="$1"
|
2021-03-19 19:35:40 -04:00
|
|
|
BINARY_ARCH="$2"
|
2020-05-30 18:03:01 -04:00
|
|
|
|
2021-03-19 19:35:40 -04:00
|
|
|
if [ `objdump -a "$PACKAGE_DIR/bin/supertuxkart" | grep -c "$BINARY_ARCH"` -eq 0 ]; then
|
|
|
|
echo "Error: bin/supertuxkart is not $BINARY_ARCH"
|
2020-05-30 18:03:01 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-03-19 19:35:40 -04:00
|
|
|
if [ `objdump -a "$PACKAGE_DIR/bin/supertuxkart-editor" | grep -c "$BINARY_ARCH"` -eq 0 ]; then
|
|
|
|
echo "Error: bin/supertuxkart-editor is not $BINARY_ARCH"
|
2020-05-31 18:55:49 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-05-30 18:03:01 -04:00
|
|
|
if [ `LD_LIBRARY_PATH="$PACKAGE_DIR/lib" ldd "$PACKAGE_DIR/bin/supertuxkart" | grep -c "not found"` -gt 0 ]; then
|
|
|
|
echo "Error: bin/supertuxkart has some missing libraries"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-05-31 18:55:49 -04:00
|
|
|
if [ `ldd "$PACKAGE_DIR/bin/supertuxkart-editor" | grep -c "not found"` -gt 0 ]; then
|
|
|
|
echo "Error: bin/supertuxkart-editor has some missing libraries"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-05-30 18:03:01 -04:00
|
|
|
LD_LIBRARY_PATH="$PACKAGE_DIR/lib" "$PACKAGE_DIR/bin/supertuxkart" --version
|
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo "Error: Couldn't start bin/supertuxkart"
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-03-19 19:35:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
create_package()
|
|
|
|
{
|
|
|
|
SCHROOT_NAME="$1"
|
|
|
|
ARCH="$2"
|
|
|
|
BINARY_ARCH="$3"
|
2020-05-30 18:03:01 -04:00
|
|
|
|
2021-03-19 19:35:40 -04:00
|
|
|
echo "Building $ARCH version..."
|
2020-05-30 18:03:01 -04:00
|
|
|
|
2022-08-29 14:12:48 -04:00
|
|
|
schroot -c $SCHROOT_NAME -- "$0" build_stk "$ARCH" "-DDEBUG_SYMBOLS=1"
|
2021-03-19 19:35:40 -04:00
|
|
|
|
|
|
|
if [ ! -f "$STKCODE_DIR/$BUILD_DIR-$ARCH/bin/supertuxkart" ]; then
|
|
|
|
echo "Couldn't build $ARCH version."
|
2020-05-30 18:03:01 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
2021-03-19 19:35:40 -04:00
|
|
|
|
|
|
|
echo "Prepare package..."
|
|
|
|
|
|
|
|
STK_PACKAGE_DIR="$STK_INSTALL_DIR/SuperTuxKart-$STK_VERSION-linux-$ARCH"
|
|
|
|
|
|
|
|
if [ -f "$STK_PACKAGE_DIR" ]; then
|
|
|
|
rm -rf "$STK_PACKAGE_DIR"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$STK_PACKAGE_DIR"
|
|
|
|
mkdir -p "$STK_PACKAGE_DIR/bin"
|
|
|
|
mkdir -p "$STK_PACKAGE_DIR/lib"
|
|
|
|
|
2022-08-29 14:12:48 -04:00
|
|
|
schroot -c $SCHROOT_NAME -- "$0" copy_libraries "$ARCH" "$STK_PACKAGE_DIR/lib"
|
2021-03-19 19:35:40 -04:00
|
|
|
|
|
|
|
find "$STK_PACKAGE_DIR/lib" -type f -exec strip -s {} \;
|
|
|
|
|
2021-06-13 17:53:23 -04:00
|
|
|
if [ "$STATIC_GCC" -eq 0 ]; then
|
|
|
|
mv "$STK_PACKAGE_DIR/lib/libgcc_s.so.1" "$STK_PACKAGE_DIR/lib/libgcc_s.so.1-orig"
|
|
|
|
mv "$STK_PACKAGE_DIR/lib/libstdc++.so.6" "$STK_PACKAGE_DIR/lib/libstdc++.so.6-orig"
|
|
|
|
fi
|
2021-03-19 19:35:40 -04:00
|
|
|
|
|
|
|
write_run_game_sh "$STK_PACKAGE_DIR"
|
|
|
|
|
|
|
|
cp "$STKCODE_DIR/$BUILD_DIR-$ARCH/bin/supertuxkart" "$STK_INSTALL_DIR/supertuxkart-$STK_VERSION-linux-$ARCH-symbols"
|
|
|
|
cp "$STKEDITOR_DIR/$BUILD_DIR-$ARCH/bin/supertuxkart-editor" "$STK_INSTALL_DIR/supertuxkart-editor-$STK_VERSION-linux-$ARCH-symbols"
|
|
|
|
|
|
|
|
cp -a "$STKCODE_DIR/$BUILD_DIR-$ARCH/bin/supertuxkart" "$STK_PACKAGE_DIR/bin/"
|
|
|
|
cp -a "$STKEDITOR_DIR/$BUILD_DIR-$ARCH/bin/supertuxkart-editor" "$STK_PACKAGE_DIR/bin/"
|
|
|
|
|
|
|
|
cp -a "$STKCODE_DIR/data/." "$STK_PACKAGE_DIR/data"
|
|
|
|
cp -a "$STKASSETS_DIR/editor" "$STK_PACKAGE_DIR/data/"
|
|
|
|
cp -a "$STKASSETS_DIR/karts" "$STK_PACKAGE_DIR/data/"
|
|
|
|
cp -a "$STKASSETS_DIR/library" "$STK_PACKAGE_DIR/data/"
|
|
|
|
cp -a "$STKASSETS_DIR/models" "$STK_PACKAGE_DIR/data/"
|
|
|
|
cp -a "$STKASSETS_DIR/music" "$STK_PACKAGE_DIR/data/"
|
|
|
|
cp -a "$STKASSETS_DIR/sfx" "$STK_PACKAGE_DIR/data/"
|
|
|
|
cp -a "$STKASSETS_DIR/textures" "$STK_PACKAGE_DIR/data/"
|
|
|
|
cp -a "$STKASSETS_DIR/tracks" "$STK_PACKAGE_DIR/data/"
|
|
|
|
cp -a "$STKASSETS_DIR/licenses.txt" "$STK_PACKAGE_DIR/data/"
|
|
|
|
|
|
|
|
strip --strip-debug "$STK_PACKAGE_DIR/bin/supertuxkart"
|
|
|
|
strip --strip-debug "$STK_PACKAGE_DIR/bin/supertuxkart-editor"
|
|
|
|
|
2022-01-05 17:33:19 -05:00
|
|
|
find "$STK_PACKAGE_DIR/bin" -type f -exec chrpath -d {} \;
|
|
|
|
find "$STK_PACKAGE_DIR/lib" -type f -exec chrpath -d {} \;
|
|
|
|
|
2021-03-19 19:35:40 -04:00
|
|
|
chmod a+rwx "$STK_PACKAGE_DIR" -R
|
|
|
|
find "$STK_PACKAGE_DIR" -type f -exec chmod a-x {} \;
|
|
|
|
find "$STK_PACKAGE_DIR/bin" -type f -exec chmod a+x {} \;
|
|
|
|
chmod a+x "$STK_PACKAGE_DIR/run_game.sh"
|
|
|
|
|
2021-03-25 18:22:49 -04:00
|
|
|
schroot -c $SCHROOT_NAME -- "$0" test_package "$STK_PACKAGE_DIR" "$BINARY_ARCH"
|
2021-03-19 19:35:40 -04:00
|
|
|
|
|
|
|
# Compress package
|
|
|
|
|
|
|
|
echo "Compress package..."
|
|
|
|
|
|
|
|
cd "$STK_INSTALL_DIR"
|
2024-05-03 18:52:07 -04:00
|
|
|
tar -czf "SuperTuxKart-$STK_VERSION-linux-$ARCH.tar.gz" "SuperTuxKart-$STK_VERSION-linux-$ARCH"
|
2021-03-19 19:35:40 -04:00
|
|
|
cd -
|
2020-05-30 18:03:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Handle clean command
|
|
|
|
if [ ! -z "$1" ] && [ "$1" = "clean" ]; then
|
2021-03-19 19:35:40 -04:00
|
|
|
rm -rf "$DEPENDENCIES_DIR-"*
|
|
|
|
rm -rf "$STKCODE_DIR/$BUILD_DIR-"*
|
|
|
|
rm -rf "$STKEDITOR_DIR/$BUILD_DIR-"*
|
2020-05-30 18:03:01 -04:00
|
|
|
rm -rf "$STK_INSTALL_DIR"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Handle build_stk command (internal only)
|
|
|
|
if [ ! -z "$1 " ] && [ "$1" = "build_stk" ]; then
|
2022-08-29 14:12:48 -04:00
|
|
|
build_stk "$2" "$3"
|
2020-05-30 18:03:01 -04:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Handle copy_libraries command (internal only)
|
|
|
|
if [ ! -z "$1 " ] && [ "$1" = "copy_libraries" ]; then
|
2022-08-29 14:12:48 -04:00
|
|
|
copy_libraries "$2" "$3"
|
2020-05-30 18:03:01 -04:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2021-03-25 18:22:49 -04:00
|
|
|
# Handle test_package command (internal only)
|
|
|
|
if [ ! -z "$1 " ] && [ "$1" = "test_package" ]; then
|
|
|
|
test_package "$2" "$3"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2020-05-30 18:03:01 -04:00
|
|
|
# Building STK
|
|
|
|
|
2022-08-29 14:12:48 -04:00
|
|
|
create_package "$SCHROOT_32BIT_NAME" "x86" "elf32-i386"
|
|
|
|
create_package "$SCHROOT_64BIT_NAME" "x86_64" "elf64-x86-64"
|
2021-03-25 18:22:49 -04:00
|
|
|
create_package "$SCHROOT_ARMV7_NAME" "armv7" "elf32-littlearm"
|
|
|
|
create_package "$SCHROOT_ARM64_NAME" "arm64" "elf64-littleaarch64"
|
2020-05-30 18:03:01 -04:00
|
|
|
|
|
|
|
echo "Success."
|