Skip to content
Snippets Groups Projects
Commit e72ea948 authored by Xu Cheng's avatar Xu Cheng
Browse files

doc: update for core/formula separation


Closes Homebrew/homebrew#50632.

Signed-off-by: default avatarXu Cheng <xucheng@me.com>
parent fa9a9ff5
No related branches found
No related tags found
No related merge requests found
Showing with 79 additions and 60 deletions
...@@ -560,7 +560,7 @@ can take several different forms: ...@@ -560,7 +560,7 @@ can take several different forms:
* An arbitrary URL: * An arbitrary URL:
Homebrew can install formulae via URL, e.g. Homebrew can install formulae via URL, e.g.
`https://raw.github.com/Homebrew/homebrew/master/Library/Formula/git.rb`. `https://raw.github.com/Homebrew/homebrew-core/master/Formula/git.rb`.
The formula file will be cached for later use. The formula file will be cached for later use.
## ENVIRONMENT ## ENVIRONMENT
...@@ -726,4 +726,8 @@ Former maintainers with significant contributions include Jack Nagel, Adam Vande ...@@ -726,4 +726,8 @@ Former maintainers with significant contributions include Jack Nagel, Adam Vande
## BUGS ## BUGS
See our issues on GitHub: <https://github.com/Homebrew/homebrew/issues> See our issues on GitHub:
* Homebrew <https://github.com/Homebrew/homebrew/issues>
* Homebrew/homebrew-core <https://github.com/Homebrew/homebrew-core/issues>
# Acceptable Formulae # Acceptable Formulae
Some formulae should not go in Some formulae should not go in
[Homebrew/homebrew](https://github.com/Homebrew/homebrew). But there are [homebrew/core](https://github.com/Homebrew/homebrew-core). But there are
additional [Interesting Taps & Branches](Interesting-Taps-&-Branches.md) and anyone can start their additional [Interesting Taps & Branches](Interesting-Taps-&-Branches.md) and anyone can start their
own! own!
...@@ -57,7 +57,7 @@ point it to the downloaded archive in order to avoid loading. ...@@ -57,7 +57,7 @@ point it to the downloaded archive in order to avoid loading.
### We don’t like binary formulae ### We don’t like binary formulae
Our policy is that formulae in the core repository Our policy is that formulae in the core repository
([Homebrew/homebrew](https://github.com/Homebrew/homebrew)) must be built ([homebrew/core](https://github.com/Homebrew/homebrew-core)) must be built
from source (or produce cross-platform binaries like e.g. Java). Binary-only from source (or produce cross-platform binaries like e.g. Java). Binary-only
formulae should go to [homebrew/binary](https://github.com/Homebrew/homebrew-binary) or [homebrew-cask](https://github.com/caskroom/homebrew-cask). formulae should go to [homebrew/binary](https://github.com/Homebrew/homebrew-binary) or [homebrew-cask](https://github.com/caskroom/homebrew-cask).
......
...@@ -3,8 +3,8 @@ If a build has run and passed on `brew test-bot` then it can be used to quickly ...@@ -3,8 +3,8 @@ If a build has run and passed on `brew test-bot` then it can be used to quickly
There are two types of Jenkins jobs you will interact with: There are two types of Jenkins jobs you will interact with:
## [Homebrew Pull Requests](http://bot.brew.sh/job/Homebrew%20Pull%20Requests/) ## [Homebrew Pull Requests](http://bot.brew.sh/job/Homebrew%20Core%20Pull%20Requests/)
This job automatically builds any pull requests submitted to Homebrew/homebrew. On success or failure it updates the pull request status (see more details on the [main Brew Test Bot wiki page](Brew-Test-Bot.md)). On a successful build it automatically uploads bottles. This job automatically builds any pull requests submitted to Homebrew/homebrew-core. On success or failure it updates the pull request status (see more details on the [main Brew Test Bot wiki page](Brew-Test-Bot.md)). On a successful build it automatically uploads bottles.
## [Homebrew Testing](http://bot.brew.sh/job/Homebrew%20Testing/) ## [Homebrew Testing](http://bot.brew.sh/job/Homebrew%20Testing/)
This job is manually triggered to run [`brew test-bot`](https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/cmd/test-bot.rb) with user-specified parameters. On a successful build it automatically uploads bottles. This job is manually triggered to run [`brew test-bot`](https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/cmd/test-bot.rb) with user-specified parameters. On a successful build it automatically uploads bottles.
......
...@@ -120,7 +120,7 @@ Or: ...@@ -120,7 +120,7 @@ Or:
Or: Or:
`brew pull https://github.com/Homebrew/homebrew/pull/1234` `brew pull https://github.com/Homebrew/homebrew-core/pull/1234`
### Why does Homebrew prefer I install to `/usr/local`? ### Why does Homebrew prefer I install to `/usr/local`?
<a name="usrlocal"></a> <a name="usrlocal"></a>
...@@ -176,7 +176,7 @@ If it’s not in `man brew`, it’s probably an external command. These are docu ...@@ -176,7 +176,7 @@ If it’s not in `man brew`, it’s probably an external command. These are docu
If it’s been a while, bump it with a “bump” comment. Sometimes we miss requests and there are plenty of them. Maybe we were thinking on something. It will encourage consideration. In the meantime if you could rebase the pull request so that it can be cherry-picked more easily we will love you for a long time. If it’s been a while, bump it with a “bump” comment. Sometimes we miss requests and there are plenty of them. Maybe we were thinking on something. It will encourage consideration. In the meantime if you could rebase the pull request so that it can be cherry-picked more easily we will love you for a long time.
### Can I edit formulae myself? ### Can I edit formulae myself?
Yes! It’s easy! Just `brew edit $FORMULA`. You don’t have to submit modifications back to*Homebrew/homebrew*, just edit the formula as you personally need it and `brew install`. As a bonus `brew update` will merge your changes with upstream so you can still keep the formula up-to-date **with** your personal modifications! Yes! It’s easy! Just `brew edit $FORMULA`. You don’t have to submit modifications back to*Homebrew/homebrew-core*, just edit the formula as you personally need it and `brew install`. As a bonus `brew update` will merge your changes with upstream so you can still keep the formula up-to-date **with** your personal modifications!
### Can I make new formulae? ### Can I make new formulae?
Yes! It’s easy! Just `brew create URL` Homebrew will then open the Yes! It’s easy! Just `brew create URL` Homebrew will then open the
...@@ -185,7 +185,7 @@ installs; try it: `brew install $FORMULA`. If you come up with any issues, ...@@ -185,7 +185,7 @@ installs; try it: `brew install $FORMULA`. If you come up with any issues,
run the command with the `-d` switch like so: `brew install -d $FORMULA`, run the command with the `-d` switch like so: `brew install -d $FORMULA`,
which drops you into a debugging shell. which drops you into a debugging shell.
If you want your new formula to be part of *Homebrew/homebrew* or want If you want your new formula to be part of *homebrew/core* or want
to learn more about writing formulae, then please read the [Formula Cookbook](Formula-Cookbook.md). to learn more about writing formulae, then please read the [Formula Cookbook](Formula-Cookbook.md).
### Can I install my own stuff to `/usr/local`? ### Can I install my own stuff to `/usr/local`?
......
...@@ -3,14 +3,14 @@ A formula is a package definition written in Ruby. It can be created with `brew ...@@ -3,14 +3,14 @@ A formula is a package definition written in Ruby. It can be created with `brew
## Homebrew Terminology ## Homebrew Terminology
| Term | Description | Example | | Term | Description | Example |
|----------------|------------------------------------------------------------|------------------------------------------------------| |----------------|------------------------------------------------------------|-----------------------------------------------------------------|
| **Formula** | The package definition | `/usr/local/Library/Formula/foo.rb` | | **Formula** | The package definition | `/usr/local/Library/Taps/homebrew/homebrew-core/Formula/foo.rb` |
| **Keg** | The installation prefix of a **Formula** | `/usr/local/Cellar/foo/0.1` | | **Keg** | The installation prefix of a **Formula** | `/usr/local/Cellar/foo/0.1` |
| **opt prefix** | A symlink to the active version of a **Keg** | `/usr/local/opt/foo ` | | **opt prefix** | A symlink to the active version of a **Keg** | `/usr/local/opt/foo ` |
| **Cellar** | All **Kegs** are installed here | `/usr/local/Cellar` | | **Cellar** | All **Kegs** are installed here | `/usr/local/Cellar` |
| **Tap** | An optional Git repository of **Formulae** and/or commands | `/usr/local/Library/Taps/homebrew/homebrew-versions` | | **Tap** | An optional Git repository of **Formulae** and/or commands | `/usr/local/Library/Taps/homebrew/homebrew-versions` |
| **Bottle** | Pre-built **Keg** used instead of building from source | `qt-4.8.4.mavericks.bottle.tar.gz` | | **Bottle** | Pre-built **Keg** used instead of building from source | `qt-4.8.4.mavericks.bottle.tar.gz` |
## An Introduction ## An Introduction
...@@ -18,7 +18,7 @@ Homebrew uses Git for downloading updates and contributing to the project. ...@@ -18,7 +18,7 @@ Homebrew uses Git for downloading updates and contributing to the project.
Homebrew installs to the `Cellar` it then symlinks some of the installation into `/usr/local` so that other programs can see what's going on. We suggest you `brew ls` a few of the kegs in your Cellar to see how it is all arranged. Homebrew installs to the `Cellar` it then symlinks some of the installation into `/usr/local` so that other programs can see what's going on. We suggest you `brew ls` a few of the kegs in your Cellar to see how it is all arranged.
Packages are installed according to their formulae, which live in `/usr/local/Library/Formula`. Check one out a simple one e.g. `brew edit etl` (or [etl](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/etl.rb)) or a more advanced one e.g. `brew edit git` or [Git](https://github.com/Homebrew/homebrew/tree/master/Library/Formula/git.rb). Packages are installed according to their formulae, which live in `/usr/local/Library/Taps/homebrew/homebrew-core/Formula`. Check one out a simple one e.g. `brew edit etl` (or [etl](https://github.com/Homebrew/homebrew-core/blob/master/Formula/etl.rb)) or a more advanced one e.g. `brew edit git` or [Git](https://github.com/Homebrew/homebrew-core/blob/master/Formula/git.rb).
# Basic Instructions # Basic Instructions
...@@ -29,7 +29,7 @@ Before submitting a new formula make sure your package: ...@@ -29,7 +29,7 @@ Before submitting a new formula make sure your package:
* meets all our [Acceptable Formulae](Acceptable-Formulae.md) requirements * meets all our [Acceptable Formulae](Acceptable-Formulae.md) requirements
* isn't already in Homebrew (check `brew search $FORMULA`) * isn't already in Homebrew (check `brew search $FORMULA`)
* isn't in another official [Homebrew tap](https://github.com/Homebrew) * isn't in another official [Homebrew tap](https://github.com/Homebrew)
* isn't already waiting to be merged (check the [issue tracker](https://github.com/Homebrew/homebrew/issues)) * isn't already waiting to be merged (check the [issue tracker](https://github.com/Homebrew/homebrew-core/issues))
* is still supported by upstream (i.e. doesn't require extensive patching) * is still supported by upstream (i.e. doesn't require extensive patching)
* has a stable, tagged version (i.e. not just a GitHub repository with no versions). See [Interesting-Taps-&-Branches](Interesting-Taps-&-Branches.md) for where pre-release versions belong. * has a stable, tagged version (i.e. not just a GitHub repository with no versions). See [Interesting-Taps-&-Branches](Interesting-Taps-&-Branches.md) for where pre-release versions belong.
* passes all `brew audit --strict --online $FORMULA` tests. * passes all `brew audit --strict --online $FORMULA` tests.
...@@ -44,7 +44,7 @@ Run `brew create` with a URL to the source tarball: ...@@ -44,7 +44,7 @@ Run `brew create` with a URL to the source tarball:
brew create https://example.com/foo-0.1.tar.gz brew create https://example.com/foo-0.1.tar.gz
``` ```
This creates `/usr/local/Library/Formula/foo.rb` and opens it in your `$EDITOR`. It'll look something like: This creates `/usr/local/Library/Taps/homebrew/homebrew-core/Formula/foo.rb` and opens it in your `$EDITOR`. It'll look something like:
```ruby ```ruby
class Foo < Formula class Foo < Formula
...@@ -109,7 +109,7 @@ Homebrew’s OpenSSL is ...@@ -109,7 +109,7 @@ Homebrew’s OpenSSL is
to avoid conflicting with the system so sometimes formulae need to to avoid conflicting with the system so sometimes formulae need to
have environment variables set or special configuration flags passed have environment variables set or special configuration flags passed
to locate our OpenSSL. You can see this mechanism in the to locate our OpenSSL. You can see this mechanism in the
[clamav](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/clamav.rb#L28) [clamav](https://github.com/Homebrew/homebrew-core/blob/master/Formula/clamav.rb#L28)
formula. Usually this is unnecessary because when OpenSSL is specified formula. Usually this is unnecessary because when OpenSSL is specified
as a dependency Homebrew temporarily prepends the `$PATH` with that as a dependency Homebrew temporarily prepends the `$PATH` with that
prefix. prefix.
...@@ -168,11 +168,11 @@ A Hash (e.g. `=>`) specifies a formula dependency with some additional informati ...@@ -168,11 +168,11 @@ A Hash (e.g. `=>`) specifies a formula dependency with some additional informati
Sometimes there’s hard conflict between formulae, and it can’t be avoided or circumvented with [`keg_only`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#keg_only-class_method). Sometimes there’s hard conflict between formulae, and it can’t be avoided or circumvented with [`keg_only`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#keg_only-class_method).
`mbedtls` is a good [example](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/mbedtls.rb) formula for minor conflict. `mbedtls` is a good [example](https://github.com/Homebrew/homebrew-core/blob/master/Formula/mbedtls.rb) formula for minor conflict.
`mbedtls` ships and compiles a "Hello World" executable. This is obviously non-essential to `mbedtls`’s functionality, and conflict with the popular GNU `hello` formula would be overkill, so we just remove it. `mbedtls` ships and compiles a "Hello World" executable. This is obviously non-essential to `mbedtls`’s functionality, and conflict with the popular GNU `hello` formula would be overkill, so we just remove it.
[pdftohtml](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/pdftohtml.rb) provides an example of a serious [pdftohtml](https://github.com/Homebrew/homebrew-core/blob/master/Formula/pdftohtml.rb) provides an example of a serious
conflict, where both formula ship an identically-named binary that is essential to functionality, so a [`conflicts_with`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#conflicts_with-class_method) is preferable. conflict, where both formula ship an identically-named binary that is essential to functionality, so a [`conflicts_with`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#conflicts_with-class_method) is preferable.
As a general rule, [`conflicts_with`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#conflicts_with-class_method) should be a last-resort option. It’s a fairly blunt instrument. As a general rule, [`conflicts_with`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#conflicts_with-class_method) should be a last-resort option. It’s a fairly blunt instrument.
...@@ -231,7 +231,7 @@ class Foo < Formula ...@@ -231,7 +231,7 @@ class Foo < Formula
end end
``` ```
[jrnl](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/jrnl.rb) is an example of a formula that does this well. The end result means the user doesn't have use `pip` or Python and can just run `jrnl`. [jrnl](https://github.com/Homebrew/homebrew-core/blob/master/Formula/jrnl.rb) is an example of a formula that does this well. The end result means the user doesn't have use `pip` or Python and can just run `jrnl`.
[homebrew-pypi-poet](https://github.com/tdsmith/homebrew-pypi-poet) can help you generate resource stanzas for the dependencies of your Python application and [gdm](https://github.com/sparrc/gdm#homebrew) can help you generate go\_resource stanzas for the dependencies of your go application. [homebrew-pypi-poet](https://github.com/tdsmith/homebrew-pypi-poet) can help you generate resource stanzas for the dependencies of your Python application and [gdm](https://github.com/sparrc/gdm#homebrew) can help you generate go\_resource stanzas for the dependencies of your go application.
...@@ -261,7 +261,7 @@ the `test do` block. ...@@ -261,7 +261,7 @@ the `test do` block.
We want tests that don't require any user input and test the basic functionality of the application. For example `foo build-foo input.foo` is a good test and (despite their widespread use) `foo --version` and `foo --help` are bad tests. However, a bad test is better than no test at all. We want tests that don't require any user input and test the basic functionality of the application. For example `foo build-foo input.foo` is a good test and (despite their widespread use) `foo --version` and `foo --help` are bad tests. However, a bad test is better than no test at all.
See [cmake](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/cmake.rb) for an example of a formula with a good test. The formula writes a basic `CMakeLists.txt` file into the test directory then calls CMake to generate Makefiles. This test checks that CMake doesn't e.g. segfault during basic operation. Another good example is [tinyxml2](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/tinyxml2.rb), which writes a small C++ source file into the test directory, compiles and links it against the tinyxml2 library and finally checks that the resulting program runs successfully. See [cmake](https://github.com/Homebrew/homebrew-core/blob/master/Formula/cmake.rb) for an example of a formula with a good test. The formula writes a basic `CMakeLists.txt` file into the test directory then calls CMake to generate Makefiles. This test checks that CMake doesn't e.g. segfault during basic operation. Another good example is [tinyxml2](https://github.com/Homebrew/homebrew-core/blob/master/Formula/tinyxml2.rb), which writes a small C++ source file into the test directory, compiles and links it against the tinyxml2 library and finally checks that the resulting program runs successfully.
## Manuals ## Manuals
...@@ -279,7 +279,7 @@ If you’re not sure about the name check the homepage, and check the Wikipedia ...@@ -279,7 +279,7 @@ If you’re not sure about the name check the homepage, and check the Wikipedia
Where Homebrew already has a formula called `foo` we typically do not accept requests to replace that formula with something else also named `foo`. This is to avoid both confusing and surprising users’ expectation. Where Homebrew already has a formula called `foo` we typically do not accept requests to replace that formula with something else also named `foo`. This is to avoid both confusing and surprising users’ expectation.
When two formulae share an upstream name, e.g. [`AESCrypt`](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/aescrypt.rb) and [`AESCrypt`](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/aescrypt-packetizer.rb) the newer formula must typically adapt the name to avoid conflict with the current formula. When two formulae share an upstream name, e.g. [`AESCrypt`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/aescrypt.rb) and [`AESCrypt`](https://github.com/Homebrew/homebrew/blob-core/master/Formula/aescrypt-packetizer.rb) the newer formula must typically adapt the name to avoid conflict with the current formula.
If you’re *still* not sure, just commit. We’ll apply some arbitrary rule and make a decision :wink:. If you’re *still* not sure, just commit. We’ll apply some arbitrary rule and make a decision :wink:.
...@@ -307,11 +307,11 @@ Everything is built on Git, so contribution is easy: ...@@ -307,11 +307,11 @@ Everything is built on Git, so contribution is easy:
```shell ```shell
brew update # required in more ways than you think (initializes the brew git repository if you don't already have it) brew update # required in more ways than you think (initializes the brew git repository if you don't already have it)
cd /usr/local cd $(brew --repo homebrew/core)
# Create a new git branch for your formula so your pull request is easy to # Create a new git branch for your formula so your pull request is easy to
# modify if any changes come up during review. # modify if any changes come up during review.
git checkout -b <some-descriptive-name> git checkout -b <some-descriptive-name>
git add Library/Formula/foo.rb git add Formula/foo.rb
git commit git commit
``` ```
...@@ -481,7 +481,7 @@ Instead of `git diff | pbcopy`, for some editors `git diff >> path/to/your/formu ...@@ -481,7 +481,7 @@ Instead of `git diff | pbcopy`, for some editors `git diff >> path/to/your/formu
# Advanced Formula Tricks # Advanced Formula Tricks
If anything isn’t clear, you can usually figure it out by `grep`ping the `Library/Formula` directory. Please submit a pull request to amend this document if you think it will help! If anything isn’t clear, you can usually figure it out by `grep`ping the `$(brew --repo homebrew/core` directory. Please submit a pull request to amend this document if you think it will help!
## Unstable versions (`devel`, `head`) ## Unstable versions (`devel`, `head`)
...@@ -744,7 +744,7 @@ end ...@@ -744,7 +744,7 @@ end
[`option`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#option-class_method) names should be prefixed with the words `with` or `without`. For example, an option to run a test suite should be named `--with-test` or `--with-check` rather than `--test`, and an option to enable a shared library `--with-shared` rather than `--shared` or `--enable-shared`. [`option`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#option-class_method) names should be prefixed with the words `with` or `without`. For example, an option to run a test suite should be named `--with-test` or `--with-check` rather than `--test`, and an option to enable a shared library `--with-shared` rather than `--shared` or `--enable-shared`.
Note that [`option`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#option-class_method)s that aren’t `build.with? ` or `build.without?` should be deprecated with [`deprecated_option`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#deprecated_option-class_method). See [wget](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/wget.rb#L27-L31) for an example. Note that [`option`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#option-class_method)s that aren’t `build.with? ` or `build.without?` should be deprecated with [`deprecated_option`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#deprecated_option-class_method). See [wget](https://github.com/Homebrew/homebrew-core/blob/master/Formula/wget.rb#L27-L31) for an example.
## File level operations ## File level operations
...@@ -804,7 +804,7 @@ system "make" # separate make and make install steps ...@@ -804,7 +804,7 @@ system "make" # separate make and make install steps
system "make", "install" system "make", "install"
``` ```
If that fixes it, please open an [issue](https://github.com/Homebrew/homebrew/issues) so that we can fix it for everyone. If that fixes it, please open an [issue](https://github.com/Homebrew/homebrew-core/issues) so that we can fix it for everyone.
## Still won’t work? ## Still won’t work?
......
# How To Open a Homebrew Pull Request (and get it merged) # How To Open a Homebrew Pull Request (and get it merged)
The following commands are used by Homebrew's contributors to setup a fork of Homebrew's Git repository on GitHub, create a new branch and create a GitHub pull request of the changes in that branch. The following commands are used by Homebrew's contributors to setup a fork of Homebrew's Git repository on GitHub, create a new branch and create a GitHub pull request of the changes in that branch.
To set up your own fork of the Homebrew repository: Depending on the change you want to make, you need to send the pull request to the corresponding repository. If you want to submit a change in Homebrew core code, you should open the pull request at [Homebrew/homebrew](https://github.com/Homebrew/homebrew). If you want to apply any change on formula, you could open the pull request at [Homebrew core tap](https://github.com/Homebrew/homebrew-core) or any other [official taps](https://github.com/Homebrew) based on the nature of related formuale.
## Set up your own fork of the Homebrew repository
### Core code related pull request
1. Change to the directory containing your Homebrew installation with `cd $(brew --repository)` 1. Change to the directory containing your Homebrew installation with `cd $(brew --repository)`
2. [Fork the Homebrew repository](https://github.com/Homebrew/homebrew/fork) on GitHub. This creates a pushable, personal remote repository. This is needed as only Homebrew maintainers have push access to the main repository. 2. [Fork the Homebrew/homebrew repository](https://github.com/Homebrew/homebrew/fork) on GitHub. This creates a pushable, personal remote repository. This is needed as only Homebrew maintainers have push access to the main repository.
3. Add the pushable forked repository with `git remote add YOUR_USERNAME https://github.com/YOUR_USERNAME/homebrew.git` 3. Add the pushable forked repository with `git remote add YOUR_USERNAME https://github.com/YOUR_USERNAME/homebrew.git`
### Formulae related pull request
1. Change to the directory containing Homebrew formulae with `cd $(brew --repository homebrew/core)`
2. [Fork the Homebrew/homebrew-core repository](https://github.com/Homebrew/homebrew-core/fork) on GitHub. This creates a pushable, personal remote repository. This is needed as only Homebrew maintainers have push access to the main repository.
3. Add the pushable forked repository with `git remote add YOUR_USERNAME https://github.com/YOUR_USERNAME/homebrew-core.git`
To make a new branch and submit it for review: To make a new branch and submit it for review:
1. Checkout the `master` branch with `git checkout master` 1. Checkout the `master` branch with `git checkout master`
...@@ -15,7 +25,7 @@ To make a new branch and submit it for review: ...@@ -15,7 +25,7 @@ To make a new branch and submit it for review:
4. Make your changes to any Homebrew formula with `brew edit` (following all the requirements in the [Formula Cookbook](Formula-Cookbook.md)). Run `brew audit ANY_CHANGED_FORMULA`, `brew tests` and `brew install ANY_CHANGED_FORMULA && brew test ANY_CHANGED_FORMULA` and ensure all of these pass without issue. If there's a `bottle do` block in the formula: don't remove it; we'll update it when we pull it. 4. Make your changes to any Homebrew formula with `brew edit` (following all the requirements in the [Formula Cookbook](Formula-Cookbook.md)). Run `brew audit ANY_CHANGED_FORMULA`, `brew tests` and `brew install ANY_CHANGED_FORMULA && brew test ANY_CHANGED_FORMULA` and ensure all of these pass without issue. If there's a `bottle do` block in the formula: don't remove it; we'll update it when we pull it.
5. Make a separate commit for each changed formula with `git add` and `git commit`. 5. Make a separate commit for each changed formula with `git add` and `git commit`.
6. Upload your new commits to the branch to your fork with `git push --set-upstream YOUR_USERNAME YOUR_BRANCH_NAME` 6. Upload your new commits to the branch to your fork with `git push --set-upstream YOUR_USERNAME YOUR_BRANCH_NAME`
7. Go to https://github.com/Homebrew/homebrew and create a pull request to request review and merge of commits in your pushed branch. Make sure you explain why the change is needed and, if fixing a bug, how to reproduce the bug. Please note that the preferred commit message format for simple version updates is "FORMULA_NAME NEW_VERSION", e.g. "`source-highlight 3.1.8`". `devel` version bumps should have the commit message marked with addtional `(devel)` suffix like "`nginx 1.9.1 (devel)`". Await feedback or a merge from Homebrew's maintainers. 7. Go to https://github.com/Homebrew/homebrew-core and create a pull request to request review and merge of commits in your pushed branch. Make sure you explain why the change is needed and, if fixing a bug, how to reproduce the bug. Please note that the preferred commit message format for simple version updates is "FORMULA_NAME NEW_VERSION", e.g. "`source-highlight 3.1.8`". `devel` version bumps should have the commit message marked with addtional `(devel)` suffix like "`nginx 1.9.1 (devel)`". Await feedback or a merge from Homebrew's maintainers.
To respond well to feedback: To respond well to feedback:
......
# Interesting Taps & Branches # Interesting Taps & Branches
A Tap is homebrew-speak for a git repository containing extra formulae. A Tap is homebrew-speak for a git repository containing extra formulae.
Homebrew has the capability to add (and remove) multiple taps to your local installation with the `brew tap` and `brew untap` command. Type `man brew` in your Terminal. The main repository https://github.com/Homebrew/homebrew often called "Homebrew/homebrew" is always built-in. Homebrew has the capability to add (and remove) multiple taps to your local installation with the `brew tap` and `brew untap` command. Type `man brew` in your Terminal. The main repository https://github.com/Homebrew/homebrew-core often called "Homebrew/core" is always built-in.
## Main Taps ## Main Taps
......
# Migrating A Formula To A Tap # Migrating A Formula To A Tap
There are times when we may wish to migrate a formula from Homebrew's core (the main repository) into a tap (another repository). To do this: There are times when we may wish to migrate a formula from one tap into another tap. To do this:
1. Create a pull request to the new tap adding the formula file as-is from the main Homebrew repository. Fix any test failures that may occur due to the stricter requirements for new formulae than existing formula (e.g. `brew audit --strict` must pass for that formula). 1. Create a pull request to the new tap adding the formula file as-is from the original tap. Fix any test failures that may occur due to the stricter requirements for new formulae than existing formula (e.g. `brew audit --strict` must pass for that formula).
2. Create a pull request to the main repository deleting the formula file and add it to `Library/Homebrew/tap_migrations.rb` with a commit message like `gv: migrating to homebrew/x11`. 2. Create a pull request to the original tap deleting the formula file and add it to `tap_migrations.json` with a commit message like `gv: migrating to homebrew/x11`.
3. Put a link for each pull request in the other pull request so the maintainers can merge them both at once. 3. Put a link for each pull request in the other pull request so the maintainers can merge them both at once.
Congratulations, you've moved a formula to a tap! Congratulations, you've moved a formula to a tap!
# Renaming a Formula # Renaming a Formula
Sometimes software and formulae need to be renamed. To rename core formula Sometimes software and formulae need to be renamed. To rename a formula
you need to: you need to:
1. Rename the formula file and its class to a new formula. The new name must meet all the usual rules of formula naming. Fix any test failures that may occur due to the stricter requirements for new formulae than existing formulae (i.e. `brew audit --strict` must pass for that formula). 1. Rename the formula file and its class to a new formula. The new name must meet all the usual rules of formula naming. Fix any test failures that may occur due to the stricter requirements for new formulae than existing formulae (i.e. `brew audit --strict` must pass for that formula).
2. Create a pull request to the main Homebrew repository deleting the old formula file, adding the new formula file and add it to `Library/Homebrew/formula_renames.rb` with a commit message like `newack: renamed from ack` 2. Create a pull request to the corresponding tap deleting the old formula file, adding the new formula file and add it to `formula_renames.json` with a commit message like `newack: renamed from ack`. Use canonical name (e.g. `ack` instead of `user/repo/ack`).
To rename tap formulae you need to follow the same steps but add formulae to `formula_renames.json` in the root of your tap. You don't need to change `Library/Homebrew/formula_renames.rb`, because that file is for Homebrew core formulae only. Use canonical name (e.g. `ack` instead of `user/repo/ack`).
A `Library/Homebrew/formula_renames.rb` example for a core formula rename: A `formula_renames.json` example for a formula rename:
```ruby
FORMULA_RENAMES = {
"ack" => "newack"
}
```
A `formula_renames.json` example for a tap formula rename:
```json ```json
{ {
......
...@@ -16,11 +16,11 @@ brew gist-logs <formula> ...@@ -16,11 +16,11 @@ brew gist-logs <formula>
* If things fail with permissions errors, check the permissions in `/usr/local`. If you’re unsure what to do, you can `sudo chown -R $(whoami) /usr/local`. * If things fail with permissions errors, check the permissions in `/usr/local`. If you’re unsure what to do, you can `sudo chown -R $(whoami) /usr/local`.
## Check to see if the issue has been reported ## Check to see if the issue has been reported
* Check the [issue tracker](https://github.com/Homebrew/homebrew/issues) to see if someone else has already reported the same issue. * Check the [issue tracker](https://github.com/Homebrew/homebrew-core/issues) to see if someone else has already reported the same issue.
* Make sure you check issues on the correct repository. If the formula that failed to build is part of a tap like [homebrew/science](https://github.com/Homebrew/homebrew-science) or [homebrew/dupes](https://github.com/Homebrew/homebrew-dupes) check there instead. * Make sure you check issues on the correct repository. If the formula that failed to build is part of a tap like [homebrew/science](https://github.com/Homebrew/homebrew-science) or [homebrew/dupes](https://github.com/Homebrew/homebrew-dupes) check there instead.
## Create an issue ## Create an issue
0. Upload debugging information to a [Gist](https://gist.github.com): 0. Upload debugging information to a [Gist](https://gist.github.com):
- If you had a formula error: run `brew gist-logs <formula>` (where `<formula>` is the name of the formula that failed to build). - If you had a formula error: run `brew gist-logs <formula>` (where `<formula>` is the name of the formula that failed to build).
- If you encountered a non-formula bug: upload the output of `brew config` and `brew doctor` to a new [Gist](https://gist.github.com). - If you encountered a non-formula bug: upload the output of `brew config` and `brew doctor` to a new [Gist](https://gist.github.com).
1. [Create a new issue](https://github.com/Homebrew/homebrew/issues/new) titled "\<formula name> failed to build on 10.x", where `<formula name>` is the name of the formula that failed to build, and `10.x` is the version of OS X you are using and including the link output by `brew gist-logs` 1. [Create a new issue](https://github.com/Homebrew/homebrew-core/issues/new) titled "\<formula name> failed to build on 10.x", where `<formula name>` is the name of the formula that failed to build, and `10.x` is the version of OS X you are using and including the link output by `brew gist-logs`
...@@ -75,16 +75,16 @@ For example, you can create a tap for an alternative `vim` formula. Without ...@@ -75,16 +75,16 @@ For example, you can create a tap for an alternative `vim` formula. Without
pinning it, the behavior will be pinning it, the behavior will be
```bash ```bash
brew install vim # installs from Homebrew/homebrew brew install vim # installs from homebrew/core
brew install username/repo/vim # installs from your custom repo brew install username/repo/vim # installs from your custom repo
``` ```
However if you pin the tap with `brew tap-pin username/repo`, you will need to However if you pin the tap with `brew tap-pin username/repo`, you will need to
use `homebrew/homebrew` to refer to the core formula. use `homebrew/core` to refer to the core formula.
```bash ```bash
brew install vim # installs from your custom repo brew install vim # installs from your custom repo
brew install homebrew/homebrew/vim # installs from Homebrew/homebrew brew install homebrew/core/vim # installs from homebrew/core
``` ```
Do note that pinned taps are prioritized only when the formula name is directly Do note that pinned taps are prioritized only when the formula name is directly
......
...@@ -415,7 +415,7 @@ can take several different forms:</p> ...@@ -415,7 +415,7 @@ can take several different forms:</p>
You can still access these formulae by using a special syntax, e.g. You can still access these formulae by using a special syntax, e.g.
<code>homebrew/dupes/vim</code> or <code>homebrew/versions/node4</code>.</p></dd> <code>homebrew/dupes/vim</code> or <code>homebrew/versions/node4</code>.</p></dd>
<dt>An arbitrary URL</dt><dd><p>Homebrew can install formulae via URL, e.g. <dt>An arbitrary URL</dt><dd><p>Homebrew can install formulae via URL, e.g.
<code>https://raw.github.com/Homebrew/homebrew/master/Library/Formula/git.rb</code>. <code>https://raw.github.com/Homebrew/homebrew-core/master/Formula/git.rb</code>.
The formula file will be cached for later use.</p></dd> The formula file will be cached for later use.</p></dd>
</dl> </dl>
...@@ -539,6 +539,12 @@ your shell profile, or you can use it before a brew command:</p> ...@@ -539,6 +539,12 @@ your shell profile, or you can use it before a brew command:</p>
<h2 id="BUGS">BUGS</h2> <h2 id="BUGS">BUGS</h2>
<p>See our issues on GitHub: <a href="https://github.com/Homebrew/homebrew/issues" data-bare-link="true">https://github.com/Homebrew/homebrew/issues</a></p> <p>See our issues on GitHub:</p>
<ul>
<li><p>Homebrew <a href="https://github.com/Homebrew/homebrew/issues" data-bare-link="true">https://github.com/Homebrew/homebrew/issues</a></p></li>
<li><p>Homebrew/homebrew-core <a href="https://github.com/Homebrew/homebrew-core/issues" data-bare-link="true">https://github.com/Homebrew/homebrew-core/issues</a></p></li>
</ul>
</div> </div>
.\" generated with Ronn/v0.7.3 .\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3
. .
.TH "BREW" "1" "March 2016" "Homebrew" "brew" .TH "BREW" "1" "April 2016" "Homebrew" "brew"
. .
.SH "NAME" .SH "NAME"
\fBbrew\fR \- The missing package manager for OS X \fBbrew\fR \- The missing package manager for OS X
...@@ -592,7 +592,7 @@ Sometimes a formula from a tapped repository may conflict with one in \fBHomebre ...@@ -592,7 +592,7 @@ Sometimes a formula from a tapped repository may conflict with one in \fBHomebre
. .
.TP .TP
An arbitrary URL An arbitrary URL
Homebrew can install formulae via URL, e\.g\. \fBhttps://raw\.github\.com/Homebrew/homebrew/master/Library/Formula/git\.rb\fR\. The formula file will be cached for later use\. Homebrew can install formulae via URL, e\.g\. \fBhttps://raw\.github\.com/Homebrew/homebrew\-core/master/Formula/git\.rb\fR\. The formula file will be cached for later use\.
. .
.SH "ENVIRONMENT" .SH "ENVIRONMENT"
. .
...@@ -768,4 +768,12 @@ Homebrew\'s current maintainers are Misty De Meo, Andrew Janke, Xu Cheng, Mike M ...@@ -768,4 +768,12 @@ Homebrew\'s current maintainers are Misty De Meo, Andrew Janke, Xu Cheng, Mike M
Former maintainers with significant contributions include Jack Nagel, Adam Vandenberg and Homebrew\'s creator: Max Howell\. Former maintainers with significant contributions include Jack Nagel, Adam Vandenberg and Homebrew\'s creator: Max Howell\.
. .
.SH "BUGS" .SH "BUGS"
See our issues on GitHub: \fIhttps://github\.com/Homebrew/homebrew/issues\fR See our issues on GitHub:
.
.IP "\(bu" 4
Homebrew \fIhttps://github\.com/Homebrew/homebrew/issues\fR
.
.IP "\(bu" 4
Homebrew/homebrew\-core \fIhttps://github\.com/Homebrew/homebrew\-core/issues\fR
.
.IP "" 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment