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