Formula-Cookbook: suggested edits from @MikeMcQuaid

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Jacob Ford 2023-02-21 13:32:38 -05:00 committed by GitHub
parent c70ce7a4bf
commit 926cba3e16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,11 +21,11 @@ A *formula* is a package definition written in Ruby. It can be created with `bre
## An introduction
Homebrew uses Git as its source of truth for formulae versions, and for tracking contributions to the project.
Homebrew uses Git for storing formulae and contributing to the project.
Forumulae were traditionally pulled directly to users using Git, but starting with [Homebrew 4.0.0](https://brew.sh/2023/02/16/homebrew-4.0.0/), formulae are downloaded using from `https://formulae.brew.sh/api/formula.json`, which is [automatically generated](https://github.com/Homebrew/brew/blob/cacd7194f6c4818644629842415f9d752d63bd3e/Library/Homebrew/formula.rb#L2076-L2265) from the `master` branch of the `homebrew-core` Git repository.
As-of [Homebrew 4.0.0](https://brew.sh/2023/02/16/homebrew-4.0.0/), formulae are downloaded from `https://formulae.brew.sh/api/formula.json`, which is automatically regenerated by a scheduled formulae.brew.sh job from the `master` branch of the homebrew-core repository.
Homebrew installs formulae to the `Cellar` and then symlinks some of the installation into `/usr/local` so that other programs can see what's going on. We suggest running `brew ls` on a few of the kegs in your Cellar to see how it is all arranged.
Homebrew installs formulae to the `Cellar` and then symlinks some of the installation into `$(brew --prefix)` e.g. `/opt/homebrew` so that other programs can see what's going on. We suggest running `brew ls` on a few of the kegs in your Cellar to see how it is all arranged.
Packages are installed according to their formulae. Read over a simple one, e.g. `brew edit etl` (or [etl.rb](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/etl.rb)) or a more advanced one, e.g. `brew edit git` (or [git.rb](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/git.rb)).
@ -33,7 +33,7 @@ Packages are installed according to their formulae. Read over a simple one, e.g.
Make sure you run `brew update` before you start. This ensures your Homebrew installation is a Git repository.
To create or edit formulae locally, you'll need to `brew tap homebrew/core` if you haven't previously. This clones the `homebrew-core` Git repository where Homebrew expects it to be, which is `$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula`. As you are developing, you'll also need to set `HOMEBREW_NO_INSTALL_FROM_API=1` before any `install` commands, to force `brew` to use the local repository instead of the API.
To create or edit formulae locally, you'll need to `brew tap homebrew/core` if you haven't previously. This taps homebrew-core, creating a Git repository in `$(brew --repository homebrew/core)`. As you are developing, you'll also need to set `HOMEBREW_NO_INSTALL_FROM_API=1` before any `install`, `reinstall` or `upgrade` commands, to force `brew` to use the local repository instead of the API.
Before submitting a new formula make sure your package: