mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-03 05:04:24 +03:00
Swapped config key and value
This commit is contained in:
parent
87807727eb
commit
2d0b13b812
|
@ -7,14 +7,37 @@ from setuptools.build_meta import _BuildMetaBackend
|
|||
class _CustomBuildMetaBackend(_BuildMetaBackend):
|
||||
def run_setup(self, setup_script="setup.py"):
|
||||
if self.config_settings:
|
||||
flags = []
|
||||
for key in ("enable", "disable", "vendor"):
|
||||
|
||||
def config_has(key, value):
|
||||
settings = self.config_settings.get(key)
|
||||
if settings:
|
||||
if not isinstance(settings, list):
|
||||
settings = [settings]
|
||||
for value in settings:
|
||||
flags.append("--" + key + "-" + value)
|
||||
return value in settings
|
||||
|
||||
flags = []
|
||||
for dependency in (
|
||||
"zlib",
|
||||
"jpeg",
|
||||
"tiff",
|
||||
"freetype",
|
||||
"raqm",
|
||||
"lcms",
|
||||
"webp",
|
||||
"webpmux",
|
||||
"jpeg2000",
|
||||
"imagequant",
|
||||
"xcb",
|
||||
):
|
||||
if config_has(dependency, "enable"):
|
||||
flags.append("--enable-" + dependency)
|
||||
elif config_has(dependency, "disable"):
|
||||
flags.append("--disable-" + dependency)
|
||||
for dependency in ("raqm", "fribidi"):
|
||||
if config_has(dependency, "vendor"):
|
||||
flags.append("--vendor-" + dependency)
|
||||
if self.config_settings.get("platform-guessing") == "disable":
|
||||
flags.append("--disable-platform-guessing")
|
||||
if self.config_settings.get("debug") == "true":
|
||||
flags.append("--debug")
|
||||
if flags:
|
||||
|
|
|
@ -380,28 +380,28 @@ Build Options
|
|||
using a setting of 1. By default, it uses 4 CPUs, or if 4 are not
|
||||
available, as many as are present.
|
||||
|
||||
* Config settings: ``-C disable=zlib``, ``-C disable=jpeg``,
|
||||
``-C disable=tiff``, ``-C disable=freetype``, ``-C disable=raqm``,
|
||||
``-C disable=lcms``, ``-C disable=webp``, ``-C disable=webpmux``,
|
||||
``-C disable=jpeg2000``, ``-C disable=imagequant``, ``-C disable=xcb``.
|
||||
* Config settings: ``-C zlib=disable``, ``-C jpeg=disable``,
|
||||
``-C tiff=disable``, ``-C freetype=disable``, ``-C raqm=disable``,
|
||||
``-C lcms=disable``, ``-C webp=disable``, ``-C webpmux=disable``,
|
||||
``-C jpeg2000=disable``, ``-C imagequant=disable``, ``-C xcb=disable``.
|
||||
Disable building the corresponding feature even if the development
|
||||
libraries are present on the building machine.
|
||||
|
||||
* Config settings: ``-C enable=zlib``, ``-C enable=jpeg``,
|
||||
``-C enable=tiff``, ``-C enable=freetype``, ``-C enable=raqm``,
|
||||
``-C enable=lcms``, ``-C enable=webp``, ``-C enable=webpmux``,
|
||||
``-C enable=jpeg2000``, ``-C enable=imagequant``, ``-C enable=xcb``.
|
||||
* Config settings: ``-C zlib=enable``, ``-C jpeg=enable``,
|
||||
``-C tiff=enable``, ``-C freetype=enable``, ``-C raqm=enable``,
|
||||
``-C lcms=enable``, ``-C webp=enable``, ``-C webpmux=enable``,
|
||||
``-C jpeg2000=enable``, ``-C imagequant=enable``, ``-C xcb=enable``.
|
||||
Require that the corresponding feature is built. The build will raise
|
||||
an exception if the libraries are not found. Webpmux (WebP metadata)
|
||||
relies on WebP support. Tcl and Tk also must be used together.
|
||||
|
||||
* Config settings: ``-C vendor=raqm``, ``-C vendor=fribidi``.
|
||||
* Config settings: ``-C raqm=vendor``, ``-C fribidi=vendor``.
|
||||
These flags are used to compile a modified version of libraqm and
|
||||
a shim that dynamically loads libfribidi at runtime. These are
|
||||
used to compile the standard Pillow wheels. Compiling libraqm requires
|
||||
a C99-compliant compiler.
|
||||
|
||||
* Build flag: ``-C disable=platform-guessing``. Skips all of the
|
||||
* Build flag: ``-C platform-guessing=disable``. Skips all of the
|
||||
platform dependent guessing of include and library directories for
|
||||
automated build systems that configure the proper paths in the
|
||||
environment variables (e.g. Buildroot).
|
||||
|
@ -413,7 +413,7 @@ Build Options
|
|||
|
||||
Sample usage::
|
||||
|
||||
python3 -m pip install --upgrade Pillow -C enable=[feature]
|
||||
python3 -m pip install --upgrade Pillow -C [feature]=enable
|
||||
|
||||
Platform Support
|
||||
----------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user