Skip to content

Commit afd2d69

Browse files
mfc: v5.1.0
1 parent a7c20ec commit afd2d69

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Formula/mfc.rb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,28 @@ class Mfc < Formula
2121
depends_on "openblas"
2222
depends_on "python@3.12"
2323

24-
# Disable bottles due to Python venv with compiled extensions that can't be relocated
25-
def pour_bottle?
26-
false
27-
end
28-
2924
def install
3025
# Create Python virtual environment inside libexec (inside Cellar for proper bottling)
3126
venv = libexec/"venv"
3227
system Formula["python@3.12"].opt_bin/"python3.12", "-m", "venv", venv
3328
system venv/"bin/pip", "install", "--upgrade", "pip", "setuptools", "wheel"
3429

30+
# Set LDFLAGS to ensure Python C extensions (like orjson) are compiled with enough
31+
# header padding for Homebrew's bottle relocation process
32+
# This fixes "Failed changing dylib ID" errors during bottling
33+
ENV.append "LDFLAGS", "-Wl,-headerpad_max_install_names"
34+
35+
# Force pip to compile from source (not use pre-built wheels) to ensure
36+
# our LDFLAGS are applied. Pre-built wheels don't have proper header padding.
37+
pip_install_args = ["--no-binary", ":all:"]
38+
3539
# Install Cantera from PyPI (required dependency for MFC build)
36-
system venv/"bin/pip", "install", "cantera==3.1.0"
40+
system venv/"bin/pip", "install", *pip_install_args, "cantera==3.1.0"
3741

3842
# Install MFC Python package and dependencies into venv
3943
# Keep toolchain in buildpath for now - mfc.sh needs it there
4044
# Use editable install (-e) to avoid RECORD file issues when venv is symlinked at runtime
41-
system venv/"bin/pip", "install", "-e", buildpath/"toolchain"
45+
system venv/"bin/pip", "install", *pip_install_args, "-e", buildpath/"toolchain"
4246

4347
# Create symlink so mfc.sh uses our pre-installed venv
4448
mkdir_p "build"
@@ -77,7 +81,7 @@ def install
7781
# 3. Minimal copying - only what needs to be writable
7882
# 4. Resolves input file paths before changing directories
7983
(bin/"mfc").write <<~EOS
80-
#!/bin/bash
84+
#!/usr/bin/env bash
8185
set -euo pipefail
8286
8387
# Unset VIRTUAL_ENV to ensure mfc.sh uses our configured venv

0 commit comments

Comments
 (0)