brew

https://github.com/homebrew/brew

Ruby

🍺 The missing package manager for macOS

Formula#system

To call out to the system, we use the `system` method and we prefer
you give the args separately as in the line below, otherwise a subshell
has to be opened first.
<pre>system "./bootstrap.sh", "--arg1", "--prefix=#{prefix}"</pre>

For CMake we have some necessary defaults in {#std_cmake_args}:
<pre>system "cmake", ".", *std_cmake_args</pre>

If the arguments given to configure (or make or cmake) are depending
on options defined above, we usually make a list first and then
use the `args << if <condition>` to append to:
<pre>args = ["--with-option1", "--with-option2"]

# Most software still uses `configure` and `make`.
# Check with `./configure --help` what our options are.
system "./configure", "--disable-debug", "--disable-dependency-tracking",
                      "--disable-silent-rules", "--prefix=#{prefix}",
                      *args # our custom arg list (needs `*` to unpack)

# If there is a "make", "install" available, please use it!
system "make", "install"</pre>

Source | Google | Stack overflow

Edit

git clone [email protected]:homebrew/brew.git

cd brew

open Library/Homebrew/formula.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Formula-system-for-pr


# Commit to git

git add Library/Homebrew/formula.rbgit commit -m "better docs for Formula#system"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Formula-system-for-pr

hub pull-request


# Celebrate!