docs: mention standard argument methods
This commit is contained in:
parent
8537849f83
commit
09b7a7bceb
@ -435,6 +435,17 @@ if build.head?
|
|||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Standard arguments
|
||||||
|
|
||||||
|
For any formula using a well-known build system, there'll be arguments that should be passed during compilation such that its build conforms to Homebrew standards. These have been collected into a set of `std_*_args` methods (like [`std_configure_args`](https://rubydoc.brew.sh/Formula#std_configure_args-instance_method) and [`std_cmake_args`](https://rubydoc.brew.sh/Formula#std_cmake_args-instance_method) as seen in the [output of `brew create`](#grab-the-url)) that set the build type and installation paths, plus any other applicable options.
|
||||||
|
|
||||||
|
Most of these methods accept parameters to customize their output. For example, to set the install prefix to [**`libexec`**](#variables-for-directory-locations) for `configure` or `cmake`:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
system "./configure", *std_configure_args(prefix: libexec)
|
||||||
|
system "cmake", "-S", ".", "-B", "build", *std_cmake_args(install_prefix: libexec)
|
||||||
|
```
|
||||||
|
|
||||||
### `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 (`/usr/local/Cellar/pkg/0.1/bin`) and makes it executable (`chmod 0555 foo`).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user