2024-08-29 04:17:33 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
set -e
|
|
|
|
|
|
2025-02-07 08:10:37 -08:00
|
|
|
: "${TAR:=tar}"
|
|
|
|
|
|
2024-08-29 04:17:33 -07:00
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
|
2025-01-17 09:27:30 -08:00
|
|
|
PV=28209
|
2025-10-15 20:12:02 -07:00
|
|
|
LIB_VERSION=${PV}+wfg4
|
2025-01-17 09:27:30 -08:00
|
|
|
|
|
|
|
|
fetch()
|
|
|
|
|
{
|
2025-10-13 08:39:09 -07:00
|
|
|
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
|
|
|
|
|
|
2025-01-17 09:27:30 -08:00
|
|
|
rm -Rf nvtt-${PV}
|
|
|
|
|
svn export https://svn.wildfiregames.com/public/source-libs/trunk/nvtt@${PV} nvtt-${PV}
|
2025-10-13 08:39:09 -07:00
|
|
|
# shellcheck disable=SC2086
|
|
|
|
|
"${TAR}" -c ${tar_extra_opts} -Jf nvtt-${PV}.tar.xz nvtt-${PV}
|
2025-01-17 09:27:30 -08:00
|
|
|
rm -R nvtt-${PV}
|
|
|
|
|
}
|
2024-08-29 04:17:33 -07:00
|
|
|
|
2024-12-15 01:23:23 -08:00
|
|
|
echo "Building NVTT..."
|
|
|
|
|
while [ "$#" -gt 0 ]; do
|
|
|
|
|
case "$1" in
|
2025-01-17 09:27:30 -08:00
|
|
|
--fetch-only)
|
|
|
|
|
fetch
|
|
|
|
|
exit
|
|
|
|
|
;;
|
2024-12-15 01:23:23 -08:00
|
|
|
--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)"
|
2024-08-29 04:17:33 -07:00
|
|
|
exit
|
2026-08-03 11:49:22 -07:00
|
|
|
else
|
|
|
|
|
rm -f .already-built
|
2024-08-29 04:17:33 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# fetch
|
2025-01-17 09:27:30 -08:00
|
|
|
if [ ! -e "nvtt-${PV}.tar.xz" ]; then
|
|
|
|
|
fetch
|
|
|
|
|
fi
|
2024-08-29 04:17:33 -07:00
|
|
|
|
|
|
|
|
# unpack
|
2025-01-17 09:27:30 -08:00
|
|
|
rm -Rf nvtt-${PV}
|
2025-02-07 08:10:37 -08:00
|
|
|
"${TAR}" xf nvtt-${PV}.tar.xz
|
2024-08-29 04:17:33 -07:00
|
|
|
|
2025-04-26 23:33:11 -07:00
|
|
|
# patch
|
|
|
|
|
patch -d nvtt-${PV} -p1 <patches/0001-Don-t-overspecify-flags.patch
|
|
|
|
|
patch -d nvtt-${PV} -p1 <patches/0002-Bump-cmake-min-version-to-3.10.patch
|
|
|
|
|
patch -d nvtt-${PV} -p1 <patches/0003-Use-execute_process-insted-of-exec_program.patch
|
2025-10-15 20:12:02 -07:00
|
|
|
patch -d nvtt-${PV} -p1 <patches/0004-Properly-detect-ppc64le-systems.patch
|
|
|
|
|
patch -d nvtt-${PV} -p1 <patches/0005-Fix-compiler-flags-on-ppc64le-systems.patch
|
|
|
|
|
patch -d nvtt-${PV} -p1 <patches/0006-Fix-altivec-include-on-ppc64le-systems.patch
|
2025-04-26 23:33:11 -07:00
|
|
|
|
2024-08-29 04:17:33 -07:00
|
|
|
# build
|
|
|
|
|
(
|
2025-01-17 09:27:30 -08:00
|
|
|
cd nvtt-${PV}
|
2024-08-29 04:17:33 -07:00
|
|
|
mkdir bin lib
|
|
|
|
|
./build.sh
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# install
|
|
|
|
|
rm -Rf bin include lib
|
2025-01-17 09:27:30 -08:00
|
|
|
cp -R nvtt-${PV}/bin nvtt-${PV}/include nvtt-${PV}/lib .
|
2024-08-29 04:17:33 -07:00
|
|
|
|
|
|
|
|
echo "${LIB_VERSION}" >.already-built
|