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

@ -28,143 +28,142 @@ mkdir -p files
pushd files
if [ ! -e boost_1_45_0.tar.bz2 ]; then
wget http://downloads.sourceforge.net/project/boost/boost/1.45.0/boost_1_45_0.tar.bz2
wget http://downloads.sourceforge.net/project/boost/boost/1.45.0/boost_1_45_0.tar.bz2
fi
if [ ! -e curl-7.33.0.tar.bz2 ]; then
wget http://curl.haxx.se/download/curl-7.33.0.tar.bz2
wget http://curl.haxx.se/download/curl-7.33.0.tar.bz2
fi
if [ ! -e MysticTreeGames-Boost-for-Android-70838fc.tar.gz ]; then
wget https://github.com/MysticTreeGames/Boost-for-Android/tarball/70838fcfba930646cac724a77f5c626e930431f6 -O MysticTreeGames-Boost-for-Android-70838fc.tar.gz
wget https://github.com/MysticTreeGames/Boost-for-Android/tarball/70838fcfba930646cac724a77f5c626e930431f6 -O MysticTreeGames-Boost-for-Android-70838fc.tar.gz
fi
if [ ! -e enet-1.3.3.tar.gz ]; then
wget http://enet.bespin.org/download/enet-1.3.3.tar.gz
wget http://enet.bespin.org/download/enet-1.3.3.tar.gz
fi
if [ ! -e js185-1.0.0.tar.gz ]; then
cp ../../../libraries/source/spidermonkey/js185-1.0.0.tar.gz .
cp ../../../libraries/source/spidermonkey/js185-1.0.0.tar.gz .
fi
if [ ! -e libjpeg-turbo-1.3.0.tar.gz ]; then
wget http://downloads.sourceforge.net/project/libjpeg-turbo/1.3.0/libjpeg-turbo-1.3.0.tar.gz
wget http://downloads.sourceforge.net/project/libjpeg-turbo/1.3.0/libjpeg-turbo-1.3.0.tar.gz
fi
if [ ! -e libpng-1.5.8.tar.xz ]; then
wget http://prdownloads.sourceforge.net/libpng/libpng-1.5.8.tar.xz
wget http://prdownloads.sourceforge.net/libpng/libpng-1.5.8.tar.xz
fi
if [ ! -e libxml2-2.7.8.tar.gz ]; then
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
fi
popd
if [ "$build_toolchain" = "true" ]; then
rm -r $TOOLCHAIN || true
$NDK/build/tools/make-standalone-toolchain.sh --platform=android-14 --toolchain=arm-linux-androideabi-4.6 --install-dir=$TOOLCHAIN --system=linux-x86_64
rm -r $TOOLCHAIN || true
$NDK/build/tools/make-standalone-toolchain.sh --platform=android-14 --toolchain=arm-linux-androideabi-4.6 --install-dir=$TOOLCHAIN --system=linux-x86_64
mkdir -p $SYSROOT/usr/local
mkdir -p $SYSROOT/usr/local
# Set up some symlinks to make the SpiderMonkey build system happy
ln -sfT ../platforms $NDK/build/platforms
for f in $TOOLCHAIN/bin/arm-linux-androideabi-*; do
ln -sf $f ${f/arm-linux-androideabi-/arm-eabi-}
done
# Set up some symlinks to make the SpiderMonkey build system happy
ln -sfT ../platforms $NDK/build/platforms
for f in $TOOLCHAIN/bin/arm-linux-androideabi-*; do
ln -sf $f ${f/arm-linux-androideabi-/arm-eabi-}
done
# Set up some symlinks for the typical autoconf-based build systems
for f in $TOOLCHAIN/bin/arm-linux-androideabi-*; do
ln -sf $f ${f/arm-linux-androideabi-/arm-linux-eabi-}
done
# Set up some symlinks for the typical autoconf-based build systems
for f in $TOOLCHAIN/bin/arm-linux-androideabi-*; do
ln -sf $f ${f/arm-linux-androideabi-/arm-linux-eabi-}
done
fi
mkdir -p temp
if [ "$build_boost" = "true" ]; then
rm -rf temp/MysticTreeGames-Boost-for-Android-70838fc
tar xvf files/MysticTreeGames-Boost-for-Android-70838fc.tar.gz -C temp/
cp files/boost_1_45_0.tar.bz2 temp/MysticTreeGames-Boost-for-Android-70838fc/
patch temp/MysticTreeGames-Boost-for-Android-70838fc/build-android.sh < boost-android-build.patch
pushd temp/MysticTreeGames-Boost-for-Android-70838fc
./build-android.sh $TOOLCHAIN
cp -rv build/{include,lib} $SYSROOT/usr/local/
popd
rm -rf temp/MysticTreeGames-Boost-for-Android-70838fc
tar xvf files/MysticTreeGames-Boost-for-Android-70838fc.tar.gz -C temp/
cp files/boost_1_45_0.tar.bz2 temp/MysticTreeGames-Boost-for-Android-70838fc/
patch temp/MysticTreeGames-Boost-for-Android-70838fc/build-android.sh <boost-android-build.patch
pushd temp/MysticTreeGames-Boost-for-Android-70838fc
./build-android.sh $TOOLCHAIN
cp -rv build/{include,lib} $SYSROOT/usr/local/
popd
fi
if [ "$build_curl" = "true" ]; then
rm -rf temp/curl-7.33.0
tar xvf files/curl-7.33.0.tar.bz2 -C temp/
pushd temp/curl-7.33.0
./configure --host=arm-linux-androideabi --with-sysroot=$SYSROOT --prefix=$SYSROOT/usr/local CFLAGS="$CFLAGS" LDFLAGS="-lm" --disable-shared
make -j3
make install
popd
rm -rf temp/curl-7.33.0
tar xvf files/curl-7.33.0.tar.bz2 -C temp/
pushd temp/curl-7.33.0
./configure --host=arm-linux-androideabi --with-sysroot=$SYSROOT --prefix=$SYSROOT/usr/local CFLAGS="$CFLAGS" LDFLAGS="-lm" --disable-shared
make -j3
make install
popd
fi
if [ "$build_libpng" = "true" ]; then
rm -rf temp/libpng-1.5.8
tar xvf files/libpng-1.5.8.tar.xz -C temp/
pushd temp/libpng-1.5.8
./configure --host=arm-linux-eabi --with-sysroot=$SYSROOT --prefix=$SYSROOT/usr/local CFLAGS="$CFLAGS"
make $JOBS
make install
popd
rm -rf temp/libpng-1.5.8
tar xvf files/libpng-1.5.8.tar.xz -C temp/
pushd temp/libpng-1.5.8
./configure --host=arm-linux-eabi --with-sysroot=$SYSROOT --prefix=$SYSROOT/usr/local CFLAGS="$CFLAGS"
make $JOBS
make install
popd
fi
if [ "$build_libjpeg" = "true" ]; then
rm -rf temp/libjpeg-turbo-1.3.0
tar xvf files/libjpeg-turbo-1.3.0.tar.gz -C temp/
pushd temp/libjpeg-turbo-1.3.0
./configure --host=arm-linux-eabi --with-sysroot=$SYSROOT --prefix=$SYSROOT/usr/local CFLAGS="$CFLAGS" LDFLAGS="-lm"
make $JOBS
make install
popd
rm -rf temp/libjpeg-turbo-1.3.0
tar xvf files/libjpeg-turbo-1.3.0.tar.gz -C temp/
pushd temp/libjpeg-turbo-1.3.0
./configure --host=arm-linux-eabi --with-sysroot=$SYSROOT --prefix=$SYSROOT/usr/local CFLAGS="$CFLAGS" LDFLAGS="-lm"
make $JOBS
make install
popd
fi
if [ "$build_libxml2" = "true" ]; then
rm -rf temp/libxml2-2.7.8
tar xvf files/libxml2-2.7.8.tar.gz -C temp/
patch temp/libxml2-2.7.8/Makefile.in < libxml2-android-build.patch
pushd temp/libxml2-2.7.8
./configure --host=arm-linux-eabi --with-sysroot=$SYSROOT --prefix=$SYSROOT/usr/local CFLAGS="$CFLAGS"
make $JOBS
make install
popd
rm -rf temp/libxml2-2.7.8
tar xvf files/libxml2-2.7.8.tar.gz -C temp/
patch temp/libxml2-2.7.8/Makefile.in <libxml2-android-build.patch
pushd temp/libxml2-2.7.8
./configure --host=arm-linux-eabi --with-sysroot=$SYSROOT --prefix=$SYSROOT/usr/local CFLAGS="$CFLAGS"
make $JOBS
make install
popd
fi
if [ "$build_enet" = "true" ]; then
rm -rf temp/enet-1.3.3
tar xvf files/enet-1.3.3.tar.gz -C temp/
pushd temp/enet-1.3.3
./configure --host=arm-linux-eabi --with-sysroot=$SYSROOT --prefix=$SYSROOT/usr/local CFLAGS="$CFLAGS"
make $JOBS
make install
popd
rm -rf temp/enet-1.3.3
tar xvf files/enet-1.3.3.tar.gz -C temp/
pushd temp/enet-1.3.3
./configure --host=arm-linux-eabi --with-sysroot=$SYSROOT --prefix=$SYSROOT/usr/local CFLAGS="$CFLAGS"
make $JOBS
make install
popd
fi
if [ "$build_js185" = "true" ]; then
rm -rf temp/js-1.8.5
tar xvf files/js185-1.0.0.tar.gz -C temp/
patch temp/js-1.8.5/js/src/assembler/wtf/Platform.h < js185-android-build.patch
pushd temp/js-1.8.5/js/src
CXXFLAGS="-I $TOOLCHAIN/arm-linux-androideabi/include/c++/4.4.3/arm-linux-androideabi" \
HOST_CXXFLAGS="-DFORCE_LITTLE_ENDIAN" \
./configure \
--prefix=$SYSROOT/usr/local \
--target=arm-android-eabi \
--with-android-ndk=$NDK \
--with-android-sdk=$SDK \
--with-android-toolchain=$TOOLCHAIN \
--with-android-version=9 \
--disable-tests \
--disable-shared-js \
--with-arm-kuser \
CFLAGS="$CFLAGS"
make $JOBS JS_DISABLE_SHELL=1
make install JS_DISABLE_SHELL=1
popd
rm -rf temp/js-1.8.5
tar xvf files/js185-1.0.0.tar.gz -C temp/
patch temp/js-1.8.5/js/src/assembler/wtf/Platform.h <js185-android-build.patch
pushd temp/js-1.8.5/js/src
CXXFLAGS="-I $TOOLCHAIN/arm-linux-androideabi/include/c++/4.4.3/arm-linux-androideabi" \
HOST_CXXFLAGS="-DFORCE_LITTLE_ENDIAN" \
./configure \
--prefix=$SYSROOT/usr/local \
--target=arm-android-eabi \
--with-android-ndk=$NDK \
--with-android-sdk=$SDK \
--with-android-toolchain=$TOOLCHAIN \
--with-android-version=9 \
--disable-tests \
--disable-shared-js \
--with-arm-kuser \
CFLAGS="$CFLAGS"
make $JOBS JS_DISABLE_SHELL=1
make install JS_DISABLE_SHELL=1
popd
fi

