diff --git a/.gitignore b/.gitignore index ff9c4661bc..ae0f5e476e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,9 +14,7 @@ build/workspaces/vc2015 build/workspaces/vs2017 # Libraries -libraries/osx/* -!libraries/osx/patches -!libraries/osx/build-osx-libs.sh +libraries/macos libraries/source libraries/win32 diff --git a/build/premake/extern_libs5.lua b/build/premake/extern_libs5.lua index 477aadbcb2..71c2bcb0d7 100644 --- a/build/premake/extern_libs5.lua +++ b/build/premake/extern_libs5.lua @@ -7,7 +7,7 @@ -- directory in which OS-specific library subdirectories reside. if os.istarget("macosx") then - libraries_dir = rootdir.."/libraries/osx/" + libraries_dir = rootdir.."/libraries/macos/" elseif os.istarget("windows") then libraries_dir = rootdir.."/libraries/win32/" else diff --git a/build/workspaces/update-workspaces.sh b/build/workspaces/update-workspaces.sh index 47f1b2b6aa..4f3a400082 100755 --- a/build/workspaces/update-workspaces.sh +++ b/build/workspaces/update-workspaces.sh @@ -38,7 +38,7 @@ if [ "$enable_atlas" = "true" ]; then premake_args="${premake_args} --atlas" if [ "$(uname -s)" = "Darwin" ]; then # Provide path to wx-config on OS X (as wxwidgets doesn't support pkgconfig) - export WX_CONFIG="${WX_CONFIG:="$(pwd)/../../libraries/osx/wxwidgets/bin/wx-config"}" + export WX_CONFIG="${WX_CONFIG:="$(pwd)/../../libraries/macos/wxwidgets/bin/wx-config"}" else export WX_CONFIG="${WX_CONFIG:="wx-config"}" fi diff --git a/libraries/LICENSE.txt b/libraries/LICENSE.txt index ac421fcffd..2f6fac8acf 100644 --- a/libraries/LICENSE.txt +++ b/libraries/LICENSE.txt @@ -1,7 +1,7 @@ This directory holds libraries that are used by the game. Libraries are downloaded by running the correct script for your platform. -osx/ contains a script for download and building required libraries on OS X. +build-macos-libs.sh downloads and builds required libraries on macOS. build-source-libs.sh downloads and builds a checkout of source libraries that we bundle, when the game requires a specific library version @@ -10,10 +10,10 @@ build-source-libs.sh downloads and builds a checkout of source libraries get-windows-libs.bat downloads a checkout of headers and precompiled libraries that we bundle for Windows builds. - osx/build-osx-libs.sh + build-macos-libs.sh MIT - osx/patches + macos-patches see license of applicable library source/cxxtest-4.4 diff --git a/libraries/osx/build-osx-libs.sh b/libraries/build-macos-libs.sh similarity index 96% rename from libraries/osx/build-osx-libs.sh rename to libraries/build-macos-libs.sh index 52e779ffc5..1599dda87b 100755 --- a/libraries/osx/build-osx-libs.sh +++ b/libraries/build-macos-libs.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Script for acquiring and building OS X dependencies for 0 A.D. +# Script for acquiring and building macOS dependencies for 0 A.D. # # The script checks whether a source tarball exists for each # dependency, if not it will download the correct version from @@ -54,7 +54,9 @@ MOLTENVK_VERSION="1.2.2" # * SpiderMonkey # * NVTT # * FCollada - +# -------------------------------------------------------------- +source_svnrev="28083" +# -------------------------------------------------------------- # Provided by OS X: # * OpenAL # * OpenGL @@ -143,9 +145,9 @@ already_built() echo -e "Skipping - already built (use --force-rebuild to override)" } -# Check that we're actually on OS X +# Check that we're actually on macOS if [ "`uname -s`" != "Darwin" ]; then - die "This script is intended for OS X only" + die "This script is intended for macOS only" fi # Parse command-line options: @@ -159,8 +161,10 @@ do esac done -cd "$(dirname $0)" -# Now in libraries/osx/ (where we assume this script resides) +cd "$(dirname $0)" # Now in libraries/ (where we assume this script resides) +mkdir -p macos +cd macos + # Create a location to create copies of dependencies' *.pc files, so they can be found by pkg-config PC_PATH="$(pwd)/pkgconfig/" @@ -192,7 +196,7 @@ then pushd $LIB_DIRECTORY # patch zlib's configure script to use our CFLAGS and LDFLAGS - (patch -Np0 -i ../../patches/zlib_flags.diff \ + (patch -Np0 -i ../../../macos-patches/zlib_flags.diff \ && CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \ ./configure --prefix="$ZLIB_DIR" \ --static \ @@ -758,7 +762,7 @@ then # Patch GNUTLS for a linking issue with isdigit # Patch by Ross Nicholson: https://gitlab.com/gnutls/gnutls/-/issues/1033#note_379529145 - (patch -Np1 -i ../../patches/03-undo-libtasn1-cisdigit.patch \ + (patch -Np1 -i ../../../macos-patches/03-undo-libtasn1-cisdigit.patch \ && ./configure CFLAGS="$CFLAGS" \ CXXFLAGS="$CXXFLAGS" \ LDFLAGS="$LDFLAGS" \ @@ -1020,7 +1024,7 @@ then pushd $LIB_DIRECTORY # It appears that older versions of Clang require constexpr statements to have a user-set constructor. - patch -Np1 -i ../../patches/fmt_constexpr.diff + patch -Np1 -i ../../../macos-patches/fmt_constexpr.diff mkdir -p build pushd build @@ -1071,7 +1075,17 @@ popd > /dev/null # -------------------------------------------------------------------- # The following libraries are shared on different OSes and may # be customized, so we build and install them from bundled sources +# (served over SVN) # -------------------------------------------------------------------- + +if [ -e ../source/.svn ]; then + pushd ../source > /dev/null + svn cleanup && svn up -r $source_svnrev + popd > /dev/null +else + svn co -r $source_svnrev https://svn.wildfiregames.com/public/source-libs/trunk ../source +fi + # SpiderMonkey - bundled, no download pushd ../source/spidermonkey/ > /dev/null @@ -1082,6 +1096,7 @@ 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/ popd > /dev/null @@ -1095,6 +1110,7 @@ then fi CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" CMAKE_FLAGS=$CMAKE_FLAGS JOBS="$JOBS" ./build.sh || die "Error building NVTT" +cp bin/* ../../../binaries/system/ popd > /dev/null @@ -1108,5 +1124,6 @@ then fi CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" JOBS="$JOBS" ./build.sh || die "Error building FCollada" +cp bin/* ../../../binaries/system/ popd > /dev/null diff --git a/libraries/build-source-libs.sh b/libraries/build-source-libs.sh index 1da330391d..da3009de92 100755 --- a/libraries/build-source-libs.sh +++ b/libraries/build-source-libs.sh @@ -11,7 +11,7 @@ die() source_svnrev="28083" if [ "`uname -s`" = "Darwin" ]; then - echo 'This script should not be used on macOS: use build-osx-libs.sh instead.' + echo 'This script should not be used on macOS: use build-macos-libs.sh instead.' exit 1 fi diff --git a/libraries/osx/patches/03-undo-libtasn1-cisdigit.patch b/libraries/macos-patches/03-undo-libtasn1-cisdigit.patch similarity index 100% rename from libraries/osx/patches/03-undo-libtasn1-cisdigit.patch rename to libraries/macos-patches/03-undo-libtasn1-cisdigit.patch diff --git a/libraries/osx/patches/fmt_constexpr.diff b/libraries/macos-patches/fmt_constexpr.diff similarity index 100% rename from libraries/osx/patches/fmt_constexpr.diff rename to libraries/macos-patches/fmt_constexpr.diff diff --git a/libraries/osx/patches/zlib_flags.diff b/libraries/macos-patches/zlib_flags.diff similarity index 100% rename from libraries/osx/patches/zlib_flags.diff rename to libraries/macos-patches/zlib_flags.diff