mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-14 19:36:38 +03:00
Merge pull request #6764 from hugovk/docs-tabs
Use Sphinx Inline Tabs to organise installation per OS
This commit is contained in:
commit
6a2545f628
|
@ -13,6 +13,10 @@ indent_style = space
|
||||||
|
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.rst]
|
||||||
|
# Four-space indentation
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
[*.yml]
|
[*.yml]
|
||||||
# Two-space indentation
|
# Two-space indentation
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
|
@ -15,11 +15,12 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||||
# the i18n builder cannot share the environment and doctrees with the others
|
# the i18n builder cannot share the environment and doctrees with the others
|
||||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||||
|
|
||||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
.PHONY: help
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Please use \`make <target>' where <target> is one of"
|
@echo "Please use \`make <target>' where <target> is one of"
|
||||||
@echo " html to make standalone HTML files"
|
@echo " html to make standalone HTML files"
|
||||||
|
@echo " serve to start a local server for viewing docs"
|
||||||
|
@echo " livehtml to start a local server for viewing docs and auto-reload on change"
|
||||||
@echo " dirhtml to make HTML files named index.html in directories"
|
@echo " dirhtml to make HTML files named index.html in directories"
|
||||||
@echo " singlehtml to make a single large HTML file"
|
@echo " singlehtml to make a single large HTML file"
|
||||||
@echo " pickle to make pickle files"
|
@echo " pickle to make pickle files"
|
||||||
|
@ -39,42 +40,49 @@ help:
|
||||||
@echo " linkcheck to check all external links for integrity"
|
@echo " linkcheck to check all external links for integrity"
|
||||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
-rm -rf $(BUILDDIR)/*
|
-rm -rf $(BUILDDIR)/*
|
||||||
|
|
||||||
install-sphinx:
|
install-sphinx:
|
||||||
$(PYTHON) -m pip install --quiet sphinx sphinx-copybutton sphinx-issues sphinx-removed-in sphinxext-opengraph furo olefile
|
$(PYTHON) -m pip install --quiet furo olefile sphinx sphinx-copybutton sphinx-inline-tabs sphinx-issues sphinx-removed-in sphinxext-opengraph
|
||||||
|
|
||||||
|
.PHONY: html
|
||||||
html:
|
html:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b html -W --keep-going $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
$(SPHINXBUILD) -b html -W --keep-going $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||||
|
|
||||||
|
.PHONY: dirhtml
|
||||||
dirhtml:
|
dirhtml:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||||
|
|
||||||
|
.PHONY: singlehtml
|
||||||
singlehtml:
|
singlehtml:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||||
|
|
||||||
|
.PHONY: pickle
|
||||||
pickle:
|
pickle:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished; now you can process the pickle files."
|
@echo "Build finished; now you can process the pickle files."
|
||||||
|
|
||||||
|
.PHONY: json
|
||||||
json:
|
json:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished; now you can process the JSON files."
|
@echo "Build finished; now you can process the JSON files."
|
||||||
|
|
||||||
|
.PHONY: htmlhelp
|
||||||
htmlhelp:
|
htmlhelp:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||||
|
@ -82,6 +90,7 @@ htmlhelp:
|
||||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||||
|
|
||||||
|
.PHONY: qthelp
|
||||||
qthelp:
|
qthelp:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||||
|
@ -92,6 +101,7 @@ qthelp:
|
||||||
@echo "To view the help file:"
|
@echo "To view the help file:"
|
||||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PillowPILfork.qhc"
|
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PillowPILfork.qhc"
|
||||||
|
|
||||||
|
.PHONY: devhelp
|
||||||
devhelp:
|
devhelp:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||||
|
@ -102,12 +112,14 @@ devhelp:
|
||||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PillowPILfork"
|
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PillowPILfork"
|
||||||
@echo "# devhelp"
|
@echo "# devhelp"
|
||||||
|
|
||||||
|
.PHONY: epub
|
||||||
epub:
|
epub:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||||
|
|
||||||
|
.PHONY: latex
|
||||||
latex:
|
latex:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||||
|
@ -116,6 +128,7 @@ latex:
|
||||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||||
"(use \`make latexpdf' here to do that automatically)."
|
"(use \`make latexpdf' here to do that automatically)."
|
||||||
|
|
||||||
|
.PHONY: latexpdf
|
||||||
latexpdf:
|
latexpdf:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||||
|
@ -123,18 +136,21 @@ latexpdf:
|
||||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||||
|
|
||||||
|
.PHONY: text
|
||||||
text:
|
text:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||||
|
|
||||||
|
.PHONY: man
|
||||||
man:
|
man:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||||
|
|
||||||
|
.PHONY: texinfo
|
||||||
texinfo:
|
texinfo:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||||
|
@ -143,6 +159,7 @@ texinfo:
|
||||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||||
"(use \`make info' here to do that automatically)."
|
"(use \`make info' here to do that automatically)."
|
||||||
|
|
||||||
|
.PHONY: info
|
||||||
info:
|
info:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||||
|
@ -150,18 +167,21 @@ info:
|
||||||
make -C $(BUILDDIR)/texinfo info
|
make -C $(BUILDDIR)/texinfo info
|
||||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||||
|
|
||||||
|
.PHONY: gettext
|
||||||
gettext:
|
gettext:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||||
@echo
|
@echo
|
||||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||||
|
|
||||||
|
.PHONY: changes
|
||||||
changes:
|
changes:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||||
@echo
|
@echo
|
||||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||||
|
|
||||||
|
.PHONY: linkcheck
|
||||||
linkcheck:
|
linkcheck:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck -j auto
|
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck -j auto
|
||||||
|
@ -169,14 +189,17 @@ linkcheck:
|
||||||
@echo "Link check complete; look for any errors in the above output " \
|
@echo "Link check complete; look for any errors in the above output " \
|
||||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||||
|
|
||||||
|
.PHONY: doctest
|
||||||
doctest:
|
doctest:
|
||||||
$(MAKE) install-sphinx
|
$(MAKE) install-sphinx
|
||||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||||
@echo "Testing of doctests in the sources finished, look at the " \
|
@echo "Testing of doctests in the sources finished, look at the " \
|
||||||
"results in $(BUILDDIR)/doctest/output.txt."
|
"results in $(BUILDDIR)/doctest/output.txt."
|
||||||
|
|
||||||
|
.PHONY: livehtml
|
||||||
livehtml: html
|
livehtml: html
|
||||||
livereload $(BUILDDIR)/html -p 33233
|
livereload $(BUILDDIR)/html -p 33233
|
||||||
|
|
||||||
|
.PHONY: serve
|
||||||
serve:
|
serve:
|
||||||
cd $(BUILDDIR)/html; $(PYTHON) -m http.server
|
cd $(BUILDDIR)/html; $(PYTHON) -m http.server
|
||||||
|
|
|
@ -27,12 +27,13 @@ needs_sphinx = "2.4"
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
# ones.
|
# ones.
|
||||||
extensions = [
|
extensions = [
|
||||||
"sphinx_copybutton",
|
|
||||||
"sphinx_issues",
|
|
||||||
"sphinx_removed_in",
|
|
||||||
"sphinx.ext.autodoc",
|
"sphinx.ext.autodoc",
|
||||||
"sphinx.ext.intersphinx",
|
"sphinx.ext.intersphinx",
|
||||||
"sphinx.ext.viewcode",
|
"sphinx.ext.viewcode",
|
||||||
|
"sphinx_copybutton",
|
||||||
|
"sphinx_inline_tabs",
|
||||||
|
"sphinx_issues",
|
||||||
|
"sphinx_removed_in",
|
||||||
"sphinxext.opengraph",
|
"sphinxext.opengraph",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,11 @@ Pillow supports these Python versions.
|
||||||
:file: older-versions.csv
|
:file: older-versions.csv
|
||||||
:header-rows: 1
|
:header-rows: 1
|
||||||
|
|
||||||
|
.. _Linux Installation:
|
||||||
|
.. _macOS Installation:
|
||||||
|
.. _Windows Installation:
|
||||||
|
.. _FreeBSD Installation:
|
||||||
|
|
||||||
Basic Installation
|
Basic Installation
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
@ -38,67 +43,69 @@ Install Pillow with :command:`pip`::
|
||||||
python3 -m pip install --upgrade Pillow
|
python3 -m pip install --upgrade Pillow
|
||||||
|
|
||||||
|
|
||||||
Windows Installation
|
.. tab:: Linux
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
We provide Pillow binaries for Windows compiled for the matrix of
|
We provide binaries for Linux for each of the supported Python
|
||||||
supported Pythons in both 32 and 64-bit versions in the wheel format.
|
versions in the manylinux wheel format. These include support for all
|
||||||
These binaries include support for all optional libraries except
|
optional libraries except libimagequant. Raqm support requires
|
||||||
libimagequant and libxcb. Raqm support requires
|
FriBiDi to be installed separately::
|
||||||
FriBiDi to be installed separately::
|
|
||||||
|
|
||||||
python3 -m pip install --upgrade pip
|
python3 -m pip install --upgrade pip
|
||||||
python3 -m pip install --upgrade Pillow
|
python3 -m pip install --upgrade Pillow
|
||||||
|
|
||||||
To install Pillow in MSYS2, see `Building on Windows using MSYS2/MinGW`_.
|
Most major Linux distributions, including Fedora, Ubuntu and ArchLinux
|
||||||
|
also include Pillow in packages that previously contained PIL e.g.
|
||||||
|
``python-imaging``. Debian splits it into two packages, ``python3-pil``
|
||||||
|
and ``python3-pil.imagetk``.
|
||||||
|
|
||||||
|
.. tab:: macOS
|
||||||
|
|
||||||
|
We provide binaries for macOS for each of the supported Python
|
||||||
|
versions in the wheel format. These include support for all optional
|
||||||
|
libraries except libimagequant. Raqm support requires
|
||||||
|
FriBiDi to be installed separately::
|
||||||
|
|
||||||
|
python3 -m pip install --upgrade pip
|
||||||
|
python3 -m pip install --upgrade Pillow
|
||||||
|
|
||||||
|
.. tab:: Windows
|
||||||
|
|
||||||
|
We provide Pillow binaries for Windows compiled for the matrix of
|
||||||
|
supported Pythons in both 32 and 64-bit versions in the wheel format.
|
||||||
|
These binaries include support for all optional libraries except
|
||||||
|
libimagequant and libxcb. Raqm support requires
|
||||||
|
FriBiDi to be installed separately::
|
||||||
|
|
||||||
|
python3 -m pip install --upgrade pip
|
||||||
|
python3 -m pip install --upgrade Pillow
|
||||||
|
|
||||||
|
To install Pillow in MSYS2, see `Building on Windows using MSYS2/MinGW`_.
|
||||||
|
|
||||||
|
.. tab:: FreeBSD
|
||||||
|
|
||||||
|
Pillow can be installed on FreeBSD via the official Ports or Packages systems:
|
||||||
|
|
||||||
|
**Ports**::
|
||||||
|
|
||||||
|
cd /usr/ports/graphics/py-pillow && make install clean
|
||||||
|
|
||||||
|
**Packages**::
|
||||||
|
|
||||||
|
pkg install py38-pillow
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
The `Pillow FreeBSD port
|
||||||
|
<https://www.freshports.org/graphics/py-pillow/>`_ and packages
|
||||||
|
are tested by the ports team with all supported FreeBSD versions.
|
||||||
|
|
||||||
|
|
||||||
macOS Installation
|
.. _Building on Linux:
|
||||||
^^^^^^^^^^^^^^^^^^
|
.. _Building on macOS:
|
||||||
|
.. _Building on Windows:
|
||||||
We provide binaries for macOS for each of the supported Python
|
.. _Building on Windows using MSYS2/MinGW:
|
||||||
versions in the wheel format. These include support for all optional
|
.. _Building on FreeBSD:
|
||||||
libraries except libimagequant. Raqm support requires
|
.. _Building on Android:
|
||||||
FriBiDi to be installed separately::
|
|
||||||
|
|
||||||
python3 -m pip install --upgrade pip
|
|
||||||
python3 -m pip install --upgrade Pillow
|
|
||||||
|
|
||||||
Linux Installation
|
|
||||||
^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
We provide binaries for Linux for each of the supported Python
|
|
||||||
versions in the manylinux wheel format. These include support for all
|
|
||||||
optional libraries except libimagequant. Raqm support requires
|
|
||||||
FriBiDi to be installed separately::
|
|
||||||
|
|
||||||
python3 -m pip install --upgrade pip
|
|
||||||
python3 -m pip install --upgrade Pillow
|
|
||||||
|
|
||||||
Most major Linux distributions, including Fedora, Ubuntu and ArchLinux
|
|
||||||
also include Pillow in packages that previously contained PIL e.g.
|
|
||||||
``python-imaging``. Debian splits it into two packages, ``python3-pil``
|
|
||||||
and ``python3-pil.imagetk``.
|
|
||||||
|
|
||||||
FreeBSD Installation
|
|
||||||
^^^^^^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
Pillow can be installed on FreeBSD via the official Ports or Packages systems:
|
|
||||||
|
|
||||||
**Ports**::
|
|
||||||
|
|
||||||
cd /usr/ports/graphics/py-pillow && make install clean
|
|
||||||
|
|
||||||
**Packages**::
|
|
||||||
|
|
||||||
pkg install py38-pillow
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
The `Pillow FreeBSD port
|
|
||||||
<https://www.freshports.org/graphics/py-pillow/>`_ and packages
|
|
||||||
are tested by the ports team with all supported FreeBSD versions.
|
|
||||||
|
|
||||||
|
|
||||||
Building From Source
|
Building From Source
|
||||||
--------------------
|
--------------------
|
||||||
|
@ -187,141 +194,135 @@ Many of Pillow's features require external libraries:
|
||||||
|
|
||||||
* **libxcb** provides X11 screengrab support.
|
* **libxcb** provides X11 screengrab support.
|
||||||
|
|
||||||
Building on macOS
|
.. tab:: Linux
|
||||||
"""""""""""""""""
|
|
||||||
|
|
||||||
The Xcode command line tools are required to compile portions of
|
If you didn't build Python from source, make sure you have Python's
|
||||||
Pillow. The tools are installed by running ``xcode-select --install``
|
development libraries installed.
|
||||||
from the command line. The command line tools are required even if you
|
|
||||||
have the full Xcode package installed. It may be necessary to run
|
|
||||||
``sudo xcodebuild -license`` to accept the license prior to using the
|
|
||||||
tools.
|
|
||||||
|
|
||||||
The easiest way to install external libraries is via `Homebrew
|
In Debian or Ubuntu::
|
||||||
<https://brew.sh/>`_. After you install Homebrew, run::
|
|
||||||
|
|
||||||
brew install libjpeg libtiff little-cms2 openjpeg webp
|
sudo apt-get install python3-dev python3-setuptools
|
||||||
|
|
||||||
To install libraqm on macOS use Homebrew to install its dependencies::
|
In Fedora, the command is::
|
||||||
|
|
||||||
brew install freetype harfbuzz fribidi
|
sudo dnf install python3-devel redhat-rpm-config
|
||||||
|
|
||||||
Then see ``depends/install_raqm_cmake.sh`` to install libraqm.
|
In Alpine, the command is::
|
||||||
|
|
||||||
Building on Windows
|
sudo apk add python3-dev py3-setuptools
|
||||||
"""""""""""""""""""
|
|
||||||
|
|
||||||
We recommend you use prebuilt wheels from PyPI.
|
.. Note:: ``redhat-rpm-config`` is required on Fedora 23, but not earlier versions.
|
||||||
If you wish to compile Pillow manually, you can use the build scripts
|
|
||||||
in the ``winbuild`` directory used for CI testing and development.
|
|
||||||
These scripts require Visual Studio 2017 or newer and NASM.
|
|
||||||
|
|
||||||
The scripts also install Pillow from the local copy of the source code, so the
|
Prerequisites for **Ubuntu 16.04 LTS - 22.04 LTS** are installed with::
|
||||||
`Installing`_ instructions will not be necessary afterwards.
|
|
||||||
|
|
||||||
Building on Windows using MSYS2/MinGW
|
sudo apt-get install libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev \
|
||||||
"""""""""""""""""""""""""""""""""""""
|
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk \
|
||||||
|
libharfbuzz-dev libfribidi-dev libxcb1-dev
|
||||||
|
|
||||||
To build Pillow using MSYS2, make sure you run the **MSYS2 MinGW 32-bit** or
|
To install libraqm, ``sudo apt-get install meson`` and then see
|
||||||
**MSYS2 MinGW 64-bit** console, *not* **MSYS2** directly.
|
``depends/install_raqm.sh``.
|
||||||
|
|
||||||
The following instructions target the 64-bit build, for 32-bit
|
Prerequisites are installed on recent **Red Hat**, **CentOS** or **Fedora** with::
|
||||||
replace all occurrences of ``mingw-w64-x86_64-`` with ``mingw-w64-i686-``.
|
|
||||||
|
|
||||||
Make sure you have Python and GCC installed::
|
sudo dnf install libtiff-devel libjpeg-devel openjpeg2-devel zlib-devel \
|
||||||
|
freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel \
|
||||||
|
harfbuzz-devel fribidi-devel libraqm-devel libimagequant-devel libxcb-devel
|
||||||
|
|
||||||
pacman -S \
|
Note that the package manager may be yum or DNF, depending on the
|
||||||
mingw-w64-x86_64-gcc \
|
exact distribution.
|
||||||
mingw-w64-x86_64-python3 \
|
|
||||||
mingw-w64-x86_64-python3-pip \
|
|
||||||
mingw-w64-x86_64-python3-setuptools
|
|
||||||
|
|
||||||
Prerequisites are installed on **MSYS2 MinGW 64-bit** with::
|
Prerequisites are installed for **Alpine** with::
|
||||||
|
|
||||||
pacman -S \
|
sudo apk add tiff-dev jpeg-dev openjpeg-dev zlib-dev freetype-dev lcms2-dev \
|
||||||
mingw-w64-x86_64-libjpeg-turbo \
|
libwebp-dev tcl-dev tk-dev harfbuzz-dev fribidi-dev libimagequant-dev \
|
||||||
mingw-w64-x86_64-zlib \
|
libxcb-dev libpng-dev
|
||||||
mingw-w64-x86_64-libtiff \
|
|
||||||
mingw-w64-x86_64-freetype \
|
|
||||||
mingw-w64-x86_64-lcms2 \
|
|
||||||
mingw-w64-x86_64-libwebp \
|
|
||||||
mingw-w64-x86_64-openjpeg2 \
|
|
||||||
mingw-w64-x86_64-libimagequant \
|
|
||||||
mingw-w64-x86_64-libraqm
|
|
||||||
|
|
||||||
Building on FreeBSD
|
See also the ``Dockerfile``\s in the Test Infrastructure repo
|
||||||
"""""""""""""""""""
|
(https://github.com/python-pillow/docker-images) for a known working
|
||||||
|
install process for other tested distros.
|
||||||
|
|
||||||
.. Note:: Only FreeBSD 10 and 11 tested
|
.. tab:: macOS
|
||||||
|
|
||||||
Make sure you have Python's development libraries installed::
|
The Xcode command line tools are required to compile portions of
|
||||||
|
Pillow. The tools are installed by running ``xcode-select --install``
|
||||||
|
from the command line. The command line tools are required even if you
|
||||||
|
have the full Xcode package installed. It may be necessary to run
|
||||||
|
``sudo xcodebuild -license`` to accept the license prior to using the
|
||||||
|
tools.
|
||||||
|
|
||||||
sudo pkg install python3
|
The easiest way to install external libraries is via `Homebrew
|
||||||
|
<https://brew.sh/>`_. After you install Homebrew, run::
|
||||||
|
|
||||||
Prerequisites are installed on **FreeBSD 10 or 11** with::
|
brew install libjpeg libtiff little-cms2 openjpeg webp
|
||||||
|
|
||||||
sudo pkg install jpeg-turbo tiff webp lcms2 freetype2 openjpeg harfbuzz fribidi libxcb
|
To install libraqm on macOS use Homebrew to install its dependencies::
|
||||||
|
|
||||||
Then see ``depends/install_raqm_cmake.sh`` to install libraqm.
|
brew install freetype harfbuzz fribidi
|
||||||
|
|
||||||
Building on Linux
|
Then see ``depends/install_raqm_cmake.sh`` to install libraqm.
|
||||||
"""""""""""""""""
|
|
||||||
|
|
||||||
If you didn't build Python from source, make sure you have Python's
|
.. tab:: Windows
|
||||||
development libraries installed.
|
|
||||||
|
|
||||||
In Debian or Ubuntu::
|
We recommend you use prebuilt wheels from PyPI.
|
||||||
|
If you wish to compile Pillow manually, you can use the build scripts
|
||||||
|
in the ``winbuild`` directory used for CI testing and development.
|
||||||
|
These scripts require Visual Studio 2017 or newer and NASM.
|
||||||
|
|
||||||
sudo apt-get install python3-dev python3-setuptools
|
The scripts also install Pillow from the local copy of the source code, so the
|
||||||
|
`Installing`_ instructions will not be necessary afterwards.
|
||||||
|
|
||||||
In Fedora, the command is::
|
.. tab:: Windows using MSYS2/MinGW
|
||||||
|
|
||||||
sudo dnf install python3-devel redhat-rpm-config
|
To build Pillow using MSYS2, make sure you run the **MSYS2 MinGW 32-bit** or
|
||||||
|
**MSYS2 MinGW 64-bit** console, *not* **MSYS2** directly.
|
||||||
|
|
||||||
In Alpine, the command is::
|
The following instructions target the 64-bit build, for 32-bit
|
||||||
|
replace all occurrences of ``mingw-w64-x86_64-`` with ``mingw-w64-i686-``.
|
||||||
|
|
||||||
sudo apk add python3-dev py3-setuptools
|
Make sure you have Python and GCC installed::
|
||||||
|
|
||||||
.. Note:: ``redhat-rpm-config`` is required on Fedora 23, but not earlier versions.
|
pacman -S \
|
||||||
|
mingw-w64-x86_64-gcc \
|
||||||
|
mingw-w64-x86_64-python3 \
|
||||||
|
mingw-w64-x86_64-python3-pip \
|
||||||
|
mingw-w64-x86_64-python3-setuptools
|
||||||
|
|
||||||
Prerequisites for **Ubuntu 16.04 LTS - 22.04 LTS** are installed with::
|
Prerequisites are installed on **MSYS2 MinGW 64-bit** with::
|
||||||
|
|
||||||
sudo apt-get install libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev \
|
pacman -S \
|
||||||
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk \
|
mingw-w64-x86_64-libjpeg-turbo \
|
||||||
libharfbuzz-dev libfribidi-dev libxcb1-dev
|
mingw-w64-x86_64-zlib \
|
||||||
|
mingw-w64-x86_64-libtiff \
|
||||||
|
mingw-w64-x86_64-freetype \
|
||||||
|
mingw-w64-x86_64-lcms2 \
|
||||||
|
mingw-w64-x86_64-libwebp \
|
||||||
|
mingw-w64-x86_64-openjpeg2 \
|
||||||
|
mingw-w64-x86_64-libimagequant \
|
||||||
|
mingw-w64-x86_64-libraqm
|
||||||
|
|
||||||
To install libraqm, ``sudo apt-get install meson`` and then see
|
.. tab:: FreeBSD
|
||||||
``depends/install_raqm.sh``.
|
|
||||||
|
|
||||||
Prerequisites are installed on recent **Red Hat**, **CentOS** or **Fedora** with::
|
.. Note:: Only FreeBSD 10 and 11 tested
|
||||||
|
|
||||||
sudo dnf install libtiff-devel libjpeg-devel openjpeg2-devel zlib-devel \
|
Make sure you have Python's development libraries installed::
|
||||||
freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel \
|
|
||||||
harfbuzz-devel fribidi-devel libraqm-devel libimagequant-devel libxcb-devel
|
|
||||||
|
|
||||||
Note that the package manager may be yum or DNF, depending on the
|
sudo pkg install python3
|
||||||
exact distribution.
|
|
||||||
|
|
||||||
Prerequisites are installed for **Alpine** with::
|
Prerequisites are installed on **FreeBSD 10 or 11** with::
|
||||||
|
|
||||||
sudo apk add tiff-dev jpeg-dev openjpeg-dev zlib-dev freetype-dev lcms2-dev \
|
sudo pkg install jpeg-turbo tiff webp lcms2 freetype2 openjpeg harfbuzz fribidi libxcb
|
||||||
libwebp-dev tcl-dev tk-dev harfbuzz-dev fribidi-dev libimagequant-dev \
|
|
||||||
libxcb-dev libpng-dev
|
|
||||||
|
|
||||||
See also the ``Dockerfile``\s in the Test Infrastructure repo
|
Then see ``depends/install_raqm_cmake.sh`` to install libraqm.
|
||||||
(https://github.com/python-pillow/docker-images) for a known working
|
|
||||||
install process for other tested distros.
|
|
||||||
|
|
||||||
Building on Android
|
.. tab:: Android
|
||||||
"""""""""""""""""""
|
|
||||||
|
|
||||||
Basic Android support has been added for compilation within the Termux
|
Basic Android support has been added for compilation within the Termux
|
||||||
environment. The dependencies can be installed by::
|
environment. The dependencies can be installed by::
|
||||||
|
|
||||||
pkg install -y python ndk-sysroot clang make \
|
pkg install -y python ndk-sysroot clang make \
|
||||||
libjpeg-turbo
|
libjpeg-turbo
|
||||||
|
|
||||||
This has been tested within the Termux app on ChromeOS, on x86.
|
This has been tested within the Termux app on ChromeOS, on x86.
|
||||||
|
|
||||||
Installing
|
Installing
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
|
Loading…
Reference in New Issue
Block a user