@@ -90,19 +90,8 @@ the latest *tar.gz* release file from `the PyPI files page
9090develop Matplotlib or just need the latest bugfixed version, grab the
9191latest git version, and see :ref: `install-from-git `.
9292
93- The standard environment variables :envvar: `CC `, :envvar: `CXX `,
94- :envvar: `PKG_CONFIG ` are respected. This means you can set them if your
95- toolchain is prefixed. This may be used for cross compiling. ::
93+ Matplotlib can be installed from the source directory with a simple ::
9694
97- export CC=x86_64-pc-linux-gnu-gcc
98- export CXX=x86_64-pc-linux-gnu-g++
99- export PKG_CONFIG=x86_64-pc-linux-gnu-pkg-config
100-
101- Once you have satisfied the requirements detailed below (i.e., Python and
102- FreeType), you can build Matplotlib.
103- ::
104-
105- cd matplotlib
10695 python -m pip install .
10796
10897We provide a setup.cfg _ file which you can use to customize the build
@@ -168,29 +157,21 @@ etc., you can install the following:
168157FreeType
169158--------
170159
171- Matplotlib depends on FreeType, a font rendering library. It can either
172- download and build its own copy of the library, or use a copy of FreeType
173- already installed in your system.
174-
175- The easiest option is to make Matplotlib download and build FreeType. This is
176- done by setting the :envvar: `MPLLOCALFREETYPE ` environment variable to 1 -- on
177- Linux and OSX:
178-
179- .. code-block :: sh
180-
181- export MPLLOCALFREETYPE=1
160+ Matplotlib depends on FreeType, a font rendering library. By default,
161+ Matplotlib downloads and builds its own copy of FreeType.
182162
183- and on Windows:
163+ To force Matplotlib to use a copy of FreeType already installed in your system,
164+ create a :file: `setup.cfg ` file with the following contents:
184165
185- .. code-block :: bat
166+ .. code-block :: cfg
186167
187- set MPLLOCALFREETYPE = 1
168+ [libs]
169+ system_freetype = true
188170
189- and you can continue the installation (``python -m pip install . ``), ignoring
190- everything that follows.
171+ before running ``python -m pip install . ``.
191172
192- If you wish, instead, to use the system FreeType, you need to install the
193- FreeType library and headers. This can be achieved using a package manager:
173+ In this case, you need to install the FreeType library and headers. This can
174+ be achieved using a package manager:
194175
195176.. code-block :: sh
196177
@@ -210,6 +191,8 @@ tool for locating FreeType:
210191 sudo dnf install pkgconf # Fedora
211192 brew install pkg-config # macOS with Homebrew
212193 conda install pkg-config # conda
194+ # Or point the PKG_CONFIG environment variable to the path to pkg-config:
195+ export PKG_CONFIG=...
213196
214197 .. _pkg-config : https://www.freedesktop.org/wiki/Software/pkg-config/
215198
0 commit comments