0ad/libraries/source/fcollada/build.sh
Ralph Sennhauser aa601de72c
Set owner and group when creating tar archive
tar --no-same-owner is only default for non root users, therefore if
extracting as root owner ship is by the user id creating the archive.
This is an issue if extracting happens in a container and cleanup
outside the container by a non root user like on our CI when building
the appimage. Therefore package the tar archives for fcollada and nvtt
with owner and group root.

Fixes: #8440
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-10-13 19:03:42 +02:00

73 lines
1.3 KiB
Bash
Executable file

#!/bin/sh
set -e
: "${TAR:=tar}"
cd "$(dirname "$0")"
PV=28209
LIB_VERSION=${PV}+wfg1
fetch()
{
tar_version=$(tar --version | head --lines 1)
case "${tar_version}" in
*"GNU tar"*)
tar_extra_opts="--owner root --group root"
;;
*"libarchive"*)
tar_extra_opts="--uname root --gname root"
;;
*)
echo "unknown tar implementation ${tar_version}"
;;
esac
rm -Rf fcollada-${PV}
svn export https://svn.wildfiregames.com/public/source-libs/trunk/fcollada@${PV} fcollada-${PV}
# shellcheck disable=SC2086
"${TAR}" -c ${tar_extra_opts} -Jf fcollada-${PV}.tar.xz fcollada-${PV}
rm -R fcollada-${PV}
}
echo "Building FCollada..."
while [ "$#" -gt 0 ]; do
case "$1" in
--fetch-only)
fetch
exit
;;
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done
if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}" ]; then
echo "Skipping - already built (use --force-rebuild to override)"
exit
fi
# fetch
if [ ! -e "fcollada-${PV}.tar.xz" ]; then
fetch
fi
# unpack
rm -Rf fcollada-${PV}
"${TAR}" xf fcollada-${PV}.tar.xz
# build
(
cd fcollada-${PV}
./build.sh
)
# install
rm -Rf include lib
cp -R fcollada-${PV}/include fcollada-${PV}/lib .
echo "${LIB_VERSION}" >.already-built