Skip to content

Commit 51b28fa

Browse files
HeeManSuHeeManSu7
andauthored
Fixing python port issue (#26)
* fixed python port issue * fixed python port issue * reverted unwanted change --------- Co-authored-by: Himanshu Sharma <[email protected]>
1 parent 2464ec3 commit 51b28fa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

metacall.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ def python_executable
4545
end
4646

4747
def install
48+
# Create a directory for the Python module
49+
py_module_dir = prefix/"lib/python"
50+
mkdir_p py_module_dir
51+
ENV["PIP_TARGET"] = py_module_dir.to_s
52+
ENV.delete("PYTHONPATH") # Clear PYTHONPATH to avoid conflicts
53+
4854
# Build path
4955
build_dir = buildpath/"build"
5056
Dir.mkdir(build_dir)
@@ -63,8 +69,7 @@ def install
6369
py3pip = py3prefix/"lib/python#{py3ver}/site-packages"
6470

6571
# Add pip site packages folder to target so the build system can find it
66-
ENV.prepend_path "PIP_TARGET", py3pip
67-
72+
6873
# Set NodeJS
6974
resource("node").stage do
7075
build_dir.install resource("node")
@@ -151,6 +156,7 @@ def install
151156
"else\n",
152157
" PREFIX=\"${PARENT}/Cellar/metacall/#{version}\"\n",
153158
"fi\n",
159+
"export PYTHONPATH=\"${PREFIX}/lib/python:${PYTHONPATH:-}\"\n",
154160
"export NODE_PATH=#{HOMEBREW_PREFIX}/lib/node_modules\n",
155161
"export LOADER_LIBRARY=\"${PREFIX}/lib\"\n",
156162
"export SERIAL_LIBRARY_PATH=\"${PREFIX}/lib\"\n",

0 commit comments

Comments
 (0)