1
0
forked from 0ad/0ad

Format shell scripts using shfmt

This updates shell scripts to use a consistent style that can be enforced
via pre-commit hook.

As for choosing tabs over spaces, some arguments are:

- tabs can help people with visual impairment
- tabs allow for indenting heredocs in bash
- tabs are the default for the tool shfmt

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2024-08-25 11:55:44 +02:00
parent c763c010b8
commit abdda50892
16 changed files with 788 additions and 816 deletions

View File

@ -61,7 +61,6 @@ fi
popd popd
if [ "$build_toolchain" = "true" ]; then if [ "$build_toolchain" = "true" ]; then
rm -r $TOOLCHAIN || true rm -r $TOOLCHAIN || true

View File

@ -17,7 +17,10 @@ for APPDIR in ../workspaces/gcc/obj/*; do
fi fi
done done
(cd ../../binaries/system/; ./test_dbg) (
cd ../../binaries/system/
./test_dbg
)
for APPDIR in ../workspaces/gcc/obj/*; do for APPDIR in ../workspaces/gcc/obj/*; do
lcov -d "$APPDIR" -b ../workspaces/gcc --capture -o temp.info && lcov -d "$APPDIR" -b ../workspaces/gcc --capture -o temp.info &&
@ -30,4 +33,7 @@ lcov -r app.info '*/third_party/*' -o app.info
rm -rf output rm -rf output
mkdir output mkdir output
(cd output; genhtml ../app.info) (
cd output
genhtml ../app.info
)

View File

@ -0,0 +1 @@
premake-5-alpha-14+wildfiregames.1

View File

@ -3,8 +3,7 @@ set -e
LIB_VERSION="premake-5-alpha-14+wildfiregames.1" LIB_VERSION="premake-5-alpha-14+wildfiregames.1"
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ] if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]; then
then
echo "Premake 5 is already up to date." echo "Premake 5 is already up to date."
exit exit
fi fi

View File

@ -35,8 +35,7 @@ enable_atlas=true
JOBS=${JOBS:="-j2"} JOBS=${JOBS:="-j2"}
for i in "$@" for i in "$@"; do
do
case $i in case $i in
--with-system-premake5) with_system_premake5=true ;; --with-system-premake5) with_system_premake5=true ;;
--enable-atlas) enable_atlas=true ;; --enable-atlas) enable_atlas=true ;;
@ -56,8 +55,7 @@ if [ "$enable_atlas" = "true" ]; then
export WX_CONFIG="${WX_CONFIG:="wx-config"}" export WX_CONFIG="${WX_CONFIG:="wx-config"}"
fi fi
if [ ! -x "$(command -v $WX_CONFIG)" ] if [ ! -x "$(command -v $WX_CONFIG)" ]; then
then
echo 'WX_CONFIG must be set and valid or wx-config must be present when --atlas is passed as argument.' echo 'WX_CONFIG must be set and valid or wx-config must be present when --atlas is passed as argument.'
exit 1 exit 1
fi fi

View File

@ -100,7 +100,7 @@ ARCHLESS_LDFLAGS="$LDFLAGS -stdlib=libc++"
# If ARCH isn't set, select either x86_64 or arm64 # If ARCH isn't set, select either x86_64 or arm64
if [ -z "${ARCH}" ]; then if [ -z "${ARCH}" ]; then
ARCH=`uname -m` ARCH=$(uname -m)
fi fi
if [ $ARCH == "arm64" ]; then if [ $ARCH == "arm64" ]; then
# Some libs want this passed to configure for cross compilation. # Some libs want this passed to configure for cross compilation.
@ -146,15 +146,14 @@ already_built()
} }
# Check that we're actually on macOS # Check that we're actually on macOS
if [ "`uname -s`" != "Darwin" ]; then if [ "$(uname -s)" != "Darwin" ]; then
die "This script is intended for macOS only" die "This script is intended for macOS only"
fi fi
# Parse command-line options: # Parse command-line options:
force_rebuild=false force_rebuild=false
for i in "$@" for i in "$@"; do
do
case $i in case $i in
--force-rebuild) force_rebuild=true ;; --force-rebuild) force_rebuild=true ;;
-j*) JOBS=$i ;; -j*) JOBS=$i ;;
@ -165,10 +164,9 @@ cd "$(dirname $0)" # Now in libraries/ (where we assume this script resides)
mkdir -p macos mkdir -p macos
cd macos cd macos
# Create a location to create copies of dependencies' *.pc files, so they can be found by pkg-config # Create a location to create copies of dependencies' *.pc files, so they can be found by pkg-config
PC_PATH="$(pwd)/pkgconfig/" PC_PATH="$(pwd)/pkgconfig/"
if [[ "$force_rebuild" = "true" ]]; then if [[ $force_rebuild == "true" ]]; then
rm -rf $PC_PATH rm -rf $PC_PATH
fi fi
mkdir -p $PC_PATH mkdir -p $PC_PATH
@ -186,8 +184,7 @@ pushd zlib > /dev/null
ZLIB_DIR="$(pwd)" ZLIB_DIR="$(pwd)"
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
rm -f .already-built rm -f .already-built
download_lib $LIB_URL $LIB_ARCHIVE download_lib $LIB_URL $LIB_ARCHIVE
@ -196,11 +193,11 @@ then
pushd $LIB_DIRECTORY pushd $LIB_DIRECTORY
# patch zlib's configure script to use our CFLAGS and LDFLAGS # patch zlib's configure script to use our CFLAGS and LDFLAGS
(patch -Np0 -i ../../../macos-patches/zlib_flags.diff \ (patch -Np0 -i ../../../macos-patches/zlib_flags.diff &&
&& CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \ CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \
./configure --prefix="$ZLIB_DIR" \ ./configure --prefix="$ZLIB_DIR" \
--static \ --static &&
&& make ${JOBS} && make install) || die "zlib build failed" make ${JOBS} && make install) || die "zlib build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -221,8 +218,7 @@ LIB_URL="http://curl.haxx.se/download/"
mkdir -p libcurl mkdir -p libcurl
pushd libcurl >/dev/null pushd libcurl >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -258,8 +254,8 @@ then
--disable-ldaps \ --disable-ldaps \
--without-libidn2 \ --without-libidn2 \
--with-zlib="${ZLIB_DIR}" \ --with-zlib="${ZLIB_DIR}" \
--enable-shared=no \ --enable-shared=no &&
&& make ${JOBS} && make install) || die "libcurl build failed" make ${JOBS} && make install) || die "libcurl build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -282,8 +278,7 @@ pushd iconv > /dev/null
ICONV_DIR="$(pwd)" ICONV_DIR="$(pwd)"
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
rm -f .already-built rm -f .already-built
download_lib $LIB_URL $LIB_ARCHIVE download_lib $LIB_URL $LIB_ARCHIVE
@ -297,8 +292,8 @@ then
--without-libiconv-prefix \ --without-libiconv-prefix \
--without-libintl-prefix \ --without-libintl-prefix \
--disable-nls \ --disable-nls \
--enable-shared=no \ --enable-shared=no &&
&& make ${JOBS} && make install) || die "libiconv build failed" make ${JOBS} && make install) || die "libiconv build failed"
popd popd
echo "$LIB_VERSION" >.already-built echo "$LIB_VERSION" >.already-built
else else
@ -317,8 +312,7 @@ LIB_URL="ftp://xmlsoft.org/libxml2/"
mkdir -p libxml2 mkdir -p libxml2
pushd libxml2 >/dev/null pushd libxml2 >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -335,8 +329,8 @@ then
--without-python \ --without-python \
--with-iconv="${ICONV_DIR}" \ --with-iconv="${ICONV_DIR}" \
--with-zlib="${ZLIB_DIR}" \ --with-zlib="${ZLIB_DIR}" \
--enable-shared=no \ --enable-shared=no &&
&& make ${JOBS} && make install) || die "libxml2 build failed" make ${JOBS} && make install) || die "libxml2 build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -358,8 +352,7 @@ LIB_URL="https://libsdl.org/release/"
mkdir -p sdl2 mkdir -p sdl2
pushd sdl2 >/dev/null pushd sdl2 >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -379,8 +372,8 @@ then
--disable-video-x11 \ --disable-video-x11 \
--without-x \ --without-x \
--enable-video-cocoa \ --enable-video-cocoa \
--enable-shared=no \ --enable-shared=no &&
&& make $JOBS && make install) || die "SDL2 build failed" make $JOBS && make install) || die "SDL2 build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -401,8 +394,7 @@ LIB_URL="https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/"
mkdir -p boost mkdir -p boost
pushd boost >/dev/null pushd boost >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -413,9 +405,10 @@ then
pushd $LIB_DIRECTORY pushd $LIB_DIRECTORY
# Can't use macosx-version, see above comment. # Can't use macosx-version, see above comment.
(./bootstrap.sh --with-libraries=filesystem,system \ (
--prefix=$INSTALL_DIR \ ./bootstrap.sh --with-libraries=filesystem,system \
&& ./b2 cflags="$CFLAGS" \ --prefix=$INSTALL_DIR &&
./b2 cflags="$CFLAGS" \
toolset=clang \ toolset=clang \
cxxflags="$CXXFLAGS" \ cxxflags="$CXXFLAGS" \
linkflags="$LDFLAGS" ${JOBS} \ linkflags="$LDFLAGS" ${JOBS} \
@ -424,7 +417,7 @@ then
--debug-configuration \ --debug-configuration \
link=static \ link=static \
threading=multi \ threading=multi \
variant=release install \ variant=release install
) || die "Boost build failed" ) || die "Boost build failed"
popd popd
@ -446,8 +439,7 @@ LIB_URL="http://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/"
mkdir -p wxwidgets mkdir -p wxwidgets
pushd wxwidgets >/dev/null pushd wxwidgets >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -486,8 +478,8 @@ then
(../configure CFLAGS="$ARCHLESS_CFLAGS" \ (../configure CFLAGS="$ARCHLESS_CFLAGS" \
CXXFLAGS="$ARCHLESS_CXXFLAGS" \ CXXFLAGS="$ARCHLESS_CXXFLAGS" \
CPPFLAGS="-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=1" \ CPPFLAGS="-D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=1" \
LDFLAGS="$ARCHLESS_LDFLAGS" $CONF_OPTS \ LDFLAGS="$ARCHLESS_LDFLAGS" $CONF_OPTS &&
&& make ${JOBS} && make install) || die "wxWidgets build failed" make ${JOBS} && make install) || die "wxWidgets build failed"
popd popd
popd popd
echo "$LIB_VERSION" >.already-built echo "$LIB_VERSION" >.already-built
@ -507,8 +499,7 @@ LIB_URL="http://download.sourceforge.net/libpng/"
mkdir -p libpng mkdir -p libpng
pushd libpng >/dev/null pushd libpng >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -522,8 +513,8 @@ then
(./configure CFLAGS="$CFLAGS" CPPFLAGS=" -I $ZLIB_DIR/include " \ (./configure CFLAGS="$CFLAGS" CPPFLAGS=" -I $ZLIB_DIR/include " \
LDFLAGS="$LDFLAGS -L$ZLIB_DIR/lib" \ LDFLAGS="$LDFLAGS -L$ZLIB_DIR/lib" \
--prefix=$INSTALL_DIR \ --prefix=$INSTALL_DIR \
--enable-shared=no \ --enable-shared=no &&
&& make ${JOBS} && make install) || die "libpng build failed" make ${JOBS} && make install) || die "libpng build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -544,8 +535,7 @@ LIB_URL="https://download.savannah.gnu.org/releases/freetype/"
mkdir -p freetype mkdir -p freetype
pushd freetype >/dev/null pushd freetype >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -561,8 +551,8 @@ then
--enable-shared=no \ --enable-shared=no \
--with-harfbuzz=no \ --with-harfbuzz=no \
--with-bzip2=no \ --with-bzip2=no \
--with-brotli=no \ --with-brotli=no &&
&& make ${JOBS} && make install) || die "freetype build failed" make ${JOBS} && make install) || die "freetype build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
echo "$LIB_VERSION" >.already-built echo "$LIB_VERSION" >.already-built
@ -584,8 +574,7 @@ mkdir -p libogg
pushd libogg >/dev/null pushd libogg >/dev/null
OGG_DIR="$(pwd)" OGG_DIR="$(pwd)"
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
rm -f .already-built rm -f .already-built
download_lib $LIB_URL $LIB_ARCHIVE download_lib $LIB_URL $LIB_ARCHIVE
@ -596,8 +585,8 @@ then
(./configure CFLAGS="$CFLAGS" \ (./configure CFLAGS="$CFLAGS" \
LDFLAGS="$LDFLAGS" \ LDFLAGS="$LDFLAGS" \
--prefix=$OGG_DIR \ --prefix=$OGG_DIR \
--enable-shared=no \ --enable-shared=no &&
&& make ${JOBS} && make install) || die "libogg build failed" make ${JOBS} && make install) || die "libogg build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -618,8 +607,7 @@ LIB_URL="http://downloads.xiph.org/releases/vorbis/"
mkdir -p vorbis mkdir -p vorbis
pushd vorbis >/dev/null pushd vorbis >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -633,8 +621,8 @@ then
LDFLAGS="$LDFLAGS" \ LDFLAGS="$LDFLAGS" \
--prefix="$INSTALL_DIR" \ --prefix="$INSTALL_DIR" \
--enable-shared=no \ --enable-shared=no \
--with-ogg="$OGG_DIR" \ --with-ogg="$OGG_DIR" &&
&& make ${JOBS} && make install) || die "libvorbis build failed" make ${JOBS} && make install) || die "libvorbis build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -657,8 +645,7 @@ pushd gmp > /dev/null
GMP_DIR="$(pwd)" GMP_DIR="$(pwd)"
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -677,8 +664,8 @@ then
--prefix="$INSTALL_DIR" \ --prefix="$INSTALL_DIR" \
--enable-fat \ --enable-fat \
--disable-shared \ --disable-shared \
--with-pic \ --with-pic &&
&& make ${JOBS} && make install) || die "GMP build failed" make ${JOBS} && make install) || die "GMP build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -702,8 +689,7 @@ pushd nettle > /dev/null
NETTLE_DIR="$(pwd)" NETTLE_DIR="$(pwd)"
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -725,8 +711,8 @@ then
--disable-shared \ --disable-shared \
--disable-documentation \ --disable-documentation \
--disable-openssl \ --disable-openssl \
--disable-assembler \ --disable-assembler &&
&& make ${JOBS} && make install) || die "Nettle build failed" make ${JOBS} && make install) || die "Nettle build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -749,8 +735,7 @@ pushd gnutls > /dev/null
GNUTLS_DIR="$(pwd)" GNUTLS_DIR="$(pwd)"
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -762,8 +747,8 @@ then
# Patch GNUTLS for a linking issue with isdigit # Patch GNUTLS for a linking issue with isdigit
# Patch by Ross Nicholson: https://gitlab.com/gnutls/gnutls/-/issues/1033#note_379529145 # Patch by Ross Nicholson: https://gitlab.com/gnutls/gnutls/-/issues/1033#note_379529145
(patch -Np1 -i ../../../macos-patches/03-undo-libtasn1-cisdigit.patch \ (patch -Np1 -i ../../../macos-patches/03-undo-libtasn1-cisdigit.patch &&
&& ./configure CFLAGS="$CFLAGS" \ ./configure CFLAGS="$CFLAGS" \
CXXFLAGS="$CXXFLAGS" \ CXXFLAGS="$CXXFLAGS" \
LDFLAGS="$LDFLAGS" \ LDFLAGS="$LDFLAGS" \
LIBS="-L${GMP_DIR}/lib -lgmp" \ LIBS="-L${GMP_DIR}/lib -lgmp" \
@ -784,8 +769,8 @@ then
--disable-guile \ --disable-guile \
--disable-doc \ --disable-doc \
--disable-tools \ --disable-tools \
--disable-nls \ --disable-nls &&
&& make ${JOBS} LDFLAGS= install) || die "GnuTLS build failed" make ${JOBS} LDFLAGS= install) || die "GnuTLS build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -806,8 +791,7 @@ LIB_URL="http://camaya.net/download/"
mkdir -p gloox mkdir -p gloox
pushd gloox >/dev/null pushd gloox >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -832,8 +816,8 @@ then
--without-openssl \ --without-openssl \
--without-tests \ --without-tests \
--without-examples \ --without-examples \
--disable-getaddrinfo \ --disable-getaddrinfo &&
&& make ${JOBS} && make install) || die "gloox build failed" make ${JOBS} && make install) || die "gloox build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -854,8 +838,7 @@ LIB_URL="https://github.com/unicode-org/icu/releases/download/release-69-1/"
mkdir -p icu mkdir -p icu
pushd icu >/dev/null pushd icu >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -877,8 +860,8 @@ then
--disable-samples \ --disable-samples \
--enable-extras \ --enable-extras \
--enable-icuio \ --enable-icuio \
--enable-tools \ --enable-tools &&
&& make ${JOBS} && make install) || die "ICU build failed" make ${JOBS} && make install) || die "ICU build failed"
popd popd
popd popd
@ -900,8 +883,7 @@ LIB_URL="http://enet.bespin.org/download/"
mkdir -p enet mkdir -p enet
pushd enet >/dev/null pushd enet >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -914,8 +896,8 @@ then
(./configure CFLAGS="$CFLAGS" \ (./configure CFLAGS="$CFLAGS" \
LDFLAGS="$LDFLAGS" \ LDFLAGS="$LDFLAGS" \
--prefix=${INSTALL_DIR} \ --prefix=${INSTALL_DIR} \
--enable-shared=no \ --enable-shared=no &&
&& make clean && make ${JOBS} && make install) || die "ENet build failed" make clean && make ${JOBS} && make install) || die "ENet build failed"
popd popd
cp -f lib/pkgconfig/* $PC_PATH cp -f lib/pkgconfig/* $PC_PATH
@ -936,8 +918,7 @@ LIB_URL="http://miniupnp.tuxfamily.org/files/download.php?file="
mkdir -p miniupnpc mkdir -p miniupnpc
pushd miniupnpc >/dev/null pushd miniupnpc >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -947,9 +928,10 @@ then
tar -xf $LIB_ARCHIVE tar -xf $LIB_ARCHIVE
pushd $LIB_DIRECTORY pushd $LIB_DIRECTORY
(make clean \ (
&& CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS make ${JOBS} \ make clean &&
&& INSTALLPREFIX="$INSTALL_DIR" make install \ CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS make ${JOBS} &&
INSTALLPREFIX="$INSTALL_DIR" make install
) || die "MiniUPnPc build failed" ) || die "MiniUPnPc build failed"
popd popd
@ -973,8 +955,7 @@ LIB_URL="https://download.libsodium.org/libsodium/releases/"
mkdir -p libsodium mkdir -p libsodium
pushd libsodium >/dev/null pushd libsodium >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$LIB_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -984,14 +965,15 @@ then
tar -xf $LIB_ARCHIVE tar -xf $LIB_ARCHIVE
pushd $LIB_DIRECTORY pushd $LIB_DIRECTORY
(./configure CFLAGS="$CFLAGS" \ (
./configure CFLAGS="$CFLAGS" \
LDFLAGS="$LDFLAGS" \ LDFLAGS="$LDFLAGS" \
--prefix=${INSTALL_DIR} \ --prefix=${INSTALL_DIR} \
--enable-shared=no \ --enable-shared=no &&
&& make clean \ make clean &&
&& CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS make ${JOBS} \ CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS make ${JOBS} &&
&& make check \ make check &&
&& INSTALLPREFIX="$INSTALL_DIR" make install \ INSTALLPREFIX="$INSTALL_DIR" make install
) || die "libsodium build failed" ) || die "libsodium build failed"
popd popd
@ -1012,8 +994,7 @@ LIB_URL="https://github.com/fmtlib/fmt/archive/"
mkdir -p fmt mkdir -p fmt
pushd fmt >/dev/null pushd fmt >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$FMT_VERSION" ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$FMT_VERSION" ]]; then
then
INSTALL_DIR="$(pwd)" INSTALL_DIR="$(pwd)"
rm -f .already-built rm -f .already-built
@ -1033,8 +1014,8 @@ then
-DFMT_TEST=False \ -DFMT_TEST=False \
-DFMT_DOC=False \ -DFMT_DOC=False \
-DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \ -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
$CMAKE_FLAGS \ $CMAKE_FLAGS &&
&& make fmt ${JOBS} && make install) || die "fmt build failed" make fmt ${JOBS} && make install) || die "fmt build failed"
popd popd
popd popd
@ -1053,8 +1034,7 @@ LIB_URL="https://releases.wildfiregames.com/libs/"
mkdir -p "molten-vk" mkdir -p "molten-vk"
pushd "molten-vk" >/dev/null pushd "molten-vk" >/dev/null
if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$MOLTENVK_VERSION" ]] || [[ ! -e ../../../binaries/system/libMoltenVK.dylib ]] if [[ $force_rebuild == "true" ]] || [[ ! -e .already-built ]] || [[ "$(<.already-built)" != "$MOLTENVK_VERSION" ]] || [[ ! -e ../../../binaries/system/libMoltenVK.dylib ]]; then
then
INSTALL_DIR="../../../../binaries/system/" INSTALL_DIR="../../../../binaries/system/"
rm -f .already-built rm -f .already-built
download_lib $LIB_URL $LIB_ARCHIVE download_lib $LIB_URL $LIB_ARCHIVE
@ -1089,8 +1069,7 @@ fi
# SpiderMonkey - bundled, no download # SpiderMonkey - bundled, no download
pushd ../source/spidermonkey/ >/dev/null pushd ../source/spidermonkey/ >/dev/null
if [[ "$force_rebuild" = "true" ]] if [[ $force_rebuild == "true" ]]; then
then
rm -f .already-built rm -f .already-built
fi fi
@ -1104,8 +1083,7 @@ popd > /dev/null
# NVTT - bundled, no download # NVTT - bundled, no download
pushd ../source/nvtt >/dev/null pushd ../source/nvtt >/dev/null
if [[ "$force_rebuild" = "true" ]] if [[ $force_rebuild == "true" ]]; then
then
rm -f .already-built rm -f .already-built
fi fi
@ -1118,8 +1096,7 @@ popd > /dev/null
# FCollada - bundled, no download # FCollada - bundled, no download
pushd ../source/fcollada/ >/dev/null pushd ../source/fcollada/ >/dev/null
if [[ "$force_rebuild" = "true" ]] if [[ $force_rebuild == "true" ]]; then
then
rm -f .already-built rm -f .already-built
fi fi

View File

@ -10,7 +10,7 @@ die()
# Update this line when you commit an update to source-libs # Update this line when you commit an update to source-libs
source_svnrev="28207" source_svnrev="28207"
if [ "`uname -s`" = "Darwin" ]; then if [ "$(uname -s)" = "Darwin" ]; then
echo 'This script should not be used on macOS: use build-macos-libs.sh instead.' echo 'This script should not be used on macOS: use build-macos-libs.sh instead.'
exit 1 exit 1
fi fi
@ -21,13 +21,13 @@ cd "$(dirname $0)"
# Check for whitespace in absolute path; this will cause problems in the # Check for whitespace in absolute path; this will cause problems in the
# SpiderMonkey build and maybe elsewhere, so we just forbid it # SpiderMonkey build and maybe elsewhere, so we just forbid it
# Use perl as an alternative to readlink -f, which isn't available on BSD # Use perl as an alternative to readlink -f, which isn't available on BSD
SCRIPTPATH=`perl -MCwd -e 'print Cwd::abs_path shift' "$0"` SCRIPTPATH=$(perl -MCwd -e 'print Cwd::abs_path shift' "$0")
case "$SCRIPTPATH" in case "$SCRIPTPATH" in
*\ *) *\ *)
die "Absolute path contains whitespace, which will break the build - move the game to a path without spaces" ;; die "Absolute path contains whitespace, which will break the build - move the game to a path without spaces"
;;
esac esac
# Parse command-line options (download options and build options): # Parse command-line options (download options and build options):
source_libs_dir="source" source_libs_dir="source"
@ -37,8 +37,7 @@ with_system_mozjs=false
JOBS=${JOBS:="-j2"} JOBS=${JOBS:="-j2"}
for i in "$@" for i in "$@"; do
do
case $i in case $i in
--source-libs-dir=*) source_libs_dir=${1#*=} ;; --source-libs-dir=*) source_libs_dir=${1#*=} ;;
--source-libs-dir) die "correct syntax is --source-libs-dir=/path/to/dir" ;; --source-libs-dir) die "correct syntax is --source-libs-dir=/path/to/dir" ;;
@ -64,7 +63,7 @@ echo
# Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE # Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE
# is not set. # is not set.
case "`uname -s`" in case "$(uname -s)" in
"FreeBSD" | "OpenBSD") "FreeBSD" | "OpenBSD")
MAKE=${MAKE:="gmake"} MAKE=${MAKE:="gmake"}
;; ;;

View File

@ -31,8 +31,7 @@ ONLY_MOD="${ONLY_MOD:=false}"
if [ "${ONLY_MOD}" = true ]; then if [ "${ONLY_MOD}" = true ]; then
archives="mod" archives="mod"
else else
for modname in [a-zA-Z0-9]* for modname in [a-zA-Z0-9]*; do
do
archives="${archives} ${modname}" archives="${archives} ${modname}"
done done
fi fi
@ -53,19 +52,16 @@ if [ "${BUILD_SHADERS}" = true ]; then
ENGINE_VERSION=${ENGINE_VERSION:="0.0.xx"} ENGINE_VERSION=${ENGINE_VERSION:="0.0.xx"}
rulesFile="rules.${ENGINE_VERSION}.json" rulesFile="rules.${ENGINE_VERSION}.json"
if [ ! -e "$rulesFile" ] if [ ! -e "$rulesFile" ]; then
then
# The rules.json file should be present in release tarballs, for # The rules.json file should be present in release tarballs, for
# some Linux CIs don't have access to the internet. # some Linux CIs don't have access to the internet.
download="$(command -v wget || echo "curl -sLo ""${rulesFile}""")" download="$(command -v wget || echo "curl -sLo ""${rulesFile}""")"
$download "https://releases.wildfiregames.com/spir-v/$rulesFile" $download "https://releases.wildfiregames.com/spir-v/$rulesFile"
fi fi
for modname in $archives for modname in $archives; do
do
modLocation="../../../binaries/data/mods/${modname}" modLocation="../../../binaries/data/mods/${modname}"
if [ -e "${modLocation}/shaders/spirv/" ] if [ -e "${modLocation}/shaders/spirv/" ]; then
then
echo "Removing existing spirv shaders for '${modname}'..." echo "Removing existing spirv shaders for '${modname}'..."
rm -rf "${modLocation}/shaders/spirv" rm -rf "${modLocation}/shaders/spirv"
fi fi
@ -75,8 +71,7 @@ if [ "${BUILD_SHADERS}" = true ]; then
popd >/dev/null popd >/dev/null
fi fi
for modname in $archives for modname in $archives; do
do
echo "Building archive for '${modname}'..." echo "Building archive for '${modname}'..."
ARCHIVEBUILD_INPUT="binaries/data/mods/${modname}" ARCHIVEBUILD_INPUT="binaries/data/mods/${modname}"
ARCHIVEBUILD_OUTPUT="archives/${modname}" ARCHIVEBUILD_OUTPUT="archives/${modname}"

View File

@ -18,7 +18,7 @@ die()
} }
# Check that we're actually on OS X # Check that we're actually on OS X
if [ "`uname -s`" != "Darwin" ]; then if [ "$(uname -s)" != "Darwin" ]; then
die "This script is intended for OS X only" die "This script is intended for OS X only"
fi fi

View File

@ -8,4 +8,3 @@ fi
input_directory=$1 input_directory=$1
# perform work # perform work
find $input_directory -name \*.xml -exec xsltproc -o {} templatessorter.xsl {} \; find $input_directory -name \*.xml -exec xsltproc -o {} templatessorter.xsl {} \;

View File

@ -13,8 +13,7 @@ export TLDIR="$(dirname $(realpath $0))"
# Use semicolons to separate values on Windows. # Use semicolons to separate values on Windows.
# If that produces bogus output, you can try with commas instead. # If that produces bogus output, you can try with commas instead.
if [ "${OS}" = "Windows_NT" ] if [ "${OS}" = "Windows_NT" ]; then
then
export TLLOG="Default;IonCompiler" export TLLOG="Default;IonCompiler"
export TLOPTIONS="EnableMainThread;EnableOffThread;EnableGraph" export TLOPTIONS="EnableMainThread;EnableOffThread;EnableGraph"
else else