Add support for fetch-only for libraries

Used to prefetch all required tarballs to build pyrogenesis later
without network access as is common for Linux package build and some
other CI environments.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2025-01-17 18:27:30 +01:00
parent 4d19935f48
commit f9a43c8c40
No known key found for this signature in database
7 changed files with 88 additions and 20 deletions

View file

@ -29,6 +29,7 @@ usage:
options:
--help - print this help
--fetch-only - only fetch sources
--force-rebuild - rebuild all
--without-nvtt - don't build nvtt
--with-system-cxxtest - don't build cxxtest
@ -55,6 +56,7 @@ while [ "$#" -gt 0 ]; do
print_help
exit
;;
--fetch-only) build_sh_options="$build_sh_options --fetch-only" ;;
--force-rebuild) build_sh_options="$build_sh_options --force-rebuild" ;;
--without-nvtt) without_nvtt=true ;;
--with-system-cxxtest) with_system_cxxtest=true ;;

View file

@ -6,9 +6,19 @@ cd "$(dirname "$0")"
PV=4.4
LIB_VERSION=${PV}+wfg1
fetch()
{
curl -fLo "cxxtest-${PV}.tar.gz" \
"https://github.com/CxxTest/cxxtest/releases/download/${PV}/cxxtest-${PV}.tar.gz"
}
echo "Building CxxTest..."
while [ "$#" -gt 0 ]; do
case "$1" in
--fetch-only)
fetch
exit
;;
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
@ -25,8 +35,7 @@ fi
# fetch
if [ ! -e "cxxtest-${PV}.tar.gz" ]; then
curl -fLo "cxxtest-${PV}.tar.gz" \
"https://github.com/CxxTest/cxxtest/releases/download/${PV}/cxxtest-${PV}.tar.gz"
fetch
fi
# unpack

View file

@ -3,11 +3,24 @@ set -e
cd "$(dirname "$0")"
LIB_VERSION=28209
PV=28209
LIB_VERSION=${PV}
fetch()
{
rm -Rf fcollada-${PV}
svn export https://svn.wildfiregames.com/public/source-libs/trunk/fcollada@${PV} fcollada-${PV}
tar cJf 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"
@ -23,20 +36,22 @@ if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}"
fi
# fetch
svn co "https://svn.wildfiregames.com/public/source-libs/trunk/fcollada@${LIB_VERSION}" fcollada-svn
if [ ! -e "fcollada-${PV}.tar.xz" ]; then
fetch
fi
# unpack
rm -Rf fcollada-build
cp -R fcollada-svn fcollada-build
rm -Rf fcollada-${PV}
tar xf fcollada-${PV}.tar.xz
# build
(
cd fcollada-build
cd fcollada-${PV}
./build.sh
)
# install
rm -Rf include lib
cp -R fcollada-build/include fcollada-build/lib .
cp -R fcollada-${PV}/include fcollada-${PV}/lib .
echo "${LIB_VERSION}" >.already-built

View file

@ -3,11 +3,24 @@ set -e
cd "$(dirname "$0")"
LIB_VERSION=28209
PV=28209
LIB_VERSION=${PV}
fetch()
{
rm -Rf nvtt-${PV}
svn export https://svn.wildfiregames.com/public/source-libs/trunk/nvtt@${PV} nvtt-${PV}
tar cJf nvtt-${PV}.tar.xz nvtt-${PV}
rm -R nvtt-${PV}
}
echo "Building NVTT..."
while [ "$#" -gt 0 ]; do
case "$1" in
--fetch-only)
fetch
exit
;;
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
@ -23,21 +36,23 @@ if [ -e .already-built ] && [ "$(cat .already-built || true)" = "${LIB_VERSION}"
fi
# fetch
svn co "https://svn.wildfiregames.com/public/source-libs/trunk/nvtt@${LIB_VERSION}" nvtt-svn
if [ ! -e "nvtt-${PV}.tar.xz" ]; then
fetch
fi
# unpack
rm -Rf nvtt-build
cp -R nvtt-svn nvtt-build
rm -Rf nvtt-${PV}
tar xf nvtt-${PV}.tar.xz
# build
(
cd nvtt-build
cd nvtt-${PV}
mkdir bin lib
./build.sh
)
# install
rm -Rf bin include lib
cp -R nvtt-build/bin nvtt-build/include nvtt-build/lib .
cp -R nvtt-${PV}/bin nvtt-${PV}/include nvtt-${PV}/lib .
echo "${LIB_VERSION}" >.already-built

View file

@ -10,9 +10,19 @@ cd "$(dirname "$0")"
PV=5.0.0-beta3
LIB_VERSION=${PV}+wfg1
fetch()
{
curl -fLo "premake-core-${PV}.tar.gz" \
"https://github.com/premake/premake-core/archive/refs/tags/v${PV}.tar.gz"
}
echo "Building Premake..."
while [ "$#" -gt 0 ]; do
case "$1" in
--fetch-only)
fetch
exit
;;
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
@ -29,8 +39,7 @@ fi
# fetch
if [ ! -e "premake-core-${PV}.tar.gz" ]; then
curl -fLo "premake-core-${PV}.tar.gz" \
"https://github.com/premake/premake-core/archive/refs/tags/v${PV}.tar.gz"
fetch
fi
# unpack

View file

@ -9,9 +9,19 @@ FOLDER="mozjs-115.16.1"
LIB_VERSION="115.16.1+3"
LIB_NAME="mozjs115"
fetch()
{
curl -fLo "${FOLDER}.tar.xz" \
"https://releases.wildfiregames.com/libs/${FOLDER}.tar.xz"
}
echo "Building SpiderMonkey..."
while [ "$#" -gt 0 ]; do
case "$1" in
--fetch-only)
fetch
exit
;;
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
@ -32,8 +42,7 @@ OS="${OS:=$(uname -s)}"
# This tarball is built from https://ftp.mozilla.org/pub/firefox/releases/115.16.1esr/source/
# by running js/src/make-source-package.py
if [ ! -e "${FOLDER}.tar.xz" ]; then
curl -fLo "${FOLDER}.tar.xz" \
"https://releases.wildfiregames.com/libs/${FOLDER}.tar.xz"
fetch
fi
# unpack

View file

@ -6,9 +6,19 @@ cd "$(dirname "$0")"
PV=1.3.290.0
LIB_VERSION=${PV}
fetch()
{
curl -fLo "vulkan-sdk-${PV}.tar.gz" \
"https://github.com/KhronosGroup/SPIRV-Reflect/archive/refs/tags/vulkan-sdk-${PV}.tar.gz"
}
echo "Building SPIRV-Reflect..."
while [ "$#" -gt 0 ]; do
case "$1" in
--fetch-only)
fetch
exit
;;
--force-rebuild) rm -f .already-built ;;
*)
echo "Unknown option: $1"
@ -25,8 +35,7 @@ fi
# fetch
if [ ! -e "vulkan-sdk-${PV}.tar.gz" ]; then
curl -fLo "vulkan-sdk-${PV}.tar.gz" \
"https://github.com/KhronosGroup/SPIRV-Reflect/archive/refs/tags/vulkan-sdk-${PV}.tar.gz"
fetch
fi
# unpack