mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Adjust documentation for devel
deprecation.
Update the documentation to be consistent with #7688.
This commit is contained in:
parent
3a7213c255
commit
1eefc4c584
@ -2383,6 +2383,7 @@ class Formula
|
||||
# depends_on "cairo"
|
||||
# depends_on "pixman"
|
||||
# end</pre>
|
||||
# @private
|
||||
def devel(&block)
|
||||
@devel ||= SoftwareSpec.new
|
||||
return @devel unless block_given?
|
||||
@ -2415,7 +2416,7 @@ class Formula
|
||||
end
|
||||
|
||||
# Additional downloads can be defined as resources and accessed in the
|
||||
# install method. Resources can also be defined inside a {.stable}, {.devel} or
|
||||
# install method. Resources can also be defined inside a {.stable} or
|
||||
# {.head} block. This mechanism replaces ad-hoc "subformula" classes.
|
||||
# <pre>resource "additional_files" do
|
||||
# url "https://example.com/additional-stuff.tar.gz"
|
||||
@ -2525,7 +2526,7 @@ class Formula
|
||||
# sha256 "c6bc3f48ce8e797854c4b865f6a8ff969867bbcaebd648ae6fd825683e59fef2"
|
||||
# end</pre>
|
||||
#
|
||||
# Patches can be declared in stable, devel, and head blocks. This form is
|
||||
# Patches can be declared in stable and head blocks. This form is
|
||||
# preferred over using conditionals.
|
||||
# <pre>stable do
|
||||
# patch do
|
||||
|
@ -476,7 +476,7 @@ patch :p0 do
|
||||
end
|
||||
```
|
||||
|
||||
[`patch`](https://rubydoc.brew.sh/Formula#patch-class_method)es can be declared in [`stable`](https://rubydoc.brew.sh/Formula#stable-class_method), [`devel`](https://rubydoc.brew.sh/Formula#devel-class_method), and [`head`](https://rubydoc.brew.sh/Formula#head-class_method) blocks. Always use a block instead of a conditional, i.e. `stable do ... end` instead of `if build.stable? then ... end`.
|
||||
[`patch`](https://rubydoc.brew.sh/Formula#patch-class_method)es can be declared in [`stable`](https://rubydoc.brew.sh/Formula#stable-class_method) and [`head`](https://rubydoc.brew.sh/Formula#head-class_method) blocks. Always use a block instead of a conditional, i.e. `stable do ... end` instead of `if build.stable? then ... end`.
|
||||
|
||||
```ruby
|
||||
stable do
|
||||
@ -532,9 +532,9 @@ Instead of `git diff | pbcopy`, for some editors `git diff >> path/to/your/formu
|
||||
|
||||
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 (`head`)
|
||||
|
||||
Formulae can specify alternate downloads for the upstream project’s [`head`](https://rubydoc.brew.sh/Formula#head-class_method) (`master`/`trunk`) or [`devel`](https://rubydoc.brew.sh/Formula#devel-class_method) release (unstable but not `master`/`trunk`).
|
||||
Formulae can specify an alternate download for the upstream project’s [`head`](https://rubydoc.brew.sh/Formula#head-class_method) (`master`/`trunk`).
|
||||
|
||||
#### `head`
|
||||
|
||||
@ -559,21 +559,6 @@ class Foo < Formula
|
||||
end
|
||||
```
|
||||
|
||||
#### `devel`
|
||||
|
||||
The [`devel`](https://rubydoc.brew.sh/Formula#devel-class_method) spec (activated by passing `--devel`) is used for a project’s unstable releases. `devel` specs are not allowed in Homebrew/homebrew-core.
|
||||
|
||||
A `devel` spec is specified in a block:
|
||||
|
||||
```ruby
|
||||
devel do
|
||||
url "https://foo.com/foo-0.1.tar.gz"
|
||||
sha256 "85cc828a96735bdafcf29eb6291ca91bac846579bcef7308536e0c875d6c81d7"
|
||||
end
|
||||
```
|
||||
|
||||
You can test if the [`devel`](https://rubydoc.brew.sh/Formula#devel-class_method) spec is in use with `build.devel?`.
|
||||
|
||||
### Compiler selection
|
||||
|
||||
Sometimes a package fails to build when using a certain compiler. Since recent [Xcode versions](Xcode.md) no longer include a GCC compiler we cannot simply force the use of GCC. Instead, the correct way to declare this is the [`fails_with`](https://rubydoc.brew.sh/Formula#fails_with-class_method) DSL method. A properly constructed [`fails_with`](https://rubydoc.brew.sh/Formula#fails_with-class_method) block documents the latest compiler build version known to cause compilation to fail, and the cause of the failure. For example:
|
||||
@ -763,7 +748,7 @@ In summary, environment variables used by a formula need to conform to these fil
|
||||
|
||||
## Updating formulae
|
||||
|
||||
Eventually a new version of the software will be released. In this case you should update the [`url`](https://rubydoc.brew.sh/Formula#url-class_method) and [`sha256`](https://rubydoc.brew.sh/Formula#sha256%3D-class_method). If a [`revision`](https://rubydoc.brew.sh/Formula#revision%3D-class_method) line exists outside any `bottle do` block *and* the new release is stable rather than devel, it should be removed.
|
||||
Eventually a new version of the software will be released. In this case you should update the [`url`](https://rubydoc.brew.sh/Formula#url-class_method) and [`sha256`](https://rubydoc.brew.sh/Formula#sha256%3D-class_method). If a [`revision`](https://rubydoc.brew.sh/Formula#revision%3D-class_method) line exists outside any `bottle do` block it should be removed.
|
||||
|
||||
Leave the `bottle do ... end` block as-is; our CI system will update it when we pull your change.
|
||||
|
||||
|
@ -63,7 +63,7 @@ To make a new branch and submit it for review, create a GitHub pull request with
|
||||
brew audit --strict <CHANGED_FORMULA>
|
||||
```
|
||||
6. [Make a separate commit](Formula-Cookbook.md#commit) for each changed formula with `git add` and `git commit`.
|
||||
* Please note that our preferred commit message format for simple version updates is "`<FORMULA_NAME> <NEW_VERSION>`", e.g. "`source-highlight 3.1.8`" but `devel` version updates should have the commit message suffixed with `(devel)`, e.g. "`nginx 1.9.1 (devel)`". If updating both `stable` and `devel`, the format should be a concatenation of these two forms, e.g. "`x264 r2699, r2705 (devel)`".
|
||||
* Please note that our preferred commit message format for simple version updates is "`<FORMULA_NAME> <NEW_VERSION>`", e.g. "`source-highlight 3.1.8`".
|
||||
7. Upload your branch of new commits to your fork:
|
||||
```sh
|
||||
git push --set-upstream <YOUR_USERNAME> <YOUR_BRANCH_NAME>
|
||||
|
Loading…
x
Reference in New Issue
Block a user