Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve some $(brew --prefix) usage #14738

Merged
merged 2 commits into from Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/Gems,-Eggs-and-Perl-Modules.md
Expand Up @@ -60,7 +60,7 @@ which therefore don’t need sudo.

_This is only recommended if you **don't** use rbenv or RVM._

Brewed Ruby installs executables to `$(brew --prefix)/opt/ruby/bin`
Brewed Ruby installs executables to `$(brew --prefix ruby)/bin`
without sudo. You should add this to your path. See the caveats in the
`ruby` formula for up-to-date information.

Expand Down Expand Up @@ -91,7 +91,7 @@ Just install everything into the Homebrew prefix like this:
echo "export GEM_HOME=\"$(brew --prefix)\"" >> ~/.bashrc
```

### It doesn’t work! I get some “permissions” error when I try to install stuff!
### It doesn’t work! I get some “permissions” error when I try to install stuff

_Note that you may not want to do this, since Apple has decided it
is not a good default._
Expand Down
2 changes: 1 addition & 1 deletion docs/Homebrew-and-Python.md
Expand Up @@ -23,7 +23,7 @@ The executables are organised as follows:
Unversioned symlinks for `python`, `python-config`, `pip` etc. are installed here:

```sh
$(brew --prefix)/opt/python/libexec/bin
$(brew --prefix python)/libexec/bin
```

## Setuptools, pip, etc.
Expand Down
Expand Up @@ -27,21 +27,21 @@ Useful, reliable alternatives exist should you wish to use keg-only tools outsid
You can set flags to give configure scripts or Makefiles a nudge in the right direction. An example of flag setting:

```sh
./configure --prefix=/Users/Dave/Downloads CFLAGS="-I$(brew --prefix)/opt/openssl/include" LDFLAGS="-L$(brew --prefix)/opt/openssl/lib"
./configure --prefix=/Users/Dave/Downloads CFLAGS="-I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib"
```

An example using `pip`:

```sh
CFLAGS="-I$(brew --prefix)/opt/icu4c/include" LDFLAGS="-L$(brew --prefix)/opt/icu4c/lib" pip install pyicu
CFLAGS="-I$(brew --prefix icu4c)/include" LDFLAGS="-L$(brew --prefix icu4c)/lib" pip install pyicu
```

### `PATH` modification

You can temporarily prepend your `PATH` with the tool’s `bin` directory, such as:

```sh
export PATH="$(brew --prefix)/opt/openssl/bin:${PATH}"
export PATH="$(brew --prefix openssl)/bin:${PATH}"
```

This will prepend the directory to your `PATH`, ensuring any build script that searches the `PATH` will find it first.
Expand All @@ -55,7 +55,7 @@ If the tool you are attempting to build is [pkg-config](https://en.wikipedia.org
An example of this is:

```sh
export PKG_CONFIG_PATH="$(brew --prefix)/opt/openssl/lib/pkgconfig"
export PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig"
```

If you’re curious about the `PKG_CONFIG_PATH` variable, `man pkg-config` goes into more detail.
Expand Down