Index: build/premake/premake5.lua =================================================================== --- build/premake/premake5.lua +++ build/premake/premake5.lua @@ -313,10 +313,9 @@ links { "gcov" } end - -- MacOS always provides SSE3 so enable that. - -- TODO: after <10.12 support is dropped, we can assume SSE4.1 is present. + -- MacOS 10.12 only supports processors with SSE 4.1, so enable that. if os.istarget("macosx") then - buildoptions { "-msse3" } + buildoptions { "-msse4.1" } end -- Check if SDK path should be used Index: libraries/osx/build-osx-libs.sh =================================================================== --- libraries/osx/build-osx-libs.sh +++ libraries/osx/build-osx-libs.sh @@ -21,30 +21,30 @@ # -------------------------------------------------------------- # Library versions for ease of updating: ZLIB_VERSION="zlib-1.2.11" -CURL_VERSION="curl-7.59.0" -ICONV_VERSION="libiconv-1.15" -XML2_VERSION="libxml2-2.9.8" -SDL2_VERSION="SDL2-2.0.5" +CURL_VERSION="curl-7.71.0" +ICONV_VERSION="libiconv-1.16" +XML2_VERSION="libxml2-2.9.10" +SDL2_VERSION="SDL2-2.0.12" # NOTE: remember to also update LIB_URL below when changing version -BOOST_VERSION="boost_1_64_0" +BOOST_VERSION="boost_1_74_0" # NOTE: remember to also update LIB_URL below when changing version WXWIDGETS_VERSION="wxWidgets-3.0.3.1" # libpng was included as part of X11 but that's removed from Mountain Lion # (also the Snow Leopard version was ancient 1.2) -PNG_VERSION="libpng-1.6.34" -OGG_VERSION="libogg-1.3.3" -VORBIS_VERSION="libvorbis-1.3.6" +PNG_VERSION="libpng-1.6.36" +OGG_VERSION="libogg-1.3.4" +VORBIS_VERSION="libvorbis-1.3.7" # gloox requires GnuTLS, GnuTLS requires Nettle and GMP -GMP_VERSION="gmp-6.1.2" -NETTLE_VERSION="nettle-3.5.1" +GMP_VERSION="gmp-6.2.0" +NETTLE_VERSION="nettle-3.6" # NOTE: remember to also update LIB_URL below when changing version -GNUTLS_VERSION="gnutls-3.6.13" -GLOOX_VERSION="gloox-1.0.22" +GLOOX_VERSION="gloox-1.0.24" +GNUTLS_VERSION="gnutls-3.6.15" # OS X only includes part of ICU, and only the dylib # NOTE: remember to also update LIB_URL below when changing version -ICU_VERSION="icu4c-59_2" -ENET_VERSION="enet-1.3.13" -MINIUPNPC_VERSION="miniupnpc-2.0.20180222" +ICU_VERSION="icu4c-67_1" +ENET_VERSION="enet-1.3.17" +MINIUPNPC_VERSION="miniupnpc-2.1" SODIUM_VERSION="libsodium-1.0.18" # -------------------------------------------------------------- # Bundled with the game: @@ -61,12 +61,8 @@ # * OpenGL # -------------------------------------------------------------- -# Define compiler as "clang", this is all Mavericks supports. -# gcc symlinks may still exist, but they are simply clang with -# slightly different config, which confuses build scripts. -# llvm-gcc and gcc 4.2 are no longer supported by SpiderMonkey. export CC=${CC:="clang"} CXX=${CXX:="clang++"} -export MIN_OSX_VERSION=${MIN_OSX_VERSION:="10.9"} +export MIN_OSX_VERSION=${MIN_OSX_VERSION:="10.12"} # The various libs offer inconsistent configure options, some allow # setting sysroot and OS X-specific options, others don't. Adding to @@ -89,7 +85,7 @@ fi CFLAGS="$CFLAGS $C_FLAGS -fvisibility=hidden" -CXXFLAGS="$CXXFLAGS $C_FLAGS -stdlib=libc++ -std=c++14 -msse3" +CXXFLAGS="$CXXFLAGS $C_FLAGS -stdlib=libc++ -std=c++14 -msse4.1" OBJCFLAGS="$OBJCFLAGS $C_FLAGS" OBJCXXFLAGS="$OBJCXXFLAGS $C_FLAGS" @@ -355,7 +351,7 @@ LIB_VERSION="${BOOST_VERSION}" LIB_ARCHIVE="$LIB_VERSION.tar.bz2" LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="https://dl.bintray.com/boostorg/release/1.64.0/source/" +LIB_URL="https://dl.bintray.com/boostorg/release/1.74.0/source/" mkdir -p boost pushd boost > /dev/null @@ -668,10 +664,9 @@ tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY - # GnuTLS 3.6.8 added the TCP Fast Open feature, which requires connectx - # but that's only available on OS X 10.11+ (GnuTLS doesn't support SDK based builds yet) - # So we disable that functionality - (patch -Np0 -i ../../patches/gnutls-disable-tcpfastopen.diff \ + # 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 \ && ./configure CFLAGS="$CFLAGS" \ CXXFLAGS="$CXXFLAGS" \ LDFLAGS="$LDFLAGS" \ @@ -690,6 +685,7 @@ --without-p11-kit \ --disable-tests \ --disable-guile \ + --disable-doc \ --disable-nls \ && make ${JOBS} LDFLAGS= install) || die "GnuTLS build failed" popd @@ -750,7 +746,7 @@ LIB_VERSION="${ICU_VERSION}" LIB_ARCHIVE="$LIB_VERSION-src.tgz" LIB_DIRECTORY="icu" -LIB_URL="https://github.com/unicode-org/icu/releases/download/release-59-2/" +LIB_URL="https://github.com/unicode-org/icu/releases/download/release-67-1/" mkdir -p $LIB_DIRECTORY pushd icu > /dev/null Index: libraries/osx/patches/03-undo-libtasn1-cisdigit.patch =================================================================== --- /dev/null +++ libraries/osx/patches/03-undo-libtasn1-cisdigit.patch @@ -0,0 +1,142 @@ +--- a/lib/minitasn1/decoding.c ++++ b/lib/minitasn1/decoding.c +@@ -32,7 +32,6 @@ + #include + #include + #include +-#include + + #ifdef DEBUG + # define warn() fprintf(stderr, "%s: %d\n", __func__, __LINE__) +@@ -353,7 +352,7 @@ + p = &der[len_len]; + for (i=0;i<(unsigned)(str_len-1);i++) + { +- if (c_isdigit(p[i]) == 0) ++ if (isdigit(p[i]) == 0) + { + if (type == ASN1_ETYPE_GENERALIZED_TIME) + { +--- a/lib/minitasn1/element.c ++++ b/lib/minitasn1/element.c +@@ -30,7 +30,6 @@ + #include "parser_aux.h" + #include + #include "structure.h" +-#include "c-ctype.h" + #include "element.h" + + void +@@ -380,7 +379,7 @@ + case ASN1_ETYPE_ENUMERATED: + if (len == 0) + { +- if ((c_isdigit (value[0])) || (value[0] == '-')) ++ if ((isdigit (value[0])) || (value[0] == '-')) + { + value_temp = malloc (SIZEOF_UNSIGNED_LONG_INT); + if (value_temp == NULL) +@@ -453,7 +452,7 @@ + p = node->down; + while (type_field (p->type) != ASN1_ETYPE_DEFAULT) + p = p->right; +- if ((c_isdigit (p->value[0])) || (p->value[0] == '-')) ++ if ((isdigit (p->value[0])) || (p->value[0] == '-')) + { + default_temp = malloc (SIZEOF_UNSIGNED_LONG_INT); + if (default_temp == NULL) +@@ -519,7 +518,7 @@ + break; + case ASN1_ETYPE_OBJECT_ID: + for (i = 0; i < _asn1_strlen (value); i++) +- if ((!c_isdigit (value[i])) && (value[i] != '.') && (value[i] != '+')) ++ if ((!isdigit (value[i])) && (value[i] != '.') && (value[i] != '+')) + return ASN1_VALUE_NOT_VALID; + if (node->type & CONST_DEFAULT) + { +@@ -540,7 +539,7 @@ + if (len < 11) + return ASN1_VALUE_NOT_VALID; + for (k = 0; k < 10; k++) +- if (!c_isdigit (value[k])) ++ if (!isdigit (value[k])) + return ASN1_VALUE_NOT_VALID; + switch (len) + { +@@ -549,7 +548,7 @@ + return ASN1_VALUE_NOT_VALID; + break; + case 13: +- if ((!c_isdigit (value[10])) || (!c_isdigit (value[11])) || ++ if ((!isdigit (value[10])) || (!isdigit (value[11])) || + (value[12] != 'Z')) + return ASN1_VALUE_NOT_VALID; + break; +@@ -557,16 +556,16 @@ + if ((value[10] != '+') && (value[10] != '-')) + return ASN1_VALUE_NOT_VALID; + for (k = 11; k < 15; k++) +- if (!c_isdigit (value[k])) ++ if (!isdigit (value[k])) + return ASN1_VALUE_NOT_VALID; + break; + case 17: +- if ((!c_isdigit (value[10])) || (!c_isdigit (value[11]))) ++ if ((!isdigit (value[10])) || (!isdigit (value[11]))) + return ASN1_VALUE_NOT_VALID; + if ((value[12] != '+') && (value[12] != '-')) + return ASN1_VALUE_NOT_VALID; + for (k = 13; k < 17; k++) +- if (!c_isdigit (value[k])) ++ if (!isdigit (value[k])) + return ASN1_VALUE_NOT_VALID; + break; + default: +@@ -890,7 +889,7 @@ + p = node->down; + while (type_field (p->type) != ASN1_ETYPE_DEFAULT) + p = p->right; +- if ((c_isdigit (p->value[0])) || (p->value[0] == '-') ++ if ((isdigit (p->value[0])) || (p->value[0] == '-') + || (p->value[0] == '+')) + { + result = _asn1_convert_integer + +--- a/lib/minitasn1/int.h ++++ b/lib/minitasn1/int.h +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + + #ifdef HAVE_SYS_TYPES_H +--- a/lib/minitasn1/parser_aux.c ++++ b/lib/minitasn1/parser_aux.c +@@ -26,7 +26,6 @@ + #include "gstr.h" + #include "structure.h" + #include "element.h" +-#include "c-ctype.h" + + char _asn1_identifierMissing[ASN1_MAX_NAME_SIZE + 1]; /* identifier name not found */ + +@@ -755,7 +754,7 @@ + p2 = p->down; + if (p2 && (type_field (p2->type) == ASN1_ETYPE_CONSTANT)) + { +- if (p2->value && !c_isdigit (p2->value[0])) ++ if (p2->value && !isdigit (p2->value[0])) + { + _asn1_str_cpy (name2, sizeof (name2), name_root); + _asn1_str_cat (name2, sizeof (name2), "."); +@@ -1067,7 +1066,7 @@ + p2 = p->down; + if (p2 && (type_field (p2->type) == ASN1_ETYPE_CONSTANT)) + { +- if (p2->value && !c_isdigit (p2->value[0])) ++ if (p2->value && !isdigit (p2->value[0])) + { + _asn1_str_cpy (name2, sizeof (name2), node->name); + _asn1_str_cat (name2, sizeof (name2), "."); Index: libraries/osx/patches/gnutls-disable-tcpfastopen.diff =================================================================== --- libraries/osx/patches/gnutls-disable-tcpfastopen.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/system/fastopen.c 2019-03-15 05:10:27.000000000 -0400 -+++ lib/system/fastopen.c 2019-07-10 07:53:30.000000000 -0400 -@@ -38,7 +38,7 @@ - - /* TCP Fast Open on OSX behaves differently from Linux, so define these helpers */ - #if defined __APPLE__ && defined __MACH__ && defined CONNECT_DATA_IDEMPOTENT && defined CONNECT_RESUME_ON_READ_WRITE --# define TCP_FASTOPEN_OSX -+//# define TCP_FASTOPEN_OSX - #elif defined TCP_FASTOPEN && defined MSG_FASTOPEN - # define TCP_FASTOPEN_LINUX - #endif Index: source/tools/dist/build-osx-bundle.sh =================================================================== --- source/tools/dist/build-osx-bundle.sh +++ source/tools/dist/build-osx-bundle.sh @@ -8,16 +8,12 @@ # the chosen target and compatible systems. # -# Force build architecture, as sometimes environment is broken. -# For a universal fat binary, the approach would be to build every -# library with both archs and combine them with lipo, then do the -# same thing with the game itself. -# Choices are "x86_64" or "i386" (ppc and ppc64 not supported) +# TODO: is there anything to do for ARM support? export ARCH=${ARCH:="x86_64"} # Set mimimum required OS X version, SDK location and tools # Old SDKs can be found at https://github.com/phracker/MacOSX-SDKs -export MIN_OSX_VERSION=${MIN_OSX_VERSION:="10.9"} +export MIN_OSX_VERSION=${MIN_OSX_VERSION:="10.12"} export SYSROOT=${SYSROOT:="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${MIN_OSX_VERSION}.sdk"} export CC=${CC:="clang"} CXX=${CXX:="clang++"}