Skip to content

Commit

Permalink
fix: Missing Python header (#6)
Browse files Browse the repository at this point in the history
* fix: missing python header

* Remove S from DIRS

---------

Co-authored-by: Vicente Eduardo Ferrer Garcia <[email protected]>
  • Loading branch information
FirePing32 and viferga authored Jan 30, 2024
1 parent ff76d3e commit c4fe940
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions metacall.rb
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
class Metacall < Formula
desc "Ultimate polyglot programming experience"
homepage "https://metacall.io"
url "https://github.com/metacall/core/archive/refs/tags/v0.5.27.tar.gz"
sha256 "1493afadac893b7b3674ea44dd7caa7fd74989880658ae23003b30d3721bb92d"
url "https://github.com/metacall/core/archive/refs/tags/v0.7.5.tar.gz"
sha256 "2780ee0aade125866d7cb9f48d39a34a891e0dba30c31a8efbbc0da55968a313"
license "Apache-2.0"
head "https://github.com/metacall/core.git", branch: "develop"

depends_on "cmake" => :build
depends_on "node@14"
depends_on "openjdk"
depends_on "python@3.9"
depends_on "python@3.12"
uses_from_macos "ruby"

def python
deps.map(&:to_formula)
.find { |f| f.name.match?(/^python@\d\.\d+$/) }
end

# Get Python location
def python_executable
python.opt_libexec/"bin/python"
end

def install
Dir.mkdir("build")
Dir.chdir("build")
py3ver = Language::Python.major_minor_version python_executable
py3prefix = if OS.mac?
python.opt_frameworks/"Python.framework/Versions"/py3ver
else
python.opt_prefix
end
py3include = py3prefix/"include/python#{py3ver}"
py3rootdir = py3prefix
py3lib = py3prefix/"lib/libpython#{py3ver}.dylib"
args = std_cmake_args + %W[
-Wno-dev
-DCMAKE_BUILD_TYPE=Release
Expand All @@ -37,6 +56,11 @@ def install
-DOPTION_BUILD_PORTS=ON
-DOPTION_BUILD_PORTS_PY=ON
-DOPTION_BUILD_PORTS_NODE=ON
-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"
Expand Down

0 comments on commit c4fe940

Please sign in to comment.