Skip to content

Commit

Permalink
fix: node loader
Browse files Browse the repository at this point in the history
  • Loading branch information
FirePing32 committed Jun 17, 2024
1 parent 85a768f commit 313a3dc
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions metacall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@ def install
py3include = py3prefix/"include/python#{py3ver}"
py3rootdir = py3prefix
py3lib = py3prefix/"lib/libpython#{py3ver}.dylib"

cc_compiler = `xcrun --find clang`.tr("\n","")
cxx_compiler = `xcrun --find clang++`.tr("\n","")
xcode_prefix = `xcode-select -p`.tr("\n","")
ENV["SDKROOT"] = `xcrun --show-sdk-path`.tr("\n","")
ENV["MACOSX_DEPLOYMENT_TARGET"] = ""

args = std_cmake_args + %W[
-Wno-dev
-DCMAKE_C_COMPILER=#{cc_compiler}
-DCMAKE_CXX_COMPILER=#{cxx_compiler}
-DCMAKE_INCLUDE_PATH=#{xcode_prefix}/usr/include/c++/v1
-DCMAKE_BUILD_TYPE=Release
-DOPTION_BUILD_SECURITY=OFF
-DOPTION_FORK_SAFE=OFF
Expand All @@ -44,33 +54,34 @@ def install
-DOPTION_BUILD_EXAMPLES=OFF
-DOPTION_BUILD_LOADERS_PY=ON
-DOPTION_BUILD_LOADERS_NODE=ON
-DNodeJS_INSTALL_PREFIX=#{prefix}
-DOPTION_BUILD_LOADERS_JAVA=ON
-DNodeJS_INSTALL_PREFIX=/usr/local/Cellar/metacall/#{version}
-DOPTION_BUILD_LOADERS_JAVA=OFF
-DOPTION_BUILD_LOADERS_JS=OFF
-DOPTION_BUILD_LOADERS_C=OFF
-DOPTION_BUILD_LOADERS_COB=OFF
-DOPTION_BUILD_LOADERS_CS=OFF
-DOPTION_BUILD_LOADERS_RB=ON
-DOPTION_BUILD_LOADERS_TS=ON
-DOPTION_BUILD_LOADERS_FILE=ON
-DOPTION_BUILD_LOADERS_RB=OFF
-DOPTION_BUILD_LOADERS_TS=OFF
-DOPTION_BUILD_LOADERS_FILE=OFF
-DOPTION_BUILD_PORTS=ON
-DOPTION_BUILD_PORTS_PY=ON
-DOPTION_BUILD_PORTS_NODE=ON
-DOPTION_BUILD_PLUGINS_BACKTRACE=ON
-DOPTION_BUILD_PLUGINS_BACKTRACE=OFF
-DPython3_VERSION=#{py3ver}
-DPython3_ROOT_DIR=#{py3rootdir}
-DPython3_EXECUTABLE=#{python_executable}
-DPython3_LIBRARIES=#{py3lib}
-DPython3_INCLUDE_DIR=#{py3include}
]

system "cmake", *args, ".."
system "cmake", "--build", ".", "--target", "install"

shebang = "\#!/usr/bin/env bash\n"
# debug = "set -euxo pipefail\n"

metacall_extra = [
"PREFIX=#{prefix}\n",
"PREFIX=/usr/local/Cellar/metacall/#{version}\n",
"export LOADER_LIBRARY=\"${PREFIX}/lib\"\n",
"export SERIAL_LIBRARY_PATH=\"${PREFIX}/lib\"\n",
"export DETOUR_LIBRARY_PATH=\"${PREFIX}/lib\"\n",
Expand Down

0 comments on commit 313a3dc

Please sign in to comment.