Index: libraries/osx/build-osx-libs.sh =================================================================== --- libraries/osx/build-osx-libs.sh +++ libraries/osx/build-osx-libs.sh @@ -145,421 +145,421 @@ cd "$(dirname $0)" # Now in libraries/osx/ (where we assume this script resides) +# +# # -------------------------------------------------------------- +# echo -e "Building zlib..." +# +# LIB_VERSION="${ZLIB_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.gz" +# LIB_DIRECTORY=$LIB_VERSION +# LIB_URL="http://zlib.net/" +# +# mkdir -p zlib +# pushd zlib > /dev/null +# +# ZLIB_DIR="$(pwd)" +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY include lib share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # # patch zlib's configure script to use our CFLAGS and LDFLAGS + # (patch -p0 -i ../../patches/zlib_flags.diff && CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" ./configure --prefix="$ZLIB_DIR" --static && make ${JOBS} && make install) || die "zlib build failed" + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- + echo -e "Building libcurl..." + + LIB_VERSION="${CURL_VERSION}" + LIB_ARCHIVE="$LIB_VERSION.tar.bz2" + LIB_DIRECTORY="$LIB_VERSION" + LIB_URL="http://curl.haxx.se/download/" + + mkdir -p libcurl + pushd libcurl > /dev/null + + if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] + then + INSTALL_DIR="$(pwd)" + + rm -f .already-built + download_lib $LIB_URL $LIB_ARCHIVE + + rm -rf $LIB_DIRECTORY bin include lib share + tar -xf $LIB_ARCHIVE + pushd $LIB_DIRECTORY + + (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --enable-ipv6 --with-darwinssl --without-gssapi --without-libmetalink --without-libpsl --without-librtmp --without-libssh2 --without-nghttp2 --without-nss --without-polarssl --without-ssl --without-gnutls --without-brotli --without-cyassl --without-winssl --without-mbedtls --without-wolfssl --without-spnego --disable-ares --disable-ldap --disable-ldaps --without-libidn2 --with-zlib="${ZLIB_DIR}" --enable-shared=no && make ${JOBS} && make install) || die "libcurl build failed" + popd + touch .already-built + else + already_built + fi + popd > /dev/null + +# # -------------------------------------------------------------- +# echo -e "Building libiconv..." +# +# LIB_VERSION="${ICONV_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.gz" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="http://ftp.gnu.org/pub/gnu/libiconv/" +# +# mkdir -p iconv +# pushd iconv > /dev/null +# +# ICONV_DIR="$(pwd)" +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY bin include lib share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$ICONV_DIR" --without-libiconv-prefix --without-libintl-prefix --disable-nls --enable-shared=no && make ${JOBS} && make install) || die "libiconv build failed" + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# echo -e "Building libxml2..." +# +# LIB_VERSION="${XML2_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.gz" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="ftp://xmlsoft.org/libxml2/" +# +# mkdir -p libxml2 +# pushd libxml2 > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY bin include lib share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --without-lzma --without-python --with-iconv="${ICONV_DIR}" --with-zlib="${ZLIB_DIR}" --enable-shared=no && make ${JOBS} && make install) || die "libxml2 build failed" + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# +# echo -e "Building SDL2..." +# +# LIB_VERSION="${SDL2_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.gz" +# LIB_DIRECTORY=$LIB_VERSION +# LIB_URL="https://libsdl.org/release/" +# +# mkdir -p sdl2 +# pushd sdl2 > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY bin include lib share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # # We don't want SDL2 to pull in system iconv, force it to detect ours with flags. + # # Don't use X11 - we don't need it and Mountain Lion removed it + # (./configure CPPFLAGS="-I${ICONV_DIR}/include" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS -L${ICONV_DIR}/lib" --prefix="$INSTALL_DIR" --disable-video-x11 --without-x --enable-shared=no && make $JOBS && make install) || die "SDL2 build failed" + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# echo -e "Building Boost..." +# +# LIB_VERSION="${BOOST_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.bz2" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="http://download.sourceforge.net/boost/" +# +# mkdir -p boost +# pushd boost > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY include lib + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # # Can't use macosx-version, see above comment. +# (./bootstrap.sh --with-libraries=filesystem,system --prefix=$INSTALL_DIR && ./b2 cflags="$CFLAGS" toolset=clang cxxflags="$CXXFLAGS" linkflags="$LDFLAGS" ${JOBS} -d2 --layout=tagged --debug-configuration link=static threading=multi variant=release,debug install) || die "Boost build failed" +# + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# # TODO: This build takes ages, anything we can exclude? +# echo -e "Building wxWidgets..." +# +# LIB_VERSION="${WXWIDGETS_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.bz2" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="http://github.com/wxWidgets/wxWidgets/releases/download/v3.0.3.1/" +# +# mkdir -p wxwidgets +# pushd wxwidgets > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY bin include lib share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # mkdir -p build-release + # pushd build-release +# + # CONF_OPTS="--prefix=$INSTALL_DIR --disable-shared --enable-macosx_arch=$ARCH --enable-unicode --with-cocoa --with-opengl --with-libiconv-prefix=${ICONV_DIR} --with-expat=builtin --with-png=builtin --without-libtiff --without-sdl --without-x --disable-webview --disable-webkit --disable-webviewwebkit --disable-webviewie" + # # wxWidgets configure now defaults to targeting 10.5, if not specified, + # # but that conflicts with our flags + # if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then + # CONF_OPTS="$CONF_OPTS --with-macosx-version-min=$MIN_OSX_VERSION" + # fi + # (../configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" CPPFLAGS="-stdlib=libc++ -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=1" LDFLAGS="$LDFLAGS" $CONF_OPTS && make ${JOBS} && make install) || die "wxWidgets build failed" + # popd + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# echo -e "Building libpng..." +# +# LIB_VERSION="${PNG_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.gz" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="http://download.sourceforge.net/libpng/" +# +# mkdir -p libpng +# pushd libpng > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY bin include lib share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=$INSTALL_DIR --enable-shared=no && make ${JOBS} && make install) || die "libpng build failed" + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# echo -e "Building libogg..." +# +# LIB_VERSION="${OGG_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.gz" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="http://downloads.xiph.org/releases/ogg/" +# +# # Dependency of vorbis +# # we can install them in the same directory for convenience +# mkdir -p libogg +# mkdir -p vorbis +# +# pushd libogg > /dev/null +# OGG_DIR="$(pwd)" +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY include lib share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=$OGG_DIR --enable-shared=no && make ${JOBS} && make install) || die "libogg build failed" + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# echo -e "Building libvorbis..." +# +# LIB_VERSION="${VORBIS_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.gz" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="http://downloads.xiph.org/releases/vorbis/" +# +# pushd vorbis > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY include lib share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --enable-shared=no --with-ogg="$OGG_DIR" && make ${JOBS} && make install) || die "libvorbis build failed" + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# echo -e "Building GMP..." +# +# LIB_VERSION="${GMP_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.bz2" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="https://gmplib.org/download/gmp/" +# +# mkdir -p gmp +# pushd gmp > /dev/null +# +# GMP_DIR="$(pwd)" +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY bin include lib + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # (./configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --disable-shared && make ${JOBS} && make install) || die "GMP build failed" + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# echo -e "Building Nettle..." +# +# LIB_VERSION="${NETTLE_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.gz" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="https://ftp.gnu.org/gnu/nettle/" +# +# mkdir -p nettle +# pushd nettle > /dev/null +# +# NETTLE_DIR="$(pwd)" +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY bin include lib + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# +# (./configure CFLAGS="$CFLAGS -m64" CXXFLAGS="$CXXFLAGS -m64" LDFLAGS="$LDFLAGS -m64" --with-include-path="${GMP_DIR}/include" --with-lib-path="${GMP_DIR}/lib" --prefix="$INSTALL_DIR" --disable-shared --disable-documentation --disable-openssl --disable-assembler && make ${JOBS} && make install) || die "Nettle build failed" + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null # -------------------------------------------------------------- -echo -e "Building zlib..." - -LIB_VERSION="${ZLIB_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.gz" -LIB_DIRECTORY=$LIB_VERSION -LIB_URL="http://zlib.net/" - -mkdir -p zlib -pushd zlib > /dev/null - -ZLIB_DIR="$(pwd)" - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY include lib share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - # patch zlib's configure script to use our CFLAGS and LDFLAGS - (patch -p0 -i ../../patches/zlib_flags.diff && CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" ./configure --prefix="$ZLIB_DIR" --static && make ${JOBS} && make install) || die "zlib build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building libcurl..." - -LIB_VERSION="${CURL_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.bz2" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="http://curl.haxx.se/download/" - -mkdir -p libcurl -pushd libcurl > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --enable-ipv6 --with-darwinssl --without-gssapi --without-libmetalink --without-libpsl --without-librtmp --without-libssh2 --without-nghttp2 --without-nss --without-polarssl --without-ssl --without-gnutls --without-brotli --without-cyassl --without-winssl --without-mbedtls --without-wolfssl --without-spnego --disable-ares --disable-ldap --disable-ldaps --without-libidn2 --with-zlib="${ZLIB_DIR}" --enable-shared=no && make ${JOBS} && make install) || die "libcurl build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building libiconv..." - -LIB_VERSION="${ICONV_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.gz" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="http://ftp.gnu.org/pub/gnu/libiconv/" - -mkdir -p iconv -pushd iconv > /dev/null - -ICONV_DIR="$(pwd)" - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$ICONV_DIR" --without-libiconv-prefix --without-libintl-prefix --disable-nls --enable-shared=no && make ${JOBS} && make install) || die "libiconv build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building libxml2..." - -LIB_VERSION="${XML2_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.gz" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="ftp://xmlsoft.org/libxml2/" - -mkdir -p libxml2 -pushd libxml2 > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --without-lzma --without-python --with-iconv="${ICONV_DIR}" --with-zlib="${ZLIB_DIR}" --enable-shared=no && make ${JOBS} && make install) || die "libxml2 build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- - -echo -e "Building SDL2..." - -LIB_VERSION="${SDL2_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.gz" -LIB_DIRECTORY=$LIB_VERSION -LIB_URL="https://libsdl.org/release/" - -mkdir -p sdl2 -pushd sdl2 > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - # We don't want SDL2 to pull in system iconv, force it to detect ours with flags. - # Don't use X11 - we don't need it and Mountain Lion removed it - (./configure CPPFLAGS="-I${ICONV_DIR}/include" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS -L${ICONV_DIR}/lib" --prefix="$INSTALL_DIR" --disable-video-x11 --without-x --enable-shared=no && make $JOBS && make install) || die "SDL2 build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building Boost..." - -LIB_VERSION="${BOOST_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.bz2" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="http://download.sourceforge.net/boost/" - -mkdir -p boost -pushd boost > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY include lib - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - # Can't use macosx-version, see above comment. -(./bootstrap.sh --with-libraries=filesystem,system --prefix=$INSTALL_DIR && ./b2 cflags="$CFLAGS" toolset=clang cxxflags="$CXXFLAGS" linkflags="$LDFLAGS" ${JOBS} -d2 --layout=tagged --debug-configuration link=static threading=multi variant=release,debug install) || die "Boost build failed" - - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -# TODO: This build takes ages, anything we can exclude? -echo -e "Building wxWidgets..." - -LIB_VERSION="${WXWIDGETS_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.bz2" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="http://github.com/wxWidgets/wxWidgets/releases/download/v3.0.3.1/" - -mkdir -p wxwidgets -pushd wxwidgets > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - mkdir -p build-release - pushd build-release - - CONF_OPTS="--prefix=$INSTALL_DIR --disable-shared --enable-macosx_arch=$ARCH --enable-unicode --with-cocoa --with-opengl --with-libiconv-prefix=${ICONV_DIR} --with-expat=builtin --with-png=builtin --without-libtiff --without-sdl --without-x --disable-webview --disable-webkit --disable-webviewwebkit --disable-webviewie" - # wxWidgets configure now defaults to targeting 10.5, if not specified, - # but that conflicts with our flags - if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then - CONF_OPTS="$CONF_OPTS --with-macosx-version-min=$MIN_OSX_VERSION" - fi - (../configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" CPPFLAGS="-stdlib=libc++ -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=1" LDFLAGS="$LDFLAGS" $CONF_OPTS && make ${JOBS} && make install) || die "wxWidgets build failed" - popd - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building libpng..." - -LIB_VERSION="${PNG_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.gz" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="http://download.sourceforge.net/libpng/" - -mkdir -p libpng -pushd libpng > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=$INSTALL_DIR --enable-shared=no && make ${JOBS} && make install) || die "libpng build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building libogg..." - -LIB_VERSION="${OGG_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.gz" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="http://downloads.xiph.org/releases/ogg/" - -# Dependency of vorbis -# we can install them in the same directory for convenience -mkdir -p libogg -mkdir -p vorbis - -pushd libogg > /dev/null -OGG_DIR="$(pwd)" - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY include lib share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=$OGG_DIR --enable-shared=no && make ${JOBS} && make install) || die "libogg build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building libvorbis..." - -LIB_VERSION="${VORBIS_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.gz" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="http://downloads.xiph.org/releases/vorbis/" - -pushd vorbis > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY include lib share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --enable-shared=no --with-ogg="$OGG_DIR" && make ${JOBS} && make install) || die "libvorbis build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building GMP..." - -LIB_VERSION="${GMP_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.bz2" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="https://gmplib.org/download/gmp/" - -mkdir -p gmp -pushd gmp > /dev/null - -GMP_DIR="$(pwd)" - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - (./configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" --prefix="$INSTALL_DIR" --disable-shared && make ${JOBS} && make install) || die "GMP build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building Nettle..." - -LIB_VERSION="${NETTLE_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.gz" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="https://ftp.gnu.org/gnu/nettle/" - -mkdir -p nettle -pushd nettle > /dev/null - -NETTLE_DIR="$(pwd)" - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - -(./configure CFLAGS="$CFLAGS -m64" CXXFLAGS="$CXXFLAGS -m64" LDFLAGS="$LDFLAGS -m64" --with-include-path="${GMP_DIR}/include" --with-lib-path="${GMP_DIR}/lib" --prefix="$INSTALL_DIR" --disable-shared --disable-documentation --disable-openssl --disable-assembler && make ${JOBS} && make install) || die "Nettle build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building GnuTLS..." - -LIB_VERSION="${GNUTLS_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.xz" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/" - -mkdir -p gnutls -pushd gnutls > /dev/null - -GNUTLS_DIR="$(pwd)" - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - -(./configure CFLAGS="$CFLAGS -m64" CXXFLAGS="$CXXFLAGS -m64" LDFLAGS="$LDFLAGS -m64" NETTLE_CFLAGS="-I${NETTLE_DIR}/include" NETTLE_LIBS="-L${NETTLE_DIR}/lib -lnettle" HOGWEED_CFLAGS="-I${NETTLE_DIR}/include" HOGWEED_LIBS="-L${NETTLE_DIR}/lib -lhogweed" GMP_CFLAGS="-I${GMP_DIR}/include" GMP_LIBS="-L${GMP_DIR}/lib -lgmp" --prefix="$INSTALL_DIR" --enable-shared=no --without-idn --with-included-unistring --with-included-libtasn1 --without-p11-kit --disable-tests && make ${JOBS} && make install) || die "GnuTLS build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null +# echo -e "Building GnuTLS..." +# +# LIB_VERSION="${GNUTLS_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.xz" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/" +# +# mkdir -p gnutls +# pushd gnutls > /dev/null +# +# GNUTLS_DIR="$(pwd)" +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then +# INSTALL_DIR="$(pwd)" +# +# rm -f .already-built +# download_lib $LIB_URL $LIB_ARCHIVE +# +# rm -rf $LIB_DIRECTORY bin include lib +# tar -xf $LIB_ARCHIVE +# pushd $LIB_DIRECTORY +# +# (./configure CFLAGS="$CFLAGS -m64" CXXFLAGS="$CXXFLAGS -m64" LDFLAGS="$LDFLAGS -m64" NETTLE_CFLAGS="-I${NETTLE_DIR}/include" NETTLE_LIBS="-L${NETTLE_DIR}/lib -lnettle" HOGWEED_CFLAGS="-I${NETTLE_DIR}/include" HOGWEED_LIBS="-L${NETTLE_DIR}/lib -lhogweed" GMP_CFLAGS="-I${GMP_DIR}/include" GMP_LIBS="-L${GMP_DIR}/lib -lgmp" --prefix="$INSTALL_DIR" --enable-shared=no --without-idn --with-included-unistring --with-included-libtasn1 --without-p11-kit --disable-tests && make ${JOBS} && make install) || die "GnuTLS build failed" +# popd +# touch .already-built +# else +# already_built +# fi +# popd > /dev/null # -------------------------------------------------------------- echo -e "Building gloox..." @@ -592,290 +592,290 @@ fi popd > /dev/null -# -------------------------------------------------------------- -echo -e "Building NSPR..." - -LIB_VERSION="${NSPR_VERSION}" -LIB_ARCHIVE="nspr-$LIB_VERSION.tar.gz" -LIB_DIRECTORY="nspr-$LIB_VERSION" -LIB_URL="https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v$LIB_VERSION/src/" - -mkdir -p nspr -pushd nspr > /dev/null - -NSPR_DIR="$(pwd)" - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY/nspr - - (CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" ./configure --prefix="$NSPR_DIR" --enable-64bit && make ${JOBS} && make install) || die "NSPR build failed" - popd - # TODO: how can we not build the dylibs? - rm -f lib/*.dylib - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building ICU..." - -LIB_VERSION="${ICU_VERSION}" -LIB_ARCHIVE="$LIB_VERSION-src.tgz" -LIB_DIRECTORY="icu" -LIB_URL="http://download.icu-project.org/files/icu4c/59.1/" - -mkdir -p icu -pushd icu > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib sbin share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - mkdir -p source/build - pushd source/build - -(CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" ../runConfigureICU MacOSX --prefix=$INSTALL_DIR --disable-shared --enable-static --disable-samples --enable-extras --enable-icuio --enable-tools && make ${JOBS} && make install) || die "ICU build failed" - popd - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building ENet..." - -LIB_VERSION="${ENET_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.gz" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="http://enet.bespin.org/download/" - -mkdir -p enet -pushd enet > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib sbin share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=${INSTALL_DIR} --enable-shared=no && make clean && make ${JOBS} && make install) || die "ENet build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building MiniUPnPc..." - -LIB_VERSION="${MINIUPNPC_VERSION}" -LIB_ARCHIVE="$LIB_VERSION.tar.gz" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="http://miniupnp.tuxfamily.org/files/download.php?file=" - -mkdir -p miniupnpc -pushd miniupnpc > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY bin include lib share - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - (make clean && CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS make ${JOBS} && INSTALLPREFIX="$INSTALL_DIR" make install) || die "MiniUPnPc build failed" - popd - # TODO: how can we not build the dylibs? - rm -f lib/*.dylib - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -echo -e "Building libsodium..." - -LIB_VERSION="${SODIUM_VERSION}" -LIB_ARCHIVE="$SODIUM_VERSION.tar.gz" -LIB_DIRECTORY="$LIB_VERSION" -LIB_URL="https://download.libsodium.org/libsodium/releases/" - -mkdir -p libsodium -pushd libsodium > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] -then - INSTALL_DIR="$(pwd)" - - rm -f .already-built - download_lib $LIB_URL $LIB_ARCHIVE - - rm -rf $LIB_DIRECTORY include lib - tar -xf $LIB_ARCHIVE - pushd $LIB_DIRECTORY - - (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=${INSTALL_DIR} --enable-shared=no && make clean && CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS make ${JOBS} && make check && INSTALLPREFIX="$INSTALL_DIR" make install) || die "libsodium build failed" - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------------- -# The following libraries are shared on different OSes and may -# be customized, so we build and install them from bundled sources -# -------------------------------------------------------------------- -echo -e "Building Spidermonkey..." -LIB_VERSION="mozjs-38.2.1" -LIB_ARCHIVE="$LIB_VERSION.rc0.tar.bz2" -LIB_DIRECTORY="mozjs-38.0.0" - -pushd ../source/spidermonkey/ > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] || [[ .already-built -ot README.txt ]] -then - INSTALL_DIR="$(pwd)" - INCLUDE_DIR_DEBUG=$INSTALL_DIR/include-unix-debug - INCLUDE_DIR_RELEASE=$INSTALL_DIR/include-unix-release - - rm -f .already-built - rm -f lib/*.a - rm -rf $LIB_DIRECTORY $INCLUDE_DIR_DEBUG $INCLUDE_DIR_RELEASE - tar -xf $LIB_ARCHIVE - - # Apply patches - pushd $LIB_DIRECTORY - . ../patch.sh - popd - - pushd $LIB_DIRECTORY/js/src - # We want separate debug/release versions of the library, so change their install name in the Makefile - perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1'\''mozjs38-ps-debug'\''/' moz.build - - CONF_OPTS="--target=$ARCH-apple-darwin --prefix=${INSTALL_DIR} --with-system-nspr --with-nspr-prefix=${NSPR_DIR} --with-system-zlib=${ZLIB_DIR} --disable-tests --disable-shared-js" - # Change the default location where the tracelogger should store its output, which is /tmp/ on OSX. - TLCXXFLAGS='-DTRACE_LOG_DIR="\"../../source/tools/tracelogger/\""' - # Uncomment this line for 32-bit 10.5 cross compile: - #CONF_OPTS="$CONF_OPTS --target=i386-apple-darwin9.0.0" - if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then - CONF_OPTS="$CONF_OPTS --enable-macos-target=$MIN_OSX_VERSION" - fi - if [[ $SYSROOT && ${SYSROOT-_} ]]; then - CONF_OPTS="$CONF_OPTS --with-macosx-sdk=$SYSROOT" - fi - - mkdir -p build-debug - pushd build-debug - (CC="clang" CXX="clang++" CXXFLAGS="${TLCXXFLAGS}" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS --enable-debug --disable-optimize --enable-js-diagnostics --enable-gczeal && make ${JOBS}) || die "Spidermonkey build failed" - # js-config.h is different for debug and release builds, so we need different include directories for both - mkdir -p $INCLUDE_DIR_DEBUG - cp -R -L dist/include/* $INCLUDE_DIR_DEBUG/ - cp dist/lib/*.a $INSTALL_DIR/lib - popd - mv moz.build.bak moz.build - - perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1'\''mozjs38-ps-release'\''/' moz.build - mkdir -p build-release - pushd build-release - (CC="clang" CXX="clang++" CXXFLAGS="${TLCXXFLAGS}" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS --enable-optimize && make ${JOBS}) || die "Spidermonkey build failed" - # js-config.h is different for debug and release builds, so we need different include directories for both - mkdir -p $INCLUDE_DIR_RELEASE - cp -R -L dist/include/* $INCLUDE_DIR_RELEASE/ - cp dist/lib/*.a $INSTALL_DIR/lib - popd - mv moz.build.bak moz.build - - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -# NVTT - no install -echo -e "Building NVTT..." - -pushd ../source/nvtt > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] -then - rm -f .already-built - rm -f lib/*.a - pushd src - rm -rf build - mkdir -p build - - pushd build - - # Could use CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT - # but they're not as flexible for cross-compiling - # Disable optional libs that we don't need (avoids some conflicts with MacPorts) - (cmake .. -DCMAKE_LINK_FLAGS="$LDFLAGS" -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DCMAKE_BUILD_TYPE=Release -DBINDIR=bin -DLIBDIR=lib -DGLUT=0 -DGLEW=0 -DCG=0 -DCUDA=0 -DOPENEXR=0 -DJPEG=0 -DPNG=0 -DTIFF=0 -G "Unix Makefiles" && make clean && make nvtt ${JOBS}) || die "NVTT build failed" - popd - - mkdir -p ../lib - cp build/src/nv*/libnv*.a ../lib/ - cp build/src/nvtt/squish/libsquish.a ../lib/ - popd - touch .already-built -else - already_built -fi -popd > /dev/null - -# -------------------------------------------------------------- -# FCollada - no install -echo -e "Building FCollada..." - -pushd ../source/fcollada > /dev/null - -if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] -then - rm -f .already-built - rm -f lib/*.a - pushd src - rm -rf output - mkdir -p ../lib - - # The Makefile refers to pkg-config for libxml2, but we - # don't have that (replace with xml2-config instead) - sed -i.bak -e 's/pkg-config libxml-2.0/xml2-config/' Makefile - (make clean && CXXFLAGS=$CXXFLAGS make ${JOBS}) || die "FCollada build failed" - # Undo Makefile change - mv Makefile.bak Makefile - popd - touch .already-built -else - already_built -fi -popd > /dev/null +# # -------------------------------------------------------------- +# echo -e "Building NSPR..." +# +# LIB_VERSION="${NSPR_VERSION}" +# LIB_ARCHIVE="nspr-$LIB_VERSION.tar.gz" +# LIB_DIRECTORY="nspr-$LIB_VERSION" +# LIB_URL="https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v$LIB_VERSION/src/" +# +# mkdir -p nspr +# pushd nspr > /dev/null +# +# NSPR_DIR="$(pwd)" +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY bin include lib share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY/nspr +# + # (CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" ./configure --prefix="$NSPR_DIR" --enable-64bit && make ${JOBS} && make install) || die "NSPR build failed" + # popd + # # TODO: how can we not build the dylibs? + # rm -f lib/*.dylib + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# echo -e "Building ICU..." +# +# LIB_VERSION="${ICU_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION-src.tgz" +# LIB_DIRECTORY="icu" +# LIB_URL="http://download.icu-project.org/files/icu4c/59.1/" +# +# mkdir -p icu +# pushd icu > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY bin include lib sbin share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # mkdir -p source/build + # pushd source/build +# +# (CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" ../runConfigureICU MacOSX --prefix=$INSTALL_DIR --disable-shared --enable-static --disable-samples --enable-extras --enable-icuio --enable-tools && make ${JOBS} && make install) || die "ICU build failed" + # popd + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# echo -e "Building ENet..." +# +# LIB_VERSION="${ENET_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.gz" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="http://enet.bespin.org/download/" +# +# mkdir -p enet +# pushd enet > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY bin include lib sbin share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=${INSTALL_DIR} --enable-shared=no && make clean && make ${JOBS} && make install) || die "ENet build failed" + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# echo -e "Building MiniUPnPc..." +# +# LIB_VERSION="${MINIUPNPC_VERSION}" +# LIB_ARCHIVE="$LIB_VERSION.tar.gz" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="http://miniupnp.tuxfamily.org/files/download.php?file=" +# +# mkdir -p miniupnpc +# pushd miniupnpc > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY bin include lib share + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # (make clean && CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS make ${JOBS} && INSTALLPREFIX="$INSTALL_DIR" make install) || die "MiniUPnPc build failed" + # popd + # # TODO: how can we not build the dylibs? + # rm -f lib/*.dylib + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# echo -e "Building libsodium..." +# +# LIB_VERSION="${SODIUM_VERSION}" +# LIB_ARCHIVE="$SODIUM_VERSION.tar.gz" +# LIB_DIRECTORY="$LIB_VERSION" +# LIB_URL="https://download.libsodium.org/libsodium/releases/" +# +# mkdir -p libsodium +# pushd libsodium > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] +# then + # INSTALL_DIR="$(pwd)" +# + # rm -f .already-built + # download_lib $LIB_URL $LIB_ARCHIVE +# + # rm -rf $LIB_DIRECTORY include lib + # tar -xf $LIB_ARCHIVE + # pushd $LIB_DIRECTORY +# + # (./configure CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" --prefix=${INSTALL_DIR} --enable-shared=no && make clean && CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS make ${JOBS} && make check && INSTALLPREFIX="$INSTALL_DIR" make install) || die "libsodium build failed" + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------------- +# # The following libraries are shared on different OSes and may +# # be customized, so we build and install them from bundled sources +# # -------------------------------------------------------------------- +# echo -e "Building Spidermonkey..." +# LIB_VERSION="mozjs-38.2.1" +# LIB_ARCHIVE="$LIB_VERSION.rc0.tar.bz2" +# LIB_DIRECTORY="mozjs-38.0.0" +# +# pushd ../source/spidermonkey/ > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] || [[ .already-built -ot $LIB_DIRECTORY ]] || [[ .already-built -ot README.txt ]] +# then + # INSTALL_DIR="$(pwd)" + # INCLUDE_DIR_DEBUG=$INSTALL_DIR/include-unix-debug + # INCLUDE_DIR_RELEASE=$INSTALL_DIR/include-unix-release +# + # rm -f .already-built + # rm -f lib/*.a + # rm -rf $LIB_DIRECTORY $INCLUDE_DIR_DEBUG $INCLUDE_DIR_RELEASE + # tar -xf $LIB_ARCHIVE +# + # # Apply patches + # pushd $LIB_DIRECTORY + # . ../patch.sh + # popd +# + # pushd $LIB_DIRECTORY/js/src + # # We want separate debug/release versions of the library, so change their install name in the Makefile + # perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1'\''mozjs38-ps-debug'\''/' moz.build +# + # CONF_OPTS="--target=$ARCH-apple-darwin --prefix=${INSTALL_DIR} --with-system-nspr --with-nspr-prefix=${NSPR_DIR} --with-system-zlib=${ZLIB_DIR} --disable-tests --disable-shared-js" + # # Change the default location where the tracelogger should store its output, which is /tmp/ on OSX. + # TLCXXFLAGS='-DTRACE_LOG_DIR="\"../../source/tools/tracelogger/\""' + # # Uncomment this line for 32-bit 10.5 cross compile: + # #CONF_OPTS="$CONF_OPTS --target=i386-apple-darwin9.0.0" + # if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then + # CONF_OPTS="$CONF_OPTS --enable-macos-target=$MIN_OSX_VERSION" + # fi + # if [[ $SYSROOT && ${SYSROOT-_} ]]; then + # CONF_OPTS="$CONF_OPTS --with-macosx-sdk=$SYSROOT" + # fi +# + # mkdir -p build-debug + # pushd build-debug + # (CC="clang" CXX="clang++" CXXFLAGS="${TLCXXFLAGS}" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS --enable-debug --disable-optimize --enable-js-diagnostics --enable-gczeal && make ${JOBS}) || die "Spidermonkey build failed" + # # js-config.h is different for debug and release builds, so we need different include directories for both + # mkdir -p $INCLUDE_DIR_DEBUG + # cp -R -L dist/include/* $INCLUDE_DIR_DEBUG/ + # cp dist/lib/*.a $INSTALL_DIR/lib + # popd + # mv moz.build.bak moz.build +# + # perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1'\''mozjs38-ps-release'\''/' moz.build + # mkdir -p build-release + # pushd build-release + # (CC="clang" CXX="clang++" CXXFLAGS="${TLCXXFLAGS}" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS --enable-optimize && make ${JOBS}) || die "Spidermonkey build failed" + # # js-config.h is different for debug and release builds, so we need different include directories for both + # mkdir -p $INCLUDE_DIR_RELEASE + # cp -R -L dist/include/* $INCLUDE_DIR_RELEASE/ + # cp dist/lib/*.a $INSTALL_DIR/lib + # popd + # mv moz.build.bak moz.build +# + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# # NVTT - no install +# echo -e "Building NVTT..." +# +# pushd ../source/nvtt > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] +# then + # rm -f .already-built + # rm -f lib/*.a + # pushd src + # rm -rf build + # mkdir -p build +# + # pushd build +# + # # Could use CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT + # # but they're not as flexible for cross-compiling + # # Disable optional libs that we don't need (avoids some conflicts with MacPorts) + # (cmake .. -DCMAKE_LINK_FLAGS="$LDFLAGS" -DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CXXFLAGS" -DCMAKE_BUILD_TYPE=Release -DBINDIR=bin -DLIBDIR=lib -DGLUT=0 -DGLEW=0 -DCG=0 -DCUDA=0 -DOPENEXR=0 -DJPEG=0 -DPNG=0 -DTIFF=0 -G "Unix Makefiles" && make clean && make nvtt ${JOBS}) || die "NVTT build failed" + # popd +# + # mkdir -p ../lib + # cp build/src/nv*/libnv*.a ../lib/ + # cp build/src/nvtt/squish/libsquish.a ../lib/ + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null +# +# # -------------------------------------------------------------- +# # FCollada - no install +# echo -e "Building FCollada..." +# +# pushd ../source/fcollada > /dev/null +# +# if [[ "$force_rebuild" = "true" ]] || [[ ! -e .already-built ]] +# then + # rm -f .already-built + # rm -f lib/*.a + # pushd src + # rm -rf output + # mkdir -p ../lib +# + # # The Makefile refers to pkg-config for libxml2, but we + # # don't have that (replace with xml2-config instead) + # sed -i.bak -e 's/pkg-config libxml-2.0/xml2-config/' Makefile + # (make clean && CXXFLAGS=$CXXFLAGS make ${JOBS}) || die "FCollada build failed" + # # Undo Makefile change + # mv Makefile.bak Makefile + # popd + # touch .already-built +# else + # already_built +# fi +# popd > /dev/null Index: libraries/osx/symlink-libs.py =================================================================== --- /dev/null +++ libraries/osx/symlink-libs.py @@ -0,0 +1,100 @@ +#!/usr/local/bin/python3 +# +# Script for symlinking OS X dependencies for 0 A.D. using brew +# Since OSX always prefer dynamic libraries, this specifically symlinks static versions +# +# DOC to write. +# +# -------------------------------------------------------------- +# 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" +BOOST_VERSION="boost_1_64_0" +# NOTE: remember to also update LIB_URL below when changing version +WXWIDGETS_VERSION="wxWidgets-3.0.4.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" +# gloox is necessary for multiplayer lobby +GLOOX_VERSION="gloox-1.0.20" +# gloox requires GnuTLS, GnuTLS requires Nettle and GMP +GMP_VERSION="gmp-6.1.2" +NETTLE_VERSION="nettle-3.4" +GNUTLS_VERSION="gnutls-3.5.19" +GLOOX_VERSION="gloox-1.0.20" +# NSPR is necessary for threadsafe Spidermonkey +NSPR_VERSION="4.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_1" +ENET_VERSION="enet-1.3.13" +MINIUPNPC_VERSION="miniupnpc-2.0.20180222" +SODIUM_VERSION="libsodium-1.0.16" +# -------------------------------------------------------------- +# Bundled with the game: +# * SpiderMonkey 38 +# * NVTT +# * FCollada +# -------------------------------------------------------------- +# Provided by OS X: +# * OpenAL +# * OpenGL +# -------------------------------------------------------------- + +libs_to_fetch = { + 'boost':'boost' + ,'enet':'enet' + ,'nettle':'nettle' + ,'gmp':'gmp' + ,'gnutls':'gnutls' + ,'libiconv':'iconv' + ,'icu4c':'icu' + ,'libogg':'libogg' + ,'libpng':'libpng' + ,'libsodium':'libsodium' + ,'libxml2':'libxml2' + ,'openssl':'ssl' + ,'miniupnpc':'miniupnpc' + ,'nspr':'nspr' + ,'sdl2':'sdl2' + ,'libvorbis':'vorbis' + ,'zlib':'zlib' +} + +import os +import glob +from distutils.version import LooseVersion +from pathlib import Path + +BREW_DIR = '/usr/local/Cellar/' +LIBS_PATH = os.path.dirname(os.path.realpath(__file__)) + '/' + +def safe_unlink(p): + if Path(p).is_symlink(): + os.unlink(p) + +def safe_symlink(src, dest): + safe_unlink(dest) + if os.path.exists(src): + os.symlink(src, dest) + +for (brew_lib_name, zeroad_lib_name) in libs_to_fetch.items(): + versions = os.listdir(BREW_DIR + brew_lib_name) + versions.sort(key=LooseVersion) + brew_path = BREW_DIR + brew_lib_name + '/' + versions[-1] + + print(LIBS_PATH + zeroad_lib_name) + out_path = LIBS_PATH + zeroad_lib_name + os.makedirs(out_path, exist_ok = True) + + safe_symlink(brew_path + '/include', out_path + '/include') + safe_symlink(brew_path + '/bin', out_path + '/bin') + + os.makedirs(out_path + '/lib', exist_ok = True) + for lib in glob.glob(brew_path + '/lib/**.a'): + safe_symlink(lib, out_path + '/lib/' + lib.split('/')[-1])