Skip to content

Commit

Permalink
fix: node loader (#18)
Browse files Browse the repository at this point in the history
* fix: node loader

* Update metacall.rb

---------

Co-authored-by: Vicente Eduardo Ferrer Garcia <[email protected]>
  • Loading branch information
FirePing32 and viferga authored Jun 17, 2024
1 parent 85a768f commit 9bae120
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions metacall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Metacall < Formula
depends_on "cmake" => :build
depends_on "node@20"
depends_on "[email protected]"
depends_on "ruby@2.7"
depends_on "ruby@3.3"
depends_on "openjdk"

def python
Expand All @@ -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 9bae120

Please sign in to comment.