66class Mfc < Formula
77 desc "Exascale multiphase/multiphysics compressible flow solver"
88 homepage "https://mflowcode.github.io/"
9- url "https://github.com/MFlowCode/MFC/archive/refs/tags/v5.1.0 .tar.gz"
10- sha256 "4684bee6a529287f243f8929fb7edb0dfebbb04df7c1806459761c9a6c9261cf "
9+ url "https://github.com/MFlowCode/MFC/archive/refs/tags/v5.1.5 .tar.gz"
10+ sha256 "229ba4532d9b31e54e7db67cc6c6a4c069034bb143be7c57cba31c5a56fe6a0b "
1111 license "MIT"
1212 head "https://github.com/MFlowCode/MFC.git" , branch : "master"
1313
@@ -29,7 +29,11 @@ def install
2929 # Create Python virtual environment inside libexec (inside Cellar for proper bottling)
3030 venv = libexec /"venv"
3131 system Formula [ "python@3.12" ] . opt_bin /"python3.12" , "-m" , "venv" , venv
32- system venv /"bin/pip" , "install" , "--upgrade" , "pip" , "setuptools" , "wheel" , "setuptools-scm"
32+ system venv /"bin/pip" , "install" , "--upgrade" ,
33+ "pip" , "setuptools" , "wheel" ,
34+ "setuptools-scm" ,
35+ "hatchling" , "hatch-vcs" ,
36+ "editables"
3337
3438 # Install Cantera from PyPI using pre-built wheel (complex package, doesn't need custom flags)
3539 # Cantera has CMake compatibility issues when building from source with newer CMake versions
@@ -42,8 +46,9 @@ def install
4246 # Keep toolchain in buildpath for now - mfc.sh needs it there
4347 #
4448 # MFC's toolchain uses VCS-derived versioning (via Hatch/hatch-vcs) and Homebrew builds from
45- # GitHub release tarballs without a .git directory. Scope pretend-version env vars tightly
46- # to avoid polluting subsequent pip installs.
49+ # GitHub release tarballs without a .git directory. Use --no-build-isolation so the build
50+ # backend can see our environment variables, and set SETUPTOOLS_SCM_PRETEND_VERSION which
51+ # hatch-vcs respects when VCS metadata is unavailable.
4752 pretend_env = {
4853 "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MFC" => version . to_s ,
4954 "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_mfc" => version . to_s ,
@@ -56,7 +61,7 @@ def install
5661 end
5762
5863 begin
59- system venv /"bin/pip" , "install" , "-e" , buildpath /"toolchain"
64+ system venv /"bin/pip" , "install" , "--no-build-isolation" , "- e", buildpath /"toolchain"
6065 ensure
6166 pretend_env . each_key do |k |
6267 if saved_env [ k ] . nil?
@@ -75,6 +80,11 @@ def install
7580 # Set VIRTUAL_ENV so mfc.sh uses existing venv instead of creating new one
7681 ENV [ "VIRTUAL_ENV" ] = venv
7782
83+ # Also set pretend-version env vars for mfc.sh in case it tries to reinstall toolchain
84+ ENV [ "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MFC" ] = version . to_s
85+ ENV [ "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_mfc" ] = version . to_s
86+ ENV [ "SETUPTOOLS_SCM_PRETEND_VERSION" ] = version . to_s
87+
7888 # Build MFC using pre-configured venv
7989 # Must run from buildpath (MFC root directory) where toolchain/ exists
8090 Dir . chdir ( buildpath ) do
0 commit comments