View File

@ -8,20 +8,23 @@
rm -f app.info
for APPDIR in ../workspaces/gcc/obj/*; do
lcov -d "$APPDIR" --zerocounters
lcov -d "$APPDIR" -b ../workspaces/gcc --capture --initial -o temp.info
if [ -e app.info ]; then
lcov -a app.info -a temp.info -o app.info
else
mv temp.info app.info
fi
lcov -d "$APPDIR" --zerocounters
lcov -d "$APPDIR" -b ../workspaces/gcc --capture --initial -o temp.info
if [ -e app.info ]; then
lcov -a app.info -a temp.info -o app.info
else
mv temp.info app.info
fi
done
(cd ../../binaries/system/; ./test_dbg)
(
cd ../../binaries/system/
./test_dbg
)
for APPDIR in ../workspaces/gcc/obj/*; do
lcov -d "$APPDIR" -b ../workspaces/gcc --capture -o temp.info &&
lcov -a app.info -a temp.info -o app.info
lcov -d "$APPDIR" -b ../workspaces/gcc --capture -o temp.info &&
lcov -a app.info -a temp.info -o app.info
done
lcov -r app.info '/usr/*' -o app.info
@ -30,4 +33,7 @@ lcov -r app.info '*/third_party/*' -o app.info
rm -rf 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,10 +3,9 @@ set -e
LIB_VERSION="premake-5-alpha-14+wildfiregames.1"
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]
then
echo "Premake 5 is already up to date."
exit
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]; then
echo "Premake 5 is already up to date."
exit
fi
JOBS=${JOBS:="-j2"}
@ -20,16 +19,16 @@ echo
PREMAKE_BUILD_DIR=premake5/build/gmake2.unix
# BSD and OS X need different Makefiles
case "$OS" in
"GNU/kFreeBSD" )
# use default gmake2.unix (needs -ldl as we have a GNU userland and libc)
;;
*"BSD" )
PREMAKE_BUILD_DIR=premake5/build/gmake2.bsd
;;
"Darwin" )
PREMAKE_BUILD_DIR=premake5/build/gmake2.macosx
;;
"GNU/kFreeBSD")
# use default gmake2.unix (needs -ldl as we have a GNU userland and libc)
;;
*"BSD")
PREMAKE_BUILD_DIR=premake5/build/gmake2.bsd
;;
"Darwin")
PREMAKE_BUILD_DIR=premake5/build/gmake2.macosx
;;
esac
${MAKE} -C "${PREMAKE_BUILD_DIR}" "${JOBS}" CFLAGS="$CFLAGS" config=release
echo "${LIB_VERSION}" > .already-built
echo "${LIB_VERSION}" >.already-built

View File

@ -1,9 +1,9 @@
#!/bin/sh
pyrogenesis=$(which pyrogenesis 2> /dev/null)
if [ -x "$pyrogenesis" ] ; then
"$pyrogenesis" "$@"
pyrogenesis=$(which pyrogenesis 2>/dev/null)
if [ -x "$pyrogenesis" ]; then
"$pyrogenesis" "$@"
else
echo "Error: pyrogenesis not found in ($PATH)"
exit 1
echo "Error: pyrogenesis not found in ($PATH)"
exit 1
fi

View File

@ -1,14 +1,14 @@
#!/bin/sh
if [ "$(id -u)" = "0" ]; then
echo "Running as root will mess up file permissions. Aborting ..." 1>&2
exit 1
echo "Running as root will mess up file permissions. Aborting ..." 1>&2
exit 1
fi
die()
{
echo ERROR: $*
exit 1
echo ERROR: $*
exit 1
}
OS=${OS:="$(uname -s)"}
@ -16,12 +16,12 @@ OS=${OS:="$(uname -s)"}
# Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE
# is not set.
case "$OS" in
"FreeBSD" | "OpenBSD" )
MAKE=${MAKE:="gmake"}
;;
* )
MAKE=${MAKE:="make"}
;;
"FreeBSD" | "OpenBSD")
MAKE=${MAKE:="gmake"}
;;
*)
MAKE=${MAKE:="make"}
;;
esac
cd "$(dirname $0)"
@ -35,37 +35,35 @@ enable_atlas=true
JOBS=${JOBS:="-j2"}
for i in "$@"
do
case $i in
--with-system-premake5 ) with_system_premake5=true ;;
--enable-atlas ) enable_atlas=true ;;
--disable-atlas ) enable_atlas=false ;;
-j* ) JOBS=$i ;;
# Assume any other --options are for Premake
--* ) premake_args="${premake_args} $i" ;;
esac
for i in "$@"; do
case $i in
--with-system-premake5) with_system_premake5=true ;;
--enable-atlas) enable_atlas=true ;;
--disable-atlas) enable_atlas=false ;;
-j*) JOBS=$i ;;
# Assume any other --options are for Premake
--*) premake_args="${premake_args} $i" ;;
esac
done
if [ "$enable_atlas" = "true" ]; then
premake_args="${premake_args} --atlas"
if [ "$OS" = "Darwin" ]; then
# Provide path to wx-config on OS X (as wxwidgets doesn't support pkgconfig)
export WX_CONFIG="${WX_CONFIG:="$(pwd)/../../libraries/macos/wxwidgets/bin/wx-config"}"
else
export WX_CONFIG="${WX_CONFIG:="wx-config"}"
fi
premake_args="${premake_args} --atlas"
if [ "$OS" = "Darwin" ]; then
# Provide path to wx-config on OS X (as wxwidgets doesn't support pkgconfig)
export WX_CONFIG="${WX_CONFIG:="$(pwd)/../../libraries/macos/wxwidgets/bin/wx-config"}"
else
export WX_CONFIG="${WX_CONFIG:="wx-config"}"
fi
if [ ! -x "$(command -v $WX_CONFIG)" ]
then
echo 'WX_CONFIG must be set and valid or wx-config must be present when --atlas is passed as argument.'
exit 1
fi
if [ ! -x "$(command -v $WX_CONFIG)" ]; then
echo 'WX_CONFIG must be set and valid or wx-config must be present when --atlas is passed as argument.'
exit 1
fi
fi
if [ "$OS" = "Darwin" ]; then
# Set minimal SDK version
export MIN_OSX_VERSION=${MIN_OSX_VERSION:="10.12"}
# Set minimal SDK version
export MIN_OSX_VERSION=${MIN_OSX_VERSION:="10.12"}
fi
# Now build Premake or use system's.
@ -74,10 +72,10 @@ cd ../premake
premake_command="premake5"
if [ "$with_system_premake5" = "false" ]; then
# Build bundled premake
MAKE=${MAKE} JOBS=${JOBS} ./build.sh || die "Premake 5 build failed"
# Build bundled premake
MAKE=${MAKE} JOBS=${JOBS} ./build.sh || die "Premake 5 build failed"
premake_command="premake5/bin/release/premake5"
premake_command="premake5/bin/release/premake5"
fi
echo
@ -87,11 +85,11 @@ export HOSTTYPE="$HOSTTYPE"
# Now run Premake to create the makefiles
echo "Premake args: ${premake_args}"
if [ "$OS" != "Darwin" ]; then
${premake_command} --file="premake5.lua" --outpath="../workspaces/gcc/" ${premake_args} gmake || die "Premake failed"
${premake_command} --file="premake5.lua" --outpath="../workspaces/gcc/" ${premake_args} gmake || die "Premake failed"
else
${premake_command} --file="premake5.lua" --outpath="../workspaces/gcc/" --macosx-version-min="${MIN_OSX_VERSION}" ${premake_args} gmake || die "Premake failed"
# Also generate xcode workspaces if on OS X
${premake_command} --file="premake5.lua" --outpath="../workspaces/xcode4" --macosx-version-min="${MIN_OSX_VERSION}" ${premake_args} xcode4 || die "Premake failed"
${premake_command} --file="premake5.lua" --outpath="../workspaces/gcc/" --macosx-version-min="${MIN_OSX_VERSION}" ${premake_args} gmake || die "Premake failed"
# Also generate xcode workspaces if on OS X
${premake_command} --file="premake5.lua" --outpath="../workspaces/xcode4" --macosx-version-min="${MIN_OSX_VERSION}" ${premake_args} xcode4 || die "Premake failed"
fi
# test_root.cpp gets generated by cxxtestgen and passing different arguments to premake could require a regeneration of this file.

File diff suppressed because it is too large Load Diff

View File

@ -2,17 +2,17 @@
die()
{
echo ERROR: $*
exit 1
echo ERROR: $*
exit 1
}
# SVN revision to checkout for source-libs
# Update this line when you commit an update to source-libs
source_svnrev="28207"
if [ "`uname -s`" = "Darwin" ]; then
echo 'This script should not be used on macOS: use build-macos-libs.sh instead.'
exit 1
if [ "$(uname -s)" = "Darwin" ]; then
echo 'This script should not be used on macOS: use build-macos-libs.sh instead.'
exit 1
fi
cd "$(dirname $0)"
@ -21,13 +21,13 @@ cd "$(dirname $0)"
# Check for whitespace in absolute path; this will cause problems in the
# SpiderMonkey build and maybe elsewhere, so we just forbid it
# 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
*\ * )
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
# Parse command-line options (download options and build options):
source_libs_dir="source"
@ -37,25 +37,24 @@ with_system_mozjs=false
JOBS=${JOBS:="-j2"}
for i in "$@"
do
case $i in
--source-libs-dir=* ) source_libs_dir=${1#*=} ;;
--source-libs-dir ) die "correct syntax is --source-libs-dir=/path/to/dir" ;;
--without-nvtt ) without_nvtt=true ;;
--with-system-nvtt ) with_system_nvtt=true ;;
--with-system-mozjs ) with_system_mozjs=true ;;
-j* ) JOBS=$i ;;
esac
for i in "$@"; do
case $i in
--source-libs-dir=*) source_libs_dir=${1#*=} ;;
--source-libs-dir) die "correct syntax is --source-libs-dir=/path/to/dir" ;;
--without-nvtt) without_nvtt=true ;;
--with-system-nvtt) with_system_nvtt=true ;;
--with-system-mozjs) with_system_mozjs=true ;;
-j*) JOBS=$i ;;
esac
done
# Download source libs
echo "Downloading source libs..."
echo
if [ -e ${source_libs_dir}/.svn ]; then
(cd ${source_libs_dir} && svn cleanup && svn up -r $source_svnrev)
(cd ${source_libs_dir} && svn cleanup && svn up -r $source_svnrev)
else
svn co -r $source_svnrev https://svn.wildfiregames.com/public/source-libs/trunk ${source_libs_dir}
svn co -r $source_svnrev https://svn.wildfiregames.com/public/source-libs/trunk ${source_libs_dir}
fi
# Build/update bundled external libraries
@ -64,23 +63,23 @@ echo
# Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE
# is not set.
case "`uname -s`" in
"FreeBSD" | "OpenBSD" )
MAKE=${MAKE:="gmake"}
;;
* )
MAKE=${MAKE:="make"}
;;
case "$(uname -s)" in
"FreeBSD" | "OpenBSD")
MAKE=${MAKE:="gmake"}
;;
*)
MAKE=${MAKE:="make"}
;;
esac
(cd ${source_libs_dir}/fcollada && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "FCollada build failed"
echo
if [ "$with_system_nvtt" = "false" ] && [ "$without_nvtt" = "false" ]; then
(cd ${source_libs_dir}/nvtt && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "NVTT build failed"
(cd ${source_libs_dir}/nvtt && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "NVTT build failed"
fi
echo
if [ "$with_system_mozjs" = "false" ]; then
(cd ${source_libs_dir}/spidermonkey && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed"
(cd ${source_libs_dir}/spidermonkey && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed"
fi
echo
@ -88,29 +87,29 @@ echo "Copying built files..."
# Copy built binaries to binaries/system/
cp ${source_libs_dir}/fcollada/bin/* ../binaries/system/
if [ "$with_system_nvtt" = "false" ] && [ "$without_nvtt" = "false" ]; then
cp ${source_libs_dir}/nvtt/bin/* ../binaries/system/
cp ${source_libs_dir}/nvtt/bin/* ../binaries/system/
fi
if [ "$with_system_mozjs" = "false" ]; then
cp ${source_libs_dir}/spidermonkey/bin/* ../binaries/system/
cp ${source_libs_dir}/spidermonkey/bin/* ../binaries/system/
fi
# If a custom source-libs dir was used, includes and static libs should be copied to libraries/source/
# and all other bundled content should be copied.
if [ "$source_libs_dir" != "source" ]; then
rsync -avzq \
--exclude fcollada \
--exclude nvtt \
--exclude spidermonkey \
${source_libs_dir}/ source
rsync -avzq \
--exclude fcollada \
--exclude nvtt \
--exclude spidermonkey \
${source_libs_dir}/ source
mkdir -p source/fcollada
cp -r ${source_libs_dir}/fcollada/{include,lib} source/fcollada/
if [ "$with_system_nvtt" = "false" ] && [ "$without_nvtt" = "false" ]; then
mkdir -p source/nvtt
cp -r ${source_libs_dir}/nvtt/{include,lib} source/nvtt/
fi
if [ "$with_system_mozjs" = "false" ]; then
mkdir -p source/spidermonkey
cp -r ${source_libs_dir}/spidermonkey/{include-unix-debug,include-unix-release,lib} source/spidermonkey/
fi
mkdir -p source/fcollada
cp -r ${source_libs_dir}/fcollada/{include,lib} source/fcollada/
if [ "$with_system_nvtt" = "false" ] && [ "$without_nvtt" = "false" ]; then
mkdir -p source/nvtt
cp -r ${source_libs_dir}/nvtt/{include,lib} source/nvtt/
fi
if [ "$with_system_mozjs" = "false" ]; then
mkdir -p source/spidermonkey
cp -r ${source_libs_dir}/spidermonkey/{include-unix-debug,include-unix-release,lib} source/spidermonkey/
fi
fi
echo "Done."

View File

@ -12,9 +12,9 @@ cd "$(dirname $0)"
echo "Cleaning bundled third-party dependencies..."
if [ -e source/.svn ]; then
(cd source && svn revert -R . && svn st --no-ignore | cut -c 9- | xargs rm -rf)
(cd source && svn revert -R . && svn st --no-ignore | cut -c 9- | xargs rm -rf)
else
rm -rf source
rm -rf source
fi
echo

View File

@ -25,18 +25,17 @@ REGEX=".*/\("${REGEX:2}"\)\.[-A-Za-z0-9_.]\+\.po"
find binaries/ -name "*.po" | grep -v "$REGEX" | xargs rm -v || die "Error filtering languages."
# Build archive(s) - don't archive the _test.* mods
pushd binaries/data/mods > /dev/null
pushd binaries/data/mods >/dev/null
archives=""
ONLY_MOD="${ONLY_MOD:=false}"
if [ "${ONLY_MOD}" = true ]; then
archives="mod"
else
for modname in [a-zA-Z0-9]*
do
for modname in [a-zA-Z0-9]*; do
archives="${archives} ${modname}"
done
fi
popd > /dev/null
popd >/dev/null
BUILD_SHADERS="${BUILD_SHADERS:=true}"
if [ "${BUILD_SHADERS}" = true ]; then
@ -48,35 +47,31 @@ if [ "${BUILD_SHADERS}" = true ]; then
[ -n "${GLSLC}" ] || die "Error: glslc is not available. Install it with the Vulkan SDK before proceeding."
[ -n "${SPIRV_REFLECT}" ] || die "Error: spirv-reflect is not available. Install it with the Vulkan SDK before proceeding."
pushd "source/tools/spirv" > /dev/null
pushd "source/tools/spirv" >/dev/null
ENGINE_VERSION=${ENGINE_VERSION:="0.0.xx"}
rulesFile="rules.${ENGINE_VERSION}.json"
if [ ! -e "$rulesFile" ]
then
if [ ! -e "$rulesFile" ]; then
# The rules.json file should be present in release tarballs, for
# some Linux CIs don't have access to the internet.
download="$(command -v wget || echo "curl -sLo ""${rulesFile}""")"
$download "https://releases.wildfiregames.com/spir-v/$rulesFile"
fi
for modname in $archives
do
for modname in $archives; do
modLocation="../../../binaries/data/mods/${modname}"
if [ -e "${modLocation}/shaders/spirv/" ]
then
if [ -e "${modLocation}/shaders/spirv/" ]; then
echo "Removing existing spirv shaders for '${modname}'..."
rm -rf "${modLocation}/shaders/spirv"
fi
echo "Building shader for '${modname}'..."
$PYTHON compile.py "$modLocation" "$rulesFile" "$modLocation" --dependency "../../../binaries/data/mods/mod/"
done
popd > /dev/null
popd >/dev/null
fi
for modname in $archives
do
for modname in $archives; do
echo "Building archive for '${modname}'..."
ARCHIVEBUILD_INPUT="binaries/data/mods/${modname}"
ARCHIVEBUILD_OUTPUT="archives/${modname}"
@ -84,5 +79,5 @@ do
mkdir -p "${ARCHIVEBUILD_OUTPUT}"
(./binaries/system/pyrogenesis -mod=mod -archivebuild="${ARCHIVEBUILD_INPUT}" -archivebuild-output="${ARCHIVEBUILD_OUTPUT}/${modname}.zip") || die "Archive build for '${modname}' failed!"
cp "${ARCHIVEBUILD_INPUT}/mod.json" "${ARCHIVEBUILD_OUTPUT}" &> /dev/null || true
cp "${ARCHIVEBUILD_INPUT}/mod.json" "${ARCHIVEBUILD_OUTPUT}" &>/dev/null || true
done

View File

@ -13,18 +13,18 @@ export CC=${CC:="clang"} CXX=${CXX:="clang++"}
die()
{
echo ERROR: $*
exit 1
echo ERROR: $*
exit 1
}
# Check that we're actually on OS X
if [ "`uname -s`" != "Darwin" ]; then
die "This script is intended for OS X only"
if [ "$(uname -s)" != "Darwin" ]; then
die "This script is intended for OS X only"
fi
# Check SDK exists
if [ ! -d "${SYSROOT}" ]; then
die "${SYSROOT} does not exist! You probably need to install Xcode"
die "${SYSROOT} does not exist! You probably need to install Xcode"
fi
cd "build/workspaces/"
@ -46,10 +46,10 @@ fi
# Build libraries against SDK
echo "\nBuilding libraries\n"
pushd ../../libraries/osx > /dev/null
pushd ../../libraries/osx >/dev/null
SYSROOT="${SYSROOT}" MIN_OSX_VERSION="${MIN_OSX_VERSION}" \
./build-osx-libs.sh $JOBS "${BUILD_LIBS_ARGS}" || die "Libraries build script failed"
popd > /dev/null
popd >/dev/null
# Update workspaces
echo "\nGenerating workspaces\n"
@ -58,13 +58,13 @@ echo "\nGenerating workspaces\n"
(SYSROOT="${SYSROOT}" MIN_OSX_VERSION="${MIN_OSX_VERSION}" \
./update-workspaces.sh --sysroot="${SYSROOT}" --macosx-version-min="${MIN_OSX_VERSION}") || die "update-workspaces.sh failed!"
pushd gcc > /dev/null
pushd gcc >/dev/null
echo "\nBuilding game\n"
(make clean && CC="$CC -arch $ARCH" CXX="$CXX -arch $ARCH" make ${JOBS}) || die "Game build failed!"
popd > /dev/null
popd >/dev/null
# Run test to confirm all is OK
pushd ../../binaries/system > /dev/null
pushd ../../binaries/system >/dev/null
echo "\nRunning tests\n"
./test || die "Post-build testing failed!"
popd > /dev/null
popd >/dev/null

View File

@ -19,9 +19,9 @@ tar cf $PREFIX-unix-build.tar \
tar cf $PREFIX-unix-data.tar \
--exclude='binaries/data/config/dev.cfg' \
-s "|archives|$PREFIX/binaries/data/mods|" \
-s "|binaries|$PREFIX/binaries|" \
binaries/data/{config,tools} archives/
-s "|archives|$PREFIX/binaries/data/mods|" \
-s "|binaries|$PREFIX/binaries|" \
binaries/data/{config,tools} archives/
# TODO: ought to include generated docs in here, perhaps?
# Compress

View File

@ -9,7 +9,7 @@ cd "$(dirname $0)"
svn export --force --depth files https://svn.wildfiregames.com/nightly-build/trunk/binaries/data/l10n ../../../binaries/data/l10n
for m in "mod" "public"; do
svn export --force --depth files https://svn.wildfiregames.com/nightly-build/trunk/binaries/data/mods/${m}/l10n ../../../binaries/data/mods/${m}/l10n
svn export --force --depth files https://svn.wildfiregames.com/nightly-build/trunk/binaries/data/mods/${m}/l10n ../../../binaries/data/mods/${m}/l10n
done
svn export --force https://svn.wildfiregames.com/nightly-build/trunk/binaries/data/mods/public/gui/credits/texts/translators.json ../../../binaries/data/mods/public/gui/credits/texts/translators.json

View File

@ -6,5 +6,5 @@ set -ev
cd "$(dirname $0)"
for m in "mod" "public"; do
svn export --force https://svn.wildfiregames.com/nightly-build/trunk/binaries/data/mods/${m}/shaders/spirv ../../../binaries/data/mods/${m}/shaders/spirv
svn export --force https://svn.wildfiregames.com/nightly-build/trunk/binaries/data/mods/${m}/shaders/spirv ../../../binaries/data/mods/${m}/shaders/spirv
done

View File

@ -1,11 +1,10 @@
#!/bin/bash
# check arguments count
if [ $# -ne 1 ]; then
echo 'usage: '$0' directory'
exit
echo 'usage: '$0' directory'
exit
fi
# assign arguments to variables with readable names
input_directory=$1
# perform work
find $input_directory -name \*.xml -exec xsltproc -o {} templatessorter.xsl {} \;

View File

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