1
0
forked from 0ad/0ad

Split source package downloads

Instead of fetching the whole svn repo containing all current
dependencies into source, fetch them individually into subdirectories of
source.

Adds a wrapper script to each package to place the build output where
it's currently expected.

This allows adding and removing dependencies as well as changing origin
of those packages on a case by case basis.

It's recommended to run "git clean -dxf libraries/source" to free up
extra space and remove untracked files no longer covered by changes in
.gitignore.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2024-08-29 13:17:33 +02:00
parent 2b5ecd02a7
commit 26994b156b
7 changed files with 156 additions and 74 deletions

8
.gitignore vendored
View File

@ -14,9 +14,15 @@ build/workspaces/vs2017
# Libraries
libraries/macos
libraries/source
libraries/win32
libraries/source/cxxtest-4.4/*
libraries/source/fcollada/*
libraries/source/nvtt/*
libraries/source/spidermonkey/*
!libraries/source/**/build.sh
!libraries/source/**/patches/
# premake5 build files, adapted from upstream
build/premake/premake5/**/.gitignore
build/premake/premake5/**/.travis.yml

View File

@ -55,7 +55,6 @@ MOLTENVK_VERSION="1.2.2"
# * NVTT
# * FCollada
# --------------------------------------------------------------
source_svnrev="28207"
# --------------------------------------------------------------
# Provided by OS X:
# * OpenAL
@ -1120,55 +1119,27 @@ echo "Building Molten VK..."
# --------------------------------------------------------------------
# The following libraries are shared on different OSes and may
# be customized, so we build and install them from bundled sources
# (served over SVN)
# (served over SVN or other sources)
# --------------------------------------------------------------------
if [ -e ../source/.svn ]; then
(
cd ../source
svn cleanup
svn up -r $source_svnrev
) || die "Failed update of source libs"
else
svn co -r $source_svnrev https://svn.wildfiregames.com/public/source-libs/trunk ../source
fi
# SpiderMonkey - bundled, no download
(
cd ../source/spidermonkey/
if [ $force_rebuild = "true" ]; then
rm -f .already-built
fi
# Use the regular build script for SM.
JOBS="$JOBS" ZLIB_DIR="$ZLIB_DIR" ARCH="$ARCH" ./build.sh || die "Error building spidermonkey"
cp bin/* ../../../binaries/system/
) || die "Failed to build spidermonkey"
export ARCH CXXFLAGS CFLAGS LDFLAGS CMAKE_FLAGS JOBS
# --------------------------------------------------------------
# NVTT - bundled, no download
(
cd ../source/nvtt
echo "Building cxxtest..."
if [ $force_rebuild = "true" ]; then
rm -f .already-built
fi
CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CMAKE_FLAGS=$CMAKE_FLAGS JOBS="$JOBS" ./build.sh || die "Error building NVTT"
cp bin/* ../../../binaries/system/
) || die "Failed to build nvtt"
./../source/cxxtest-4.4/build.sh || die "cxxtest build failed"
# --------------------------------------------------------------
# FCollada - bundled, no download
(
cd ../source/fcollada/
echo "Building FCollada..."
if [ $force_rebuild = "true" ]; then
rm -f .already-built
fi
./../source/fcollada/build.sh || die "FCollada build failed"
CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" JOBS="$JOBS" ./build.sh || die "Error building FCollada"
cp bin/* ../../../binaries/system/
) || die "Failed to build fcollada"
# --------------------------------------------------------------
echo "Building nvtt..."
./../source/nvtt/build.sh || die "NVTT build failed"
# --------------------------------------------------------------
echo "Building Spidermonkey..."
./../source/spidermonkey/build.sh || die "SpiderMonkey build failed"

View File

@ -6,10 +6,6 @@ die()
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
die "This script should not be used on macOS: use build-macos-libs.sh instead."
fi
@ -40,19 +36,6 @@ for i in "$@"; do
esac
done
# Download source libs
echo "Downloading source libs..."
echo
if [ -e source/.svn ]; then
(cd source && svn cleanup && svn up -r $source_svnrev)
else
svn co -r $source_svnrev https://svn.wildfiregames.com/public/source-libs/trunk source
fi
# Build/update bundled external libraries
echo "Building third-party dependencies..."
echo
# Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE
# is not set.
case "$(uname -s)" in
@ -64,25 +47,25 @@ case "$(uname -s)" in
;;
esac
(cd source/fcollada && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "FCollada build failed"
echo
if [ "$with_system_nvtt" = "false" ] && [ "$without_nvtt" = "false" ]; then
(cd source/nvtt && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "NVTT build failed"
fi
echo
if [ "$with_system_mozjs" = "false" ]; then
(cd source/spidermonkey && MAKE=${MAKE} JOBS=${JOBS} ./build.sh) || die "SpiderMonkey build failed"
fi
export MAKE JOBS
# Build/update bundled external libraries
echo "Building third-party dependencies..."
echo
echo "Copying built files..."
# Copy built binaries to binaries/system/
cp source/fcollada/bin/* ../binaries/system/
./source/cxxtest-4.4/build.sh || die "cxxtest build failed"
echo
./source/fcollada/build.sh || die "FCollada build failed"
echo
if [ "$with_system_nvtt" = "false" ] && [ "$without_nvtt" = "false" ]; then
./source/nvtt/build.sh || die "NVTT build failed"
cp source/nvtt/bin/* ../binaries/system/
fi
echo
if [ "$with_system_mozjs" = "false" ]; then
./source/spidermonkey/build.sh || die "SpiderMonkey build failed"
cp source/spidermonkey/bin/* ../binaries/system/
fi
echo
echo "Done."

View File

@ -0,0 +1,27 @@
#!/bin/sh
set -e
cd "$(dirname "$0")"
LIB_VERSION=28209
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]; then
echo "cxxtest-4.4 is already up to date."
exit
fi
# fetch
svn co https://svn.wildfiregames.com/public/source-libs/trunk/cxxtest-4.4@${LIB_VERSION} cxxtest-4.4-svn
# unpack
rm -Rf cxxtest-4.4-build
cp -R cxxtest-4.4-svn cxxtest-4.4-build
# nothing to actually build
# built as part of building tests
# install
rm -Rf bin cxxtest python
cp -R cxxtest-4.4-build/bin cxxtest-4.4-build/cxxtest cxxtest-4.4-build/python .
echo "${LIB_VERSION}" >.already-built

View File

@ -0,0 +1,30 @@
#!/bin/sh
set -e
cd "$(dirname "$0")"
LIB_VERSION=28209
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]; then
echo "FCollada is already up to date."
exit
fi
# fetch
svn co "https://svn.wildfiregames.com/public/source-libs/trunk/fcollada@${LIB_VERSION}" fcollada-svn
# unpack
rm -Rf fcollada-build
cp -R fcollada-svn fcollada-build
# build
(
cd fcollada-build
./build.sh
)
# install
rm -Rf include lib
cp -R fcollada-build/include fcollada-build/lib .
echo "${LIB_VERSION}" >.already-built

31
libraries/source/nvtt/build.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/sh
set -e
cd "$(dirname "$0")"
LIB_VERSION=28209
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]; then
echo "NVTT is already up to date."
exit
fi
# fetch
svn co "https://svn.wildfiregames.com/public/source-libs/trunk/nvtt@${LIB_VERSION}" nvtt-svn
# unpack
rm -Rf nvtt-build
cp -R nvtt-svn nvtt-build
# build
(
cd nvtt-build
mkdir bin lib
./build.sh
)
# install
rm -Rf bin include lib
cp -R nvtt-build/bin nvtt-build/include nvtt-build/lib .
echo "${LIB_VERSION}" >.already-built

View File

@ -0,0 +1,34 @@
#!/bin/sh
set -e
cd "$(dirname "$0")"
LIB_VERSION=28209
if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]; then
echo "Spidermonkey is already up to date."
exit
fi
# fetch
svn co "https://svn.wildfiregames.com/public/source-libs/trunk/spidermonkey@${LIB_VERSION}" spidermonkey-svn
# unpack
rm -Rf spidermonkey-build
cp -R spidermonkey-svn spidermonkey-build
# build
(
cd spidermonkey-build
mkdir bin lib
./build.sh
)
# install
rm -Rf bin include-unix-debug include-unix-release lib
cp -R spidermonkey-build/bin spidermonkey-build/include-unix-release spidermonkey-build/lib .
if [ "$(uname -s)" != "FreeBSD" ]; then
cp -R spidermonkey-build/include-unix-debug .
fi
echo "${LIB_VERSION}" >.already-built