diff --git a/.gitignore b/.gitignore index b58e6336cf..9445621b08 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/libraries/build-macos-libs.sh b/libraries/build-macos-libs.sh index 2e3e21c487..d37ecd98e2 100755 --- a/libraries/build-macos-libs.sh +++ b/libraries/build-macos-libs.sh @@ -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" diff --git a/libraries/build-source-libs.sh b/libraries/build-source-libs.sh index e7340a6dda..b37d76f3d1 100755 --- a/libraries/build-source-libs.sh +++ b/libraries/build-source-libs.sh @@ -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." diff --git a/libraries/source/cxxtest-4.4/build.sh b/libraries/source/cxxtest-4.4/build.sh new file mode 100755 index 0000000000..317ed8233d --- /dev/null +++ b/libraries/source/cxxtest-4.4/build.sh @@ -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 diff --git a/libraries/source/fcollada/build.sh b/libraries/source/fcollada/build.sh new file mode 100755 index 0000000000..2f332934d5 --- /dev/null +++ b/libraries/source/fcollada/build.sh @@ -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 diff --git a/libraries/source/nvtt/build.sh b/libraries/source/nvtt/build.sh new file mode 100755 index 0000000000..75183ed7ba --- /dev/null +++ b/libraries/source/nvtt/build.sh @@ -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 diff --git a/libraries/source/spidermonkey/build.sh b/libraries/source/spidermonkey/build.sh new file mode 100755 index 0000000000..ed83e80fc0 --- /dev/null +++ b/libraries/source/spidermonkey/build.sh @@ -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