--- configure 2024-02-15 19:17:46.000000000 +0800 +++ configure 2024-02-18 09:41:40.000000000 +0800 @@ -6,10 +6,10 @@ PKG_DEB_NAME="libv8-dev or libnode-dev" PKG_RPM_NAME="v8-devel" PKG_CSW_NAME="libv8_dev" -PKG_BREW_NAME="v8" +PKG_MP_NAME="@V8@" PKG_TEST_HEADER="" -PKG_LIBS="-lv8 -lv8_libplatform" -PKG_CFLAGS="-I/usr/include/v8" +PKG_LIBS="@V8_LIBS@" +PKG_CFLAGS="-I@V8_HOME@/include" # Allow users to override PKG_LIBS and PKG_CFLAGS if [ "$V8_PKG_LIBS" ]; then @@ -19,7 +19,6 @@ fi UNAME=`uname` -UARCH=`uname -m` # Test common production platforms if test -f "/etc/redhat-release" && ! grep -Fq Fedora "/etc/redhat-release"; then @@ -32,15 +31,6 @@ IS_MACOS=1 fi -# Default to static V8 on supported production platforms -if [ -z "$DISABLE_STATIC_LIBV8" ]; then -if [ "$IS_MACOS" ] || [ "$IS_UBUNTU" ] || [ "$IS_RHEL" ] || [ "$CI" ] || [ -f "/usr/lib/libv8.so.3.14.5" ] || [ -f "/usr/include/v8-3.14/v8.h" ]; then -if [ "$UARCH" = "x86_64" ] || [ "$UARCH" = "arm64" ] || [ "$UARCH" = "aarch64" ]; then -DOWNLOAD_STATIC_LIBV8=1 -fi -fi -fi - # Use CXX17 when available, required as of libv8 version 10.2 CXX17=`${R_HOME}/bin/R CMD config CXX17` || unset CXX17 @@ -75,17 +65,10 @@ PKG_CFLAGS="-I$INCLUDE_DIR $PKG_CFLAGS" PKG_LIBS="-L$LIB_DIR $PKG_LIBS" elif [ "$IS_MACOS" ]; then - if [ `command -v brew` ] && [ -z "$DOWNLOAD_STATIC_LIBV8" ]; then - BREWDIR=`brew --prefix` - V8HOME="$BREWDIR/opt/$PKG_BREW_NAME" - PKG_CFLAGS="-I${V8HOME}/include -I${V8HOME}/libexec/include" - PKG_LIBS="-L${V8HOME}/libexec $PKG_LIBS" - else - curl -sfL "https://autobrew.github.io/scripts/$PKG_BREW_NAME" > autobrew - . ./autobrew - fi -elif [ "$DOWNLOAD_STATIC_LIBV8" ]; then - ${R_HOME}/bin/R -s -e 'curl::curl_download("http://jeroen.github.io/V8/get-v8-linux.sh","get-v8-linux.sh")' && . ./get-v8-linux.sh || true + echo "Using Macports installation of V8!" + V8HOME="@V8_HOME@" + PKG_CFLAGS="-I${V8HOME}/include" + PKG_LIBS="-L${V8HOME}/lib $PKG_LIBS" fi # For debugging @@ -100,11 +83,8 @@ echo "Configuration failed to find the libv8 engine library. Try installing:" echo " * deb: $PKG_DEB_NAME (Debian / Ubuntu)" echo " * rpm: $PKG_RPM_NAME (Fedora, EPEL)" - echo " * brew: $PKG_BREW_NAME (OSX)" + echo " * port: $PKG_MP_NAME (macOS)" echo " * csw: $PKG_CSW_NAME (Solaris)" - echo "Alternatively, on Linux (x86_64) or MacOS you can set environment variable:" - echo " DOWNLOAD_STATIC_LIBV8=1" - echo "to automatically download a static version of libv8." echo "To use a custom libv8, set INCLUDE_DIR and LIB_DIR manually via:" echo "R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'" echo "---------------------------[ ERROR MESSAGE ]----------------------------"