Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfb493f4

Browse files
committed
Allow linking against a system qhull as well.
1 parent5d6f889 commitfb493f4

File tree

3 files changed

+33
-30
lines changed

3 files changed

+33
-30
lines changed

‎INSTALL.rst‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ Dependencies
109109
Matplotlib requires the following dependencies:
110110

111111
* `Python<https://www.python.org/downloads/>`_ (>= 3.6)
112-
* `FreeType<https://www.freetype.org/>`_ (>= 2.3)
113112
* `NumPy<http://www.numpy.org>`_ (>= 1.11)
114113
* `setuptools<https://setuptools.readthedocs.io/en/latest/>`_
115114
* `cycler<http://matplotlib.org/cycler/>`_ (>= 0.10.0)
@@ -154,24 +153,27 @@ etc., you can install the following:
154153
* `LaTeX<https://miktex.org/>`_ and `GhostScript (>=9.0)
155154
<https://ghostscript.com/download/>`_ : for rendering text with LaTeX.
156155

157-
FreeType
158-
--------
156+
FreeType and Qhull
157+
------------------
159158

160-
Matplotlib depends on FreeType, a font rendering library. By default,
161-
Matplotlib downloads and builds its own copy of FreeType.
159+
Matplotlib depends on `FreeType<https://www.freetype.org/>`_ (>= 2.3), a
160+
font rendering library, and on `Qhull<http://www.qhull.org/>`_ (>= 2015.2),
161+
a library for computing triangulations. By default, Matplotlib downloads and
162+
builds its own copy of FreeType, and uses its own copy of Qhull.
162163

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:
164+
To force Matplotlib to use a copy of FreeTypeor Qhullalready installed in
165+
your system,create a:file:`setup.cfg` file with the following contents:
165166

166167
..code-block::cfg
167168
168169
[libs]
169170
system_freetype = true
171+
system_qhull = true
170172
171173
before running ``python -m pip install .``.
172174

173-
In this case, you need to install the FreeType library and headers. This can
174-
be achieved using a package manager:
175+
In this case, you need to install the FreeTypeand Qhulllibrary and headers.
176+
This canbe achieved using a package manager, e.g. for FreeType:
175177

176178
..code-block::sh
177179
@@ -181,6 +183,8 @@ be achieved using a package manager:
181183
brew install freetype# macOS with Homebrew
182184
conda install freetype# conda, any OS
183185
186+
(adapt accordingly for Qhull).
187+
184188
On Linux and macOS, it is also recommended to installpkg-config_, a helper
185189
tool for locating FreeType:
186190

@@ -197,7 +201,7 @@ tool for locating FreeType:
197201
.. _pkg-config:https://www.freedesktop.org/wiki/Software/pkg-config/
198202

199203
If not using pkg-config (in particular on Windows), you may need to set the
200-
include path (to theFreeType headers) and link path (to theFreeType library)
204+
include path (to thelibrary headers) and link path (to thelibraries)
201205
explicitly, if they are not in standard locations. This can be done using
202206
standard environment variables -- on Linux and OSX:
203207

@@ -215,10 +219,9 @@ and on Windows:
215219
216220
..note::
217221

218-
The following libraries are shipped with Matplotlib:
222+
Matplotlib always uses its own copies of the following libraries:
219223

220224
- ``Agg``: the Anti-Grain Geometry C++ rendering engine;
221-
- ``qhull``: to compute Delaunay triangulation;
222225
- ``ttconv``: a TrueType font utility.
223226

224227
Building on Windows

‎setup.cfg.template‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
[egg_info]
55

66
[libs]
7-
# By default, Matplotlib downloads and builds its own copy of FreeType. You
8-
# may set the followingvariableto True to instead link against a system
9-
# FreeType.
7+
# By default, Matplotlib downloads and builds its own copy of FreeType, and
8+
#builds its own copy of Qhull. Youmay set the following to True to instead
9+
#link against a systemFreeType/Qhull.
1010
#system_freetype = False
11+
#system_qhull = False
1112

1213
[packages]
1314
# There are a number of data subpackages from Matplotlib that are

‎setupext.py‎

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,20 +149,19 @@ def write_cache(local_fn, data):
149149

150150

151151
# matplotlib build options, which can be altered using setup.cfg
152-
options= {
153-
'backend':None,
154-
}
155-
156-
157152
setup_cfg=os.environ.get('MPLSETUPCFG','setup.cfg')
158153
ifos.path.exists(setup_cfg):
159154
config=configparser.ConfigParser()
160155
config.read(setup_cfg)
161-
options['backend']=config.get('rc_options','backend',fallback=None)
162-
options['system_freetype']=config.getboolean('libs','system_freetype',
163-
fallback=False)
156+
options= {
157+
'backend':config.get('rc_options','backend',fallback=None)
158+
'system_freetype':config.getboolean('libs','system_freetype',
159+
fallback=False)
160+
'system_qhull':config.getboolean('libs','system_qhull',
161+
fallback=False)
164162
else:
165163
config=None
164+
options= {}
166165

167166

168167
if'-q'insys.argvor'--quiet'insys.argv:
@@ -614,13 +613,13 @@ class Qhull(SetupPackage):
614613
name="qhull"
615614

616615
defadd_flags(self,ext):
617-
# Qhull doesn't distribute pkg-config info, so we have no way of
618-
# knowing whether a system install is recent enough. Thus, always use
619-
# the vendored version.
620-
ext.include_dirs.insert(0,'extern')
621-
ext.sources.extend(sorted(glob.glob('extern/libqhull/*.c')))
622-
ifsysconfig.get_config_var('LIBM')=='-lm':
623-
ext.libraries.extend('m')
616+
ifoptions.get('system_qhull'):
617+
ext.libraries.append('qhull')
618+
else:
619+
ext.include_dirs.insert(0,'extern')
620+
ext.sources.extend(sorted(glob.glob('extern/libqhull/*.c')))
621+
ifsysconfig.get_config_var('LIBM')=='-lm':
622+
ext.libraries.extend('m')
624623

625624

626625
classTTConv(SetupPackage):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp