mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
docs: prefer /opt/homebrew in examples
This commit is contained in:
parent
19f15aced2
commit
29b2f35ce8
@ -40,15 +40,15 @@ Linux distribution without requiring `sudo`.
|
|||||||
|
|
||||||
**prefix**
|
**prefix**
|
||||||
|
|
||||||
: path in which Homebrew is installed, e.g. `/usr/local`
|
: path in which Homebrew is installed, e.g. `/opt/homebrew` or `/home/linuxbrew/.linuxbrew`
|
||||||
|
|
||||||
**keg**
|
**keg**
|
||||||
|
|
||||||
: installation destination directory of a given **formula** version, e.g. `/usr/local/Cellar/foo/0.1`
|
: installation destination directory of a given **formula** version, e.g. `/opt/homebrew/Cellar/foo/0.1`
|
||||||
|
|
||||||
**rack**
|
**rack**
|
||||||
|
|
||||||
: directory containing one or more versioned **kegs**, e.g. `/usr/local/Cellar/foo`
|
: directory containing one or more versioned **kegs**, e.g. `/opt/homebrew/Cellar/foo`
|
||||||
|
|
||||||
**keg-only**
|
**keg-only**
|
||||||
|
|
||||||
@ -56,15 +56,15 @@ Linux distribution without requiring `sudo`.
|
|||||||
|
|
||||||
**opt prefix**
|
**opt prefix**
|
||||||
|
|
||||||
: a symlink to the active version of a **keg**, e.g. `/usr/local/opt/foo`
|
: a symlink to the active version of a **keg**, e.g. `/opt/homebrew/opt/foo`
|
||||||
|
|
||||||
**Cellar**
|
**Cellar**
|
||||||
|
|
||||||
: directory containing one or more named **racks**, e.g. `/usr/local/Cellar`
|
: directory containing one or more named **racks**, e.g. `/opt/homebrew/Cellar`
|
||||||
|
|
||||||
**Caskroom**
|
**Caskroom**
|
||||||
|
|
||||||
: directory containing one or more named **casks**, e.g. `/usr/local/Caskroom`
|
: directory containing one or more named **casks**, e.g. `/opt/homebrew/Caskroom`
|
||||||
|
|
||||||
**external command**
|
**external command**
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ Before submitting a cask to any of our repositories, you must read our [document
|
|||||||
|
|
||||||
Common reasons to reject a cask entirely:
|
Common reasons to reject a cask entirely:
|
||||||
|
|
||||||
* App fails with GateKeeper enabled on Homebrew supported macOS versions and platforms (e.g. unsigned apps fail on Macs with Apple Silicon/ARM).
|
* App fails with GateKeeper enabled on Homebrew supported macOS versions and platforms (e.g. unsigned apps will not launch on Apple Silicon Macs).
|
||||||
* App is too obscure. Examples:
|
* App is too obscure. Examples:
|
||||||
* An app from a code repository that is not notable enough (under 30 forks, 30 watchers, 75 stars).
|
* An app from a code repository that is not notable enough (under 30 forks, 30 watchers, 75 stars).
|
||||||
* [Electronic Identification (eID) software](https://github.com/Homebrew/homebrew-cask/issues/59021).
|
* [Electronic Identification (eID) software](https://github.com/Homebrew/homebrew-cask/issues/59021).
|
||||||
|
@ -13,7 +13,7 @@ Some formulae should not go in [homebrew/core](https://github.com/Homebrew/homeb
|
|||||||
|
|
||||||
### Supported platforms
|
### Supported platforms
|
||||||
|
|
||||||
The formula needs to build and pass tests on the latest 3 supported macOS versions ([x86_64 and Apple Silicon/ARM](Installation.md#macos-requirements)) and on x86_64 [Linux](Linux-CI.md). Please have a look at the continuous integration jobs on a pull request in `homebrew/core` to see the full list of OSs. If upstream does not support one of these platforms, an exception can be made and the formula can be disabled for that platform.
|
The formula needs to build and pass tests on the latest 3 supported macOS versions ([Apple Silicon and x86_64](Installation.md#macos-requirements)) and on x86_64 [Linux](Linux-CI.md). Please have a look at the continuous integration jobs on a pull request in `homebrew/core` to see the full list of OSs. If upstream does not support one of these platforms, an exception can be made and the formula can be disabled for that platform.
|
||||||
|
|
||||||
### Duplicates of system packages
|
### Duplicates of system packages
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ Each cask must declare one or more *artifacts* (i.e. something to install).
|
|||||||
| [`pkg`](#stanza-pkg) | yes | Relative path to a `.pkg` file containing the distribution. |
|
| [`pkg`](#stanza-pkg) | yes | Relative path to a `.pkg` file containing the distribution. |
|
||||||
| [`installer`](#stanza-installer) | yes | Describes an executable which must be run to complete the installation. |
|
| [`installer`](#stanza-installer) | yes | Describes an executable which must be run to complete the installation. |
|
||||||
| [`binary`](#stanza-binary) | yes | Relative path to a Binary that should be linked into the `$(brew --prefix)/bin` folder on installation. |
|
| [`binary`](#stanza-binary) | yes | Relative path to a Binary that should be linked into the `$(brew --prefix)/bin` folder on installation. |
|
||||||
| `manpage` | yes | Relative path to a Man Page that should be linked into the respective man page folder on installation, e.g. `/usr/local/share/man/man3` for `my_app.3`. |
|
| `manpage` | yes | Relative path to a Man Page that should be linked into the respective man page folder on installation, e.g. `/opt/homebrew/share/man/man3` for `my_app.3`. |
|
||||||
| `colorpicker` | yes | Relative path to a ColorPicker plugin that should be moved into the `~/Library/ColorPickers` folder on installation. |
|
| `colorpicker` | yes | Relative path to a ColorPicker plugin that should be moved into the `~/Library/ColorPickers` folder on installation. |
|
||||||
| `dictionary` | yes | Relative path to a Dictionary that should be moved into the `~/Library/Dictionaries` folder on installation. |
|
| `dictionary` | yes | Relative path to a Dictionary that should be moved into the `~/Library/Dictionaries` folder on installation. |
|
||||||
| `font` | yes | Relative path to a Font that should be moved into the `~/Library/Fonts` folder on installation. |
|
| `font` | yes | Relative path to a Font that should be moved into the `~/Library/Fonts` folder on installation. |
|
||||||
@ -417,17 +417,17 @@ The available symbols for hardware are:
|
|||||||
|
|
||||||
| symbol | meaning |
|
| symbol | meaning |
|
||||||
| ---------- | -------------- |
|
| ---------- | -------------- |
|
||||||
|
| `:arm64` | Apple Silicon |
|
||||||
| `:x86_64` | 64-bit Intel |
|
| `:x86_64` | 64-bit Intel |
|
||||||
| `:intel` | 64-bit Intel |
|
| `:intel` | 64-bit Intel |
|
||||||
| `:arm64` | Apple Silicon |
|
|
||||||
|
|
||||||
The following are all valid expressions:
|
The following are all valid expressions:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
|
depends_on arch: :arm64
|
||||||
depends_on arch: :intel
|
depends_on arch: :intel
|
||||||
depends_on arch: :x86_64 # same meaning as above
|
depends_on arch: :x86_64 # same meaning as above
|
||||||
depends_on arch: [:x86_64] # same meaning as above
|
depends_on arch: [:x86_64] # same meaning as above
|
||||||
depends_on arch: :arm64
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `depends_on` parameters
|
#### `depends_on` parameters
|
||||||
@ -1182,7 +1182,7 @@ If no additional files are discovered, instead of a zap stanza, include the foll
|
|||||||
|
|
||||||
Casks can deliver specific versions of artifacts depending on the current macOS release or CPU architecture by either tailoring the URL / SHA-256 hash / version, using the [`on_<system>` syntax](Formula-Cookbook.md#handling-different-system-configurations) (which replaces conditional statements using `MacOS.version` or `Hardware::CPU`), or both.
|
Casks can deliver specific versions of artifacts depending on the current macOS release or CPU architecture by either tailoring the URL / SHA-256 hash / version, using the [`on_<system>` syntax](Formula-Cookbook.md#handling-different-system-configurations) (which replaces conditional statements using `MacOS.version` or `Hardware::CPU`), or both.
|
||||||
|
|
||||||
If your cask's artifact is offered as separate downloads for Intel and Apple Silicon architectures, they'll presumably be downloadable at distinct URLs that differ only slightly. To adjust the URL depending on the current CPU architecture, supply a hash for each to the `arm:` and `intel:` parameters of `sha256`, and use the special `arch` stanza to define the unique components of the respective URLs for substitution in the `url`. Additional substitutions can be defined by calling `on_arch_conditional` directly. Example (from [libreoffice.rb](https://github.com/Homebrew/homebrew-cask/blob/a4164b8f5084fdaefb6e2e2f4f699270690b7845/Casks/l/libreoffice.rb#L1-L10)):
|
If your cask's artifact is offered as separate downloads for Apple Silicon and Intel architectures, they'll presumably be downloadable at distinct URLs that differ only slightly. To adjust the URL depending on the current CPU architecture, supply a hash for each to the `arm:` and `intel:` parameters of `sha256`, and use the special `arch` stanza to define the unique components of the respective URLs for substitution in the `url`. Additional substitutions can be defined by calling `on_arch_conditional` directly. Example (from [libreoffice.rb](https://github.com/Homebrew/homebrew-cask/blob/a4164b8f5084fdaefb6e2e2f4f699270690b7845/Casks/l/libreoffice.rb#L1-L10)):
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
cask "libreoffice" do
|
cask "libreoffice" do
|
||||||
|
@ -127,7 +127,7 @@ This is an issue in the connection between your machine and GitHub, rather than
|
|||||||
|
|
||||||
Upgrading macOS can cause errors like the following:
|
Upgrading macOS can cause errors like the following:
|
||||||
|
|
||||||
* `dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.54.dylib`
|
* `dyld: Library not loaded: /opt/homebrew/opt/icu4c/lib/libicui18n.76.dylib`
|
||||||
* `configure: error: Cannot find libz`
|
* `configure: error: Cannot find libz`
|
||||||
|
|
||||||
Following a macOS upgrade it may be necessary to reinstall the Xcode Command Line Tools and then `brew upgrade` all installed formulae:
|
Following a macOS upgrade it may be necessary to reinstall the Xcode Command Line Tools and then `brew upgrade` all installed formulae:
|
||||||
|
@ -33,7 +33,7 @@ An executable script for a command named `extcmd` should be named `brew-extcmd`.
|
|||||||
| variable | description |
|
| variable | description |
|
||||||
| ---------------------- | ----------- |
|
| ---------------------- | ----------- |
|
||||||
| `HOMEBREW_CACHE` | Where Homebrew caches downloaded tarballs to, by default `~/Library/Caches/Homebrew`. |
|
| `HOMEBREW_CACHE` | Where Homebrew caches downloaded tarballs to, by default `~/Library/Caches/Homebrew`. |
|
||||||
| `HOMEBREW_PREFIX` | Where Homebrew installs software. `/usr/local` by default for macOS Intel, `/opt/homebrew` for Apple Silicon and `/home/linuxbrew/.linuxbrew` for Linux. |
|
| `HOMEBREW_PREFIX` | Where Homebrew installs software. `/opt/homebrew` by default for Apple Silicon, `/usr/local` for macOS Intel and `/home/linuxbrew/.linuxbrew` for Linux. |
|
||||||
| `HOMEBREW_CELLAR` | The location of the Homebrew Cellar, where software is staged. This will be `HOMEBREW_PREFIX/Cellar` if that directory exists, or `HOMEBREW_REPOSITORY/Cellar` otherwise. |
|
| `HOMEBREW_CELLAR` | The location of the Homebrew Cellar, where software is staged. This will be `HOMEBREW_PREFIX/Cellar` if that directory exists, or `HOMEBREW_REPOSITORY/Cellar` otherwise. |
|
||||||
| `HOMEBREW_LIBRARY_PATH`| The directory containing Homebrew’s own application code. |
|
| `HOMEBREW_LIBRARY_PATH`| The directory containing Homebrew’s own application code. |
|
||||||
| `HOMEBREW_REPOSITORY` | The Git repository directory (i.e. where Homebrew’s `.git` directory lives). Usually either the same as `HOMEBREW_PREFIX` or a `Homebrew` subdirectory. |
|
| `HOMEBREW_REPOSITORY` | The Git repository directory (i.e. where Homebrew’s `.git` directory lives). Usually either the same as `HOMEBREW_PREFIX` or a `Homebrew` subdirectory. |
|
||||||
|
@ -96,8 +96,8 @@ We aim to bottle everything.
|
|||||||
|
|
||||||
Homebrew's pre-built binary packages (known as [bottles](Bottles.md)) of many formulae can only be used if you install in the default installation prefix, otherwise they have to be built from source. Building from source takes a long time, is prone to failure, and is not supported. The default prefix is:
|
Homebrew's pre-built binary packages (known as [bottles](Bottles.md)) of many formulae can only be used if you install in the default installation prefix, otherwise they have to be built from source. Building from source takes a long time, is prone to failure, and is not supported. The default prefix is:
|
||||||
|
|
||||||
* `/usr/local` for macOS on Intel,
|
* `/opt/homebrew` for macOS on Apple Silicon,
|
||||||
* `/opt/homebrew` for macOS on Apple Silicon/ARM, and
|
* `/usr/local` for macOS on Intel, and
|
||||||
* `/home/linuxbrew/.linuxbrew` for Linux.
|
* `/home/linuxbrew/.linuxbrew` for Linux.
|
||||||
|
|
||||||
Do yourself a favour and install to the default prefix so that you can use our pre-built binary packages. *Pick another prefix at your peril!*
|
Do yourself a favour and install to the default prefix so that you can use our pre-built binary packages. *Pick another prefix at your peril!*
|
||||||
|
@ -13,19 +13,19 @@ A *formula* is a package definition written in Ruby. It can be created with `bre
|
|||||||
|
|
||||||
| term | description | example |
|
| term | description | example |
|
||||||
| -------------------- | ------------------------------------------------------------------------- | ------- |
|
| -------------------- | ------------------------------------------------------------------------- | ------- |
|
||||||
| **formula** | Homebrew package definition that builds from upstream sources | `/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/f/foo.rb` |
|
| **formula** | Homebrew package definition that builds from upstream sources | `/opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/f/foo.rb` |
|
||||||
| **cask** | Homebrew package definition that installs macOS native applications | `/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks/b/bar.rb` |
|
| **cask** | Homebrew package definition that installs macOS native applications | `/opt/homebrew/Library/Taps/homebrew/homebrew-cask/Casks/b/bar.rb` |
|
||||||
| **prefix** | path in which Homebrew is installed | `/usr/local` |
|
| **prefix** | path in which Homebrew is installed | `/opt/homebrew` |
|
||||||
| **keg** | installation destination directory of a given **formula** version | `/usr/local/Cellar/foo/0.1` |
|
| **keg** | installation destination directory of a given **formula** version | `/opt/homebrew/Cellar/foo/0.1` |
|
||||||
| **rack** | directory containing one or more versioned **kegs** | `/usr/local/Cellar/foo` |
|
| **rack** | directory containing one or more versioned **kegs** | `/opt/homebrew/Cellar/foo` |
|
||||||
| **keg-only** | a **formula** is *keg-only* if it is not symlinked into Homebrew's prefix | the [`openjdk`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/o/openjdk.rb) formula |
|
| **keg-only** | a **formula** is *keg-only* if it is not symlinked into Homebrew's prefix | the [`openjdk`](https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/o/openjdk.rb) formula |
|
||||||
| **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** | `/opt/homebrew/opt/foo` |
|
||||||
| **Cellar** | directory containing one or more named **racks** | `/usr/local/Cellar` |
|
| **Cellar** | directory containing one or more named **racks** | `/opt/homebrew/Cellar` |
|
||||||
| **Caskroom** | directory containing one or more named **casks** | `/usr/local/Caskroom` |
|
| **Caskroom** | directory containing one or more named **casks** | `/opt/homebrew/Caskroom` |
|
||||||
| **external command** | `brew` subcommand defined outside of the Homebrew/brew GitHub repository | [`brew alias`](https://github.com/Homebrew/homebrew-aliases) |
|
| **external command** | `brew` subcommand defined outside of the Homebrew/brew GitHub repository | [`brew alias`](https://github.com/Homebrew/homebrew-aliases) |
|
||||||
| **tap** | directory (and usually Git repository) of **formulae**, **casks** and/or **external commands** | `/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core` |
|
| **tap** | directory (and usually Git repository) of **formulae**, **casks** and/or **external commands** | `/opt/homebrew/Library/Taps/homebrew/homebrew-core` |
|
||||||
| **bottle** | pre-built **keg** poured into a **rack** of the **Cellar** instead of building from upstream sources | `qt--6.5.1.ventura.bottle.tar.gz` |
|
| **bottle** | pre-built **keg** poured into a **rack** of the **Cellar** instead of building from upstream sources | `qt--6.5.1.ventura.bottle.tar.gz` |
|
||||||
| **tab** | information about a **keg**, e.g. whether it was poured from a **bottle** or built from source | `/usr/local/Cellar/foo/0.1/INSTALL_RECEIPT.json` |
|
| **tab** | information about a **keg**, e.g. whether it was poured from a **bottle** or built from source | `/opt/homebrew/Cellar/foo/0.1/INSTALL_RECEIPT.json` |
|
||||||
| **Brew Bundle** | an [extension of Homebrew](https://github.com/Homebrew/homebrew-bundle) to describe dependencies | `brew 'myservice', restart_service: true` |
|
| **Brew Bundle** | an [extension of Homebrew](https://github.com/Homebrew/homebrew-bundle) to describe dependencies | `brew 'myservice', restart_service: true` |
|
||||||
| **Brew Services** | an [extension of Homebrew](https://github.com/Homebrew/homebrew-services) to manage services | `brew services start myservice` |
|
| **Brew Services** | an [extension of Homebrew](https://github.com/Homebrew/homebrew-services) to manage services | `brew services start myservice` |
|
||||||
|
|
||||||
@ -196,14 +196,14 @@ When a version scheme of a formula fails to recognise a new version as newer it
|
|||||||
When you already have a lot of formulae installed, it's easy to miss a common dependency. You can double-check which libraries a binary links to with the `otool` command (perhaps you need to use `xcrun otool`):
|
When you already have a lot of formulae installed, it's easy to miss a common dependency. You can double-check which libraries a binary links to with the `otool` command (perhaps you need to use `xcrun otool`):
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ otool -L /usr/local/bin/ldapvi
|
$ otool -L /opt/homebrew/bin/ldapvi
|
||||||
/usr/local/bin/ldapvi:
|
/opt/homebrew/bin/ldapvi:
|
||||||
/usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
|
/opt/homebrew/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
|
||||||
/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
|
/opt/homebrew/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
|
||||||
/usr/local/lib/libglib-2.0.0.dylib (compatibility version 4201.0.0, current version 4201.0.0)
|
/opt/homebrew/lib/libglib-2.0.0.dylib (compatibility version 4201.0.0, current version 4201.0.0)
|
||||||
/usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.2.0)
|
/opt/homebrew/opt/gettext/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.2.0)
|
||||||
/usr/local/opt/readline/lib/libreadline.6.dylib (compatibility version 6.0.0, current version 6.3.0)
|
/opt/homebrew/opt/readline/lib/libreadline.6.dylib (compatibility version 6.0.0, current version 6.3.0)
|
||||||
/usr/local/lib/libpopt.0.dylib (compatibility version 1.0.0, current version 1.0.0)
|
/opt/homebrew/lib/libpopt.0.dylib (compatibility version 1.0.0, current version 1.0.0)
|
||||||
/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
|
/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
|
||||||
/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.4.0)
|
/System/Library/Frameworks/LDAP.framework/Versions/A/LDAP (compatibility version 1.0.0, current version 2.4.0)
|
||||||
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
|
/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 1.0.0)
|
||||||
@ -358,7 +358,7 @@ In case there are specific issues with the Homebrew packaging (compared to how t
|
|||||||
|
|
||||||
==> Caveats
|
==> Caveats
|
||||||
By default, binaries installed by gem will be placed into:
|
By default, binaries installed by gem will be placed into:
|
||||||
/usr/local/lib/ruby/gems/bin
|
/opt/homebrew/lib/ruby/gems/3.4.0/bin
|
||||||
|
|
||||||
You may want to add this to your PATH.
|
You may want to add this to your PATH.
|
||||||
|
|
||||||
@ -548,9 +548,9 @@ The `std_*_args` methods, as well as the arguments they pass, are:
|
|||||||
|
|
||||||
### `bin.install "foo"`
|
### `bin.install "foo"`
|
||||||
|
|
||||||
You’ll see stuff like this in some formulae. This moves the file `foo` into the formula’s `bin` directory (`/usr/local/Cellar/pkg/0.1/bin`) and makes it executable (`chmod 0555 foo`).
|
You’ll see stuff like this in some formulae. This moves the file `foo` into the formula’s `bin` directory (`/opt/homebrew/Cellar/pkg/0.1/bin`) and makes it executable (`chmod 0555 foo`).
|
||||||
|
|
||||||
You can also rename the file during the installation process. This can be useful for adding a prefix to binaries that would otherwise cause conflicts with another formula, or for removing a file extension. For example, to install `foo.py` into the formula's `bin` directory (`/usr/local/Cellar/pkg/0.1/bin`) as just `foo` instead of `foo.py`:
|
You can also rename the file during the installation process. This can be useful for adding a prefix to binaries that would otherwise cause conflicts with another formula, or for removing a file extension. For example, to install `foo.py` into the formula's `bin` directory (`/opt/homebrew/Cellar/pkg/0.1/bin`) as just `foo` instead of `foo.py`:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
bin.install "foo.py" => "foo"
|
bin.install "foo.py" => "foo"
|
||||||
@ -713,7 +713,7 @@ end
|
|||||||
Inside `def install` and `test do`, don't use these `on_*` methods. Instead, use `if` statements and the following conditionals:
|
Inside `def install` and `test do`, don't use these `on_*` methods. Instead, use `if` statements and the following conditionals:
|
||||||
|
|
||||||
* `OS.mac?` and `OS.linux?` return `true` or `false` based on the OS
|
* `OS.mac?` and `OS.linux?` return `true` or `false` based on the OS
|
||||||
* `Hardware::CPU.intel?` and `Hardware::CPU.arm?` return `true` or `false` based on the arch
|
* `Hardware::CPU.arm?` and `Hardware::CPU.intel?` return `true` or `false` based on the arch
|
||||||
* `MacOS.version` returns the current macOS version. Use `==`, `<=` or `>=` to compare to symbols corresponding to macOS versions (e.g. `if MacOS.version >= :mojave`)
|
* `MacOS.version` returns the current macOS version. Use `==`, `<=` or `>=` to compare to symbols corresponding to macOS versions (e.g. `if MacOS.version >= :mojave`)
|
||||||
|
|
||||||
See the [`icoutils`](https://github.com/Homebrew/homebrew-core/blob/442f9cc511ce6dfe75b96b2c83749d90dde914d2/Formula/i/icoutils.rb#L36) formula for an example.
|
See the [`icoutils`](https://github.com/Homebrew/homebrew-core/blob/442f9cc511ce6dfe75b96b2c83749d90dde914d2/Formula/i/icoutils.rb#L36) formula for an example.
|
||||||
@ -867,31 +867,31 @@ Generally we'd rather you were specific about which files or directories need to
|
|||||||
|
|
||||||
| name | default path | example |
|
| name | default path | example |
|
||||||
| --------------------- | ---------------------------------------------- | ------- |
|
| --------------------- | ---------------------------------------------- | ------- |
|
||||||
| **`HOMEBREW_PREFIX`** | output of `$(brew --prefix)` | `/usr/local` |
|
| **`HOMEBREW_PREFIX`** | output of `$(brew --prefix)` | `/opt/homebrew` |
|
||||||
| **`prefix`** | `#{HOMEBREW_PREFIX}/Cellar/#{name}/#{version}` | `/usr/local/Cellar/foo/0.1` |
|
| **`prefix`** | `#{HOMEBREW_PREFIX}/Cellar/#{name}/#{version}` | `/opt/homebrew/Cellar/foo/0.1` |
|
||||||
| **`opt_prefix`** | `#{HOMEBREW_PREFIX}/opt/#{name}` | `/usr/local/opt/foo` |
|
| **`opt_prefix`** | `#{HOMEBREW_PREFIX}/opt/#{name}` | `/opt/homebrew/opt/foo` |
|
||||||
| **`bin`** | `#{prefix}/bin` | `/usr/local/Cellar/foo/0.1/bin` |
|
| **`bin`** | `#{prefix}/bin` | `/opt/homebrew/Cellar/foo/0.1/bin` |
|
||||||
| **`doc`** | `#{prefix}/share/doc/#{name}` | `/usr/local/Cellar/foo/0.1/share/doc/foo` |
|
| **`doc`** | `#{prefix}/share/doc/#{name}` | `/opt/homebrew/Cellar/foo/0.1/share/doc/foo` |
|
||||||
| **`include`** | `#{prefix}/include` | `/usr/local/Cellar/foo/0.1/include` |
|
| **`include`** | `#{prefix}/include` | `/opt/homebrew/Cellar/foo/0.1/include` |
|
||||||
| **`info`** | `#{prefix}/share/info` | `/usr/local/Cellar/foo/0.1/share/info` |
|
| **`info`** | `#{prefix}/share/info` | `/opt/homebrew/Cellar/foo/0.1/share/info` |
|
||||||
| **`lib`** | `#{prefix}/lib` | `/usr/local/Cellar/foo/0.1/lib` |
|
| **`lib`** | `#{prefix}/lib` | `/opt/homebrew/Cellar/foo/0.1/lib` |
|
||||||
| **`libexec`** | `#{prefix}/libexec` | `/usr/local/Cellar/foo/0.1/libexec` |
|
| **`libexec`** | `#{prefix}/libexec` | `/opt/homebrew/Cellar/foo/0.1/libexec` |
|
||||||
| **`man`** | `#{prefix}/share/man` | `/usr/local/Cellar/foo/0.1/share/man` |
|
| **`man`** | `#{prefix}/share/man` | `/opt/homebrew/Cellar/foo/0.1/share/man` |
|
||||||
| **`man[1-8]`** | `#{prefix}/share/man/man[1-8]` | `/usr/local/Cellar/foo/0.1/share/man/man[1-8]` |
|
| **`man[1-8]`** | `#{prefix}/share/man/man[1-8]` | `/opt/homebrew/Cellar/foo/0.1/share/man/man[1-8]` |
|
||||||
| **`sbin`** | `#{prefix}/sbin` | `/usr/local/Cellar/foo/0.1/sbin` |
|
| **`sbin`** | `#{prefix}/sbin` | `/opt/homebrew/Cellar/foo/0.1/sbin` |
|
||||||
| **`share`** | `#{prefix}/share` | `/usr/local/Cellar/foo/0.1/share` |
|
| **`share`** | `#{prefix}/share` | `/opt/homebrew/Cellar/foo/0.1/share` |
|
||||||
| **`pkgshare`** | `#{prefix}/share/#{name}` | `/usr/local/Cellar/foo/0.1/share/foo` |
|
| **`pkgshare`** | `#{prefix}/share/#{name}` | `/opt/homebrew/Cellar/foo/0.1/share/foo` |
|
||||||
| **`elisp`** | `#{prefix}/share/emacs/site-lisp/#{name}` | `/usr/local/Cellar/foo/0.1/share/emacs/site-lisp/foo` |
|
| **`elisp`** | `#{prefix}/share/emacs/site-lisp/#{name}` | `/opt/homebrew/Cellar/foo/0.1/share/emacs/site-lisp/foo` |
|
||||||
| **`frameworks`** | `#{prefix}/Frameworks` | `/usr/local/Cellar/foo/0.1/Frameworks` |
|
| **`frameworks`** | `#{prefix}/Frameworks` | `/opt/homebrew/Cellar/foo/0.1/Frameworks` |
|
||||||
| **`kext_prefix`** | `#{prefix}/Library/Extensions` | `/usr/local/Cellar/foo/0.1/Library/Extensions` |
|
| **`kext_prefix`** | `#{prefix}/Library/Extensions` | `/opt/homebrew/Cellar/foo/0.1/Library/Extensions` |
|
||||||
| **`zsh_function`** | `#{prefix}/share/zsh/site-functions` | `/usr/local/Cellar/foo/0.1/share/zsh/site-functions` |
|
| **`zsh_function`** | `#{prefix}/share/zsh/site-functions` | `/opt/homebrew/Cellar/foo/0.1/share/zsh/site-functions` |
|
||||||
| **`fish_function`** | `#{prefix}/share/fish/vendor_functions` | `/usr/local/Cellar/foo/0.1/share/fish/vendor_functions` |
|
| **`fish_function`** | `#{prefix}/share/fish/vendor_functions` | `/opt/homebrew/Cellar/foo/0.1/share/fish/vendor_functions` |
|
||||||
| **`bash_completion`** | `#{prefix}/etc/bash_completion.d` | `/usr/local/Cellar/foo/0.1/etc/bash_completion.d` |
|
| **`bash_completion`** | `#{prefix}/etc/bash_completion.d` | `/opt/homebrew/Cellar/foo/0.1/etc/bash_completion.d` |
|
||||||
| **`zsh_completion`** | `#{prefix}/share/zsh/site-functions` | `/usr/local/Cellar/foo/0.1/share/zsh/site-functions` |
|
| **`zsh_completion`** | `#{prefix}/share/zsh/site-functions` | `/opt/homebrew/Cellar/foo/0.1/share/zsh/site-functions` |
|
||||||
| **`fish_completion`** | `#{prefix}/share/fish/vendor_completions.d` | `/usr/local/Cellar/foo/0.1/share/fish/vendor_completions.d` |
|
| **`fish_completion`** | `#{prefix}/share/fish/vendor_completions.d` | `/opt/homebrew/Cellar/foo/0.1/share/fish/vendor_completions.d` |
|
||||||
| **`etc`** | `#{HOMEBREW_PREFIX}/etc` | `/usr/local/etc` |
|
| **`etc`** | `#{HOMEBREW_PREFIX}/etc` | `/opt/homebrew/etc` |
|
||||||
| **`pkgetc`** | `#{HOMEBREW_PREFIX}/etc/#{name}` | `/usr/local/etc/foo` |
|
| **`pkgetc`** | `#{HOMEBREW_PREFIX}/etc/#{name}` | `/opt/homebrew/etc/foo` |
|
||||||
| **`var`** | `#{HOMEBREW_PREFIX}/var` | `/usr/local/var` |
|
| **`var`** | `#{HOMEBREW_PREFIX}/var` | `/opt/homebrew/var` |
|
||||||
| **`buildpath`** | temporary directory somewhere on your system | `/private/tmp/[formula-name]-0q2b/[formula-name]` |
|
| **`buildpath`** | temporary directory somewhere on your system | `/private/tmp/[formula-name]-0q2b/[formula-name]` |
|
||||||
|
|
||||||
These can be used, for instance, in code such as:
|
These can be used, for instance, in code such as:
|
||||||
@ -1022,7 +1022,7 @@ In the above example, the [`libressl`](https://github.com/Homebrew/homebrew-core
|
|||||||
|
|
||||||
For example, Ruby 1.9’s gems should be installed to `var/lib/ruby/` so that gems don’t need to be reinstalled when upgrading Ruby. You can usually do this with symlink trickery, or (ideally) a configure option.
|
For example, Ruby 1.9’s gems should be installed to `var/lib/ruby/` so that gems don’t need to be reinstalled when upgrading Ruby. You can usually do this with symlink trickery, or (ideally) a configure option.
|
||||||
|
|
||||||
Another example would be configuration files that should not be overwritten on package upgrades. If after installation you find that to-be-persisted configuration files are not copied but instead *symlinked* into `/usr/local/etc/` from the Cellar, this can often be rectified by passing an appropriate argument to the package’s configure script. That argument will vary depending on a given package’s configure script and/or Makefile, but one example might be: `--sysconfdir=#{etc}`
|
Another example would be configuration files that should not be overwritten on package upgrades. If after installation you find that to-be-persisted configuration files are not copied but instead *symlinked* into `$(brew --prefix)/etc/` from the Cellar, this can often be rectified by passing an appropriate argument to the package’s configure script. That argument will vary depending on a given package’s configure script and/or Makefile, but one example might be: `--sysconfdir=#{etc}`
|
||||||
|
|
||||||
### Service files
|
### Service files
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ The `site-packages` is a directory that contains Python modules, including bindi
|
|||||||
$(brew --prefix)/lib/pythonX.Y/site-packages
|
$(brew --prefix)/lib/pythonX.Y/site-packages
|
||||||
```
|
```
|
||||||
|
|
||||||
So, for Python 3.y.z, you'll find it at `/usr/local/lib/python3.y/site-packages` on macOS Intel.
|
So, for Python 3.y.z, you'll find it at `/opt/homebrew/lib/python3.y/site-packages` on Apple Silicon.
|
||||||
|
|
||||||
Python 3.y also searches for modules in:
|
Python 3.y also searches for modules in:
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ The macOS `.pkg` installer also installs Homebrew to its default prefix (`/opt/h
|
|||||||
|
|
||||||
## macOS Requirements
|
## macOS Requirements
|
||||||
|
|
||||||
* A 64-bit Intel CPU or Apple Silicon CPU <sup>[1](#1)</sup>
|
* An Apple Silicon CPU or 64-bit Intel CPU <sup>[1](#1)</sup>
|
||||||
* macOS Ventura (13) (or higher) installed on officially supported hardware<sup>[2](#2)</sup>
|
* macOS Ventura (13) (or higher) installed on officially supported hardware<sup>[2](#2)</sup>
|
||||||
* **Note:** Devices using OpenCore Legacy Patcher are not supported
|
* **Note:** Devices using OpenCore Legacy Patcher are not supported
|
||||||
* Command Line Tools (CLT) for Xcode (from `xcode-select --install` or
|
* Command Line Tools (CLT) for Xcode (from `xcode-select --install` or
|
||||||
|
@ -23,17 +23,18 @@ Linux distribution without requiring `sudo`.
|
|||||||
|
|
||||||
**prefix**
|
**prefix**
|
||||||
|
|
||||||
: path in which Homebrew is installed, e.g. `/usr/local`
|
: path in which Homebrew is installed, e.g. `/opt/homebrew` or
|
||||||
|
`/home/linuxbrew/.linuxbrew`
|
||||||
|
|
||||||
**keg**
|
**keg**
|
||||||
|
|
||||||
: installation destination directory of a given **formula** version, e.g.
|
: installation destination directory of a given **formula** version, e.g.
|
||||||
`/usr/local/Cellar/foo/0.1`
|
`/opt/homebrew/Cellar/foo/0.1`
|
||||||
|
|
||||||
**rack**
|
**rack**
|
||||||
|
|
||||||
: directory containing one or more versioned **kegs**, e.g.
|
: directory containing one or more versioned **kegs**, e.g.
|
||||||
`/usr/local/Cellar/foo`
|
`/opt/homebrew/Cellar/foo`
|
||||||
|
|
||||||
**keg-only**
|
**keg-only**
|
||||||
|
|
||||||
@ -41,15 +42,16 @@ Linux distribution without requiring `sudo`.
|
|||||||
|
|
||||||
**opt prefix**
|
**opt prefix**
|
||||||
|
|
||||||
: a symlink to the active version of a **keg**, e.g. `/usr/local/opt/foo`
|
: a symlink to the active version of a **keg**, e.g. `/opt/homebrew/opt/foo`
|
||||||
|
|
||||||
**Cellar**
|
**Cellar**
|
||||||
|
|
||||||
: directory containing one or more named **racks**, e.g. `/usr/local/Cellar`
|
: directory containing one or more named **racks**, e.g. `/opt/homebrew/Cellar`
|
||||||
|
|
||||||
**Caskroom**
|
**Caskroom**
|
||||||
|
|
||||||
: directory containing one or more named **casks**, e.g. `/usr/local/Caskroom`
|
: directory containing one or more named **casks**, e.g.
|
||||||
|
`/opt/homebrew/Caskroom`
|
||||||
|
|
||||||
**external command**
|
**external command**
|
||||||
|
|
||||||
|
@ -17,25 +17,25 @@ Homebrew package definition that builds from upstream sources
|
|||||||
Homebrew package definition that installs macOS native applications
|
Homebrew package definition that installs macOS native applications
|
||||||
.TP
|
.TP
|
||||||
\fBprefix\fP
|
\fBprefix\fP
|
||||||
path in which Homebrew is installed, e\.g\. \fB/usr/local\fP
|
path in which Homebrew is installed, e\.g\. \fB/opt/homebrew\fP or \fB/home/linuxbrew/\.linuxbrew\fP
|
||||||
.TP
|
.TP
|
||||||
\fBkeg\fP
|
\fBkeg\fP
|
||||||
installation destination directory of a given \fBformula\fP version, e\.g\. \fB/usr/local/Cellar/foo/0\.1\fP
|
installation destination directory of a given \fBformula\fP version, e\.g\. \fB/opt/homebrew/Cellar/foo/0\.1\fP
|
||||||
.TP
|
.TP
|
||||||
\fBrack\fP
|
\fBrack\fP
|
||||||
directory containing one or more versioned \fBkegs\fP, e\.g\. \fB/usr/local/Cellar/foo\fP
|
directory containing one or more versioned \fBkegs\fP, e\.g\. \fB/opt/homebrew/Cellar/foo\fP
|
||||||
.TP
|
.TP
|
||||||
\fBkeg\-only\fP
|
\fBkeg\-only\fP
|
||||||
a \fBformula\fP is \fIkeg\-only\fP if it is not symlinked into Homebrew\[u2019]s prefix
|
a \fBformula\fP is \fIkeg\-only\fP if it is not symlinked into Homebrew\[u2019]s prefix
|
||||||
.TP
|
.TP
|
||||||
\fBopt prefix\fP
|
\fBopt prefix\fP
|
||||||
a symlink to the active version of a \fBkeg\fP, e\.g\. \fB/usr/local/opt/foo\fP
|
a symlink to the active version of a \fBkeg\fP, e\.g\. \fB/opt/homebrew/opt/foo\fP
|
||||||
.TP
|
.TP
|
||||||
\fBCellar\fP
|
\fBCellar\fP
|
||||||
directory containing one or more named \fBracks\fP, e\.g\. \fB/usr/local/Cellar\fP
|
directory containing one or more named \fBracks\fP, e\.g\. \fB/opt/homebrew/Cellar\fP
|
||||||
.TP
|
.TP
|
||||||
\fBCaskroom\fP
|
\fBCaskroom\fP
|
||||||
directory containing one or more named \fBcasks\fP, e\.g\. \fB/usr/local/Caskroom\fP
|
directory containing one or more named \fBcasks\fP, e\.g\. \fB/opt/homebrew/Caskroom\fP
|
||||||
.TP
|
.TP
|
||||||
\fBexternal command\fP
|
\fBexternal command\fP
|
||||||
\fBbrew\fP subcommand defined outside of the Homebrew/brew GitHub repository
|
\fBbrew\fP subcommand defined outside of the Homebrew/brew GitHub repository
|
||||||
|
Loading…
x
Reference in New Issue
Block a user