Skip to content

Commit ac20726

Browse files
committed
Improve instructions for macOS
Signed-off-by: Ismayil Mirzali <[email protected]>
1 parent 7011c6b commit ac20726

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,37 @@ On Linux, you will need to additionally do one of the following:
7777
* use the feature `use-pkgconfig` so that rustc knows where to look for your SDL2 libraries and its dependencies for static linking. This is required because there is no built-in way to find the resources needed to link statically SDL2 from your system
7878
* install development libraries with [vcpkg][vcpkg]. Instructions to generate a static binary on Linux and other operating systems using vcpkg are [here][cargo-vcpkg-usage]
7979

80-
### Mac OS X
81-
#### If you are using homebrew
82-
On OSX, it's a good idea to install these via
80+
### macOS
81+
#### Homebrew
82+
On macOS, it's a good idea to install these via
8383
[homebrew][homebrew].
8484

85-
> brew install sdl2
85+
```
86+
brew install sdl2
87+
```
8688

87-
Then add the following to your `~/.bash_profile` if not already present.
89+
In recent versions of Homebrew, the installed libraries are usually linked into `$(brew --prefix)/lib`.
90+
If you are running an older version, the symlink for SDL might reside in `/usr/local/lib`.
8891

89-
> export LIBRARY\_PATH="$LIBRARY\_PATH:/usr/local/lib"
92+
To make linking libraries installed by Homebrew easier, do the following for your respective shell.
9093

91-
##### Otherwise if you are using macports
94+
Add this line to your `~/.zshenv` or `~/.bash_profile` depending on whether you use ZSH or Bash.
95+
```
96+
export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib"
97+
```
98+
#### MacPorts
9299
You can also get sdl2 via `macports`.
93100

94-
> sudo port install libsdl2
101+
```
102+
sudo port install libsdl2
103+
```
95104

96105
Then add the following to your `~/.bash_profile` if not already present.
106+
```
107+
export LIBRARY_PATH="$LIBRARY_PATH:/opt/local/lib/"
108+
```
97109

98-
> export LIBRARY\_PATH="$LIBRARY\_PATH:/opt/local/lib/"
99-
100-
If you're having issues with either homebrew or macports, [see here][pdev-issue].
110+
If you're having issues with either Homebrew or MacPorts, [see here][pdev-issue].
101111

102112
#### If you are using the SDL2 framework
103113

0 commit comments

Comments
 (0)