cartesi / machine-emulator

The off-chain implementation of the Cartesi Machine
GNU Lesser General Public License v3.0
58 stars 32 forks source link

fix: update makefile to make it compatible with a homebrew formulae #239

Closed alexmikhalevich closed 6 days ago

alexmikhalevich commented 1 month ago

This fix makes our Makefile compatible with Homebrew formulae. Below is an explanation of the patch:

  1. During the processing of a formula by Homebrew, $(brew --prefix)/bin is not included in the PATH, resulting in an empty result for which brew. To address this issue, I propose allowing manual setting of BREW_PREFIX. This manual approach will be utilized in the formula: system "make", "BREW_PREFIX=#{prefix}". The flow of PORT_PREFIX was changed for consistency.
  2. During the execution of make install, a couple of targets from src/Makefile are used for version generation. When make install is invoked from the context of Homebrew formula installation, BREW_PREFIX is empty, causing the installation process to abort with the message Neither Homebrew nor MacPorts is installed. I propose changing error to warning here. This will prevent the process from aborting, making the user responsible for not specifying a prefix. Considering that this aspect is intended for developers only, I believe this approach is adequate